https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec
Terraform module to provision an AWS ECS CodeDeploy AppSpec.
https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec
appspec aws codedeploy ecs terraform terraform-module
Last synced: 10 months ago
JSON representation
Terraform module to provision an AWS ECS CodeDeploy AppSpec.
- Host: GitHub
- URL: https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec
- Owner: geekcell
- License: apache-2.0
- Created: 2023-01-12T10:15:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-28T10:16:11.000Z (almost 3 years ago)
- Last Synced: 2025-07-29T18:47:19.948Z (10 months ago)
- Topics: appspec, aws, codedeploy, ecs, terraform, terraform-module
- Language: HCL
- Homepage: https://www.geekcell.io
- Size: 22.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.geekcell.io/)
### Code Quality
[](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/blob/master/LICENSE)
[](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/releases)
[](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/actions/workflows/release.yaml)
[](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/actions/workflows/validate.yaml)
[](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/actions/workflows/linter.yaml)
### Security
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=INFRASTRUCTURE+SECURITY)
#### Cloud
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+AWS+V1.2)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+AWS+V1.3)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+AZURE+V1.1)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+AZURE+V1.3)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+GCP+V1.1)
##### Container
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+KUBERNETES+V1.6)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+EKS+V1.1)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+GKE+V1.1)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+KUBERNETES+V1.5)
#### Data protection
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=SOC2)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=PCI-DSS+V3.2)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=PCI-DSS+V3.2.1)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=ISO27001)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=NIST-800-53)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=HIPAA)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=FEDRAMP+%28MODERATE%29)
# Terraform AWS ECS CodeDeploy AppSpec Module
Terraform module which renders a valid AppSpec file from a `aws_ecs_service` and, optionally, stores it in the
SSM Parameter store. Why?
For deployments with CODE\_DEPLOY, an AppSpec file with the LoadBalancer info is required. The file is stored in
the SSM Parameter Store and can be fetched during the deployment to allow us to change these parameters after
the service has already been created. Structure is defined here:
https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-example.html#appspec-file-example-ecs
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [aws\_ecs\_service](#input\_aws\_ecs\_service) | A complete `aws_ecs_service` resource to extract the inputs from. | `any` | n/a | yes |
| [description](#input\_description) | Description of the SSM Parameter. | `string` | `null` | no |
| [enable\_ssm\_parameter](#input\_enable\_ssm\_parameter) | Create an AWS SSM Parameter for the rendered AppSpec. | `bool` | `true` | no |
| [name](#input\_name) | Name of the SSM Parameter. | `string` | `null` | no |
| [ssm\_parameter\_format](#input\_ssm\_parameter\_format) | The output format for rendered AppSpec file to write to SSM. Can be `json` or `yaml`. | `string` | `"json"` | no |
| [tags](#input\_tags) | Tags to add to the SSM Parameter. | `map(any)` | `{}` | no |
## Outputs
| Name | Description |
|------|-------------|
| [appspec](#output\_appspec) | The AppSpec definition as HCL object. |
| [appspec\_json](#output\_appspec\_json) | The AppSpec definition as JSON string. |
| [appspec\_yaml](#output\_appspec\_yaml) | The AppSpec definition as YAML string. |
| [ssm\_parameter\_arn](#output\_ssm\_parameter\_arn) | The ARN of the SSM parameter containing the AppSpec definition. |
## Providers
| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >= 4.36 |
## Resources
- resource.aws_ssm_parameter.main (main.tf#44)
# Examples
### Min
```hcl
resource "aws_ecs_service" "example" {
name = "example"
task_definition = "some-task-definition:1"
platform_version = "LATEST"
load_balancer {
container_name = "app"
container_port = 80
}
network_configuration {
subnets = ["subnet-12345678", "subnet-87654321"]
security_groups = ["sg-12345678"]
assign_public_ip = false
}
}
module "example" {
source = "../../"
aws_ecs_service = aws_ecs_service.example
}
```