AppDynamics: ECS Fargate instrumentation using Terraform
Amazon Elastic Container Service (ECS) is a scalable container management service that makes it easy to run, stop, and manage Docker containers on Amazon EC2 clusters.
This project demonstrates how AppDynamics agents can be embedded into an existing ECS/Fargate setup using Terraform.
The primary considerations that went into the design of this project are:
In addition, we leveraged on AWS CloudFormation’s DependsOn
attribute to:
This demo creates the following AWS resources:
AppDynamics
and the main container application
(Source: https://aws.amazon.com/de/blogs/compute/task-networking-in-aws-fargate/)
template/app.json.tpl
file. Please review the DependsOn
section and the AppDynamics environment variables. secrets.auto.tfvars
Remove .example from the file name. appdynamics.auto.tfvars
with your controller credentials and the agent’s container registry. First, you will need to set up the Terraform provider to talk to your AWS account. Please refer to main.tf
provider "aws" {
access_key = var.aws-access-key
secret_key = var.aws-secret-key
region = var.aws-region
version = "~> 2.0"
}
You can also leave out access_key and secret_key; then Terraform will use the profile values stored in your .aws/config.
Next, execute the following commands:
$ terraform init
$ terraform plan
$ terraform apply
$ terraform destroy