This provider allows development teams to easily set up Adobe Experience Manager (AEM) instances on virtual machines in the cloud (AWS, Azure, GCP, etc.) or bare metal machines. It's based on the AEM Compose tool and aims to simplify the process of creating AEM environments without requiring deep DevOps knowledge.
Published in Terraform Registry.
- Talk at AdaptTo 2024 Conference - First-ever IaC Providers for AEM by Krystian Panek
The main purpose of this provider is to enable users to:
- Set up as many AEM environments as needed with minimal effort
- Eliminate the need for deep DevOps knowledge
- Allow for seamless integration with popular cloud platforms such as AWS and Azure
- Provide a simple and efficient way to manage AEM instances
- Easy configuration and management of AEM instances
- Support for multiple cloud platforms and bare metal machines
- Seamless integration with Terraform for infrastructure provisioning
- Based on the powerful AEM Compose tool
Provides an AEM instance resource to set up one or more AEM instances on virtual machines in the cloud or bare metal machines. Below configuration is a generic example of how to use the provider:
resource "aem_instance" "single" {
depends_on = [] // for example: [aws_instance.aem_single, aws_volume_attachment.aem_single_data]
// see available connection types: https://github.com/wttech/terraform-provider-aem/blob/main/internal/client/client_manager.go
client {
type = "<type>" // 'aws-ssm' or 'ssh'
settings = {
// type-specific values goes here
}
credentials = {
// type-specific values goes here
}
}
system {
bootstrap = {
inline = [
// commands to execute only once on the machine (not idempotent)
]
}
}
compose {
create = {
inline = [
// commands to execute before launching AEM instances (idempotent)
// for downloading AEM files, etc.
]
}
configure = {
inline = [
// commands to execute after launching AEM instances (idempotent)
// for provisioning AEM instances: setting replication agents, installing packages, etc.
]
}
}
}
output "aem_instances" {
value = aem_instance.single.instances
}
The easiest way to get started is to review, copy and adapt provided examples:
- Clone the repository
- Enter the repository directory
- Build the provider using the Go
install
command:
go install
This provider uses Go modules. Please see the Go documentation for the most up to date information about using Go modules.
To add a new dependency github.com/author/dependency
to your Terraform provider:
go get github.com/author/dependency
go mod tidy
Then commit the changes to go.mod
and go.sum
.
Before running any Terraform command simply set the environment variable TF_LOG=INFO
(or ultimately TF_LOG=DEBUG
) to see detailed logs about progress of the setting up the AEM instances.
If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).
To compile the provider, run go install
. This will build the provider and put the provider binary in the $GOPATH/bin
directory.
To generate or update documentation, run go generate
.
In order to run the full suite of Acceptance tests, run make testacc
.
Note: Acceptance tests create real resources, and often cost money to run.
make testacc
Run command: sh develop.sh <example_path> <tf_args>
.
For example:
-
sh develop.sh examples/aws_ssh plan
-
sh develop.sh examples/aws_ssh apply -auto-approve
-
sh develop.sh examples/aws_ssh destroy -auto-approve
-
sh develop.sh examples/aws_ssm plan
-
sh develop.sh examples/aws_ssm apply -auto-approve
-
sh develop.sh examples/aws_ssm destroy -auto-approve
- Run command
go run . -debug
from IDEA in debug mode and copy the value ofTF_REATTACH_PROVIDERS
from the output. - Set up breakpoint in the code.
- Run
TF_REATTACH_PROVIDERS=<value_copied_above> TF_CLI_CONFIG_FILE=$(pwd)/../../dev_overrides.tfrc terraform apply
in one of the examples directory. - The breakpoint should be hit.