An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

[![Geek Cell GmbH](https://raw.githubusercontent.com/geekcell/.github/main/geekcell-github-banner.png)](https://www.geekcell.io/)

### Code Quality
[![License](https://img.shields.io/github/license/geekcell/terraform-aws-ecs-codedeploy-appspec)](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/blob/master/LICENSE)
[![GitHub release (latest tag)](https://img.shields.io/github/v/release/geekcell/terraform-aws-ecs-codedeploy-appspec?logo=github&sort=semver)](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/releases)
[![Release](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/actions/workflows/release.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/actions/workflows/release.yaml)
[![Validate](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/actions/workflows/validate.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/actions/workflows/validate.yaml)
[![Lint](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/actions/workflows/linter.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-ecs-codedeploy-appspec/actions/workflows/linter.yaml)

### Security
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/general)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=INFRASTRUCTURE+SECURITY)

#### Cloud
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/cis_aws)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+AWS+V1.2)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/cis_aws_13)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+AWS+V1.3)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/cis_azure)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+AZURE+V1.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/cis_azure_13)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+AZURE+V1.3)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/cis_gcp)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+GCP+V1.1)

##### Container
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/cis_kubernetes_16)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+KUBERNETES+V1.6)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/cis_eks_11)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+EKS+V1.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/cis_gke_11)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+GKE+V1.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/cis_kubernetes)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=CIS+KUBERNETES+V1.5)

#### Data protection
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/soc2)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=SOC2)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/pci)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=PCI-DSS+V3.2)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/pci_dss_v321)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=PCI-DSS+V3.2.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/iso)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=ISO27001)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/nist)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=NIST-800-53)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/hipaa)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-ecs-codedeploy-appspec&benchmark=HIPAA)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-ecs-codedeploy-appspec/fedramp_moderate)](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
}
```