Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Add support for creating ECS service and container definition #76

Merged
merged 41 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d45632c
feat: Add support for ECS service
bryantbiggs Jun 11, 2022
1b0bb21
feat: Add support for ECS task definition
bryantbiggs Jun 12, 2022
bcae52d
feat: Add support for ECS service IAM role
bryantbiggs Jun 12, 2022
718353c
feat: Add support for ECS task execution and ECS tasks IAM roles
bryantbiggs Aug 28, 2022
e6c17dd
feat: Add support for ECS task sets
bryantbiggs Aug 28, 2022
1f5f485
feat: Add support for container definition sub-module
bryantbiggs Nov 5, 2022
a4f3fcd
feat: Update service module to latest spec and integrate `container-d…
bryantbiggs Nov 5, 2022
5255af5
chore: Update examples to use service sub-module
bryantbiggs Nov 6, 2022
c59b22a
feat: Add support for service autoscaling
bryantbiggs Nov 6, 2022
986e2b2
feat: Setting defaults based on docs and ECS guidance
bryantbiggs Nov 7, 2022
114430e
feat: Add support for ECS service connect
bryantbiggs Dec 15, 2022
5750dff
feat: Add support for timeouts and triggers on ECS service
bryantbiggs Dec 15, 2022
7cb25cf
refactor: Switch to default to ignoring scaling and allow ignoring ta…
bryantbiggs Dec 16, 2022
e2d3a92
fix: Use `lookup()` for service connect namespace since this can be a…
bryantbiggs Jan 27, 2023
3e3106f
fix: Use `null` for default value on capacity provider strategy to av…
bryantbiggs Jan 27, 2023
eea18bc
fix: Set default cluster capacity provider weight to `null`
bryantbiggs Jan 27, 2023
5c56117
fix: Set launch type correctly when not an external deployment
bryantbiggs Jan 28, 2023
1259a58
feat: Add support for creating shared task execution role plus secret…
bryantbiggs Jan 29, 2023
c3614f3
fix: Add output for shared task execution role
bryantbiggs Jan 29, 2023
6867416
fix: Ensure Sids are unique
bryantbiggs Jan 29, 2023
dd81a01
feat: Add support for creating log group for cluster
bryantbiggs Jan 29, 2023
3c35e5f
feat: Add support for creating security group for service/task
bryantbiggs Jan 29, 2023
ef28bab
feat: Output the `family` attribute for task definition
bryantbiggs Jan 29, 2023
9ab549e
feat: Allow for enable/disabling creation of CloudWatch logging and t…
bryantbiggs Mar 7, 2023
36b68eb
fix: Ensure that the latest task definition is used
bryantbiggs Mar 8, 2023
dd756ba
fix: Correct logging configuration for container definition
bryantbiggs Mar 10, 2023
1a07577
chore: Use SSM for fluentbit image
bryantbiggs Mar 10, 2023
c7600d4
fixed service connect port_name parsing (#2)
nvpnathan Mar 12, 2023
dd6c56b
feat: Add support for extending IAM policy permissions with generic `…
bryantbiggs Mar 12, 2023
70d4dd5
fix: Correct spelling errors and version mis-match
bryantbiggs Mar 12, 2023
8039894
chore: Update documentation
bryantbiggs Mar 12, 2023
be70968
chore: Update readme
bryantbiggs Mar 12, 2023
73acc1d
fix: Ensure default values are present which matches managed policy f…
bryantbiggs Mar 13, 2023
c92aadf
Update modules/service/README.md
bryantbiggs Apr 1, 2023
37103e3
Update main.tf
bryantbiggs Apr 1, 2023
ad37f81
chore: Add docs
bryantbiggs Apr 3, 2023
d3a4ff3
Update DESIGN.md (#3)
arvindsoni80 Apr 5, 2023
1db3647
Apply suggestions from code review
bryantbiggs Apr 7, 2023
16442e0
feat: Add support for generating Terragrunt wrappers
bryantbiggs Apr 7, 2023
98218e4
refactor: Move root cluster into module; add both cluster and service…
bryantbiggs Apr 12, 2023
c6fef3b
chore: Updates from PR review
bryantbiggs Apr 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.77.0
rev: v1.77.2
hooks:
- id: terraform_fmt
- id: terraform_wrapper_module_for_each
- id: terraform_validate
- id: terraform_docs
args:
Expand Down
286 changes: 133 additions & 153 deletions README.md

Large diffs are not rendered by default.

289 changes: 289 additions & 0 deletions docs/README.md

Large diffs are not rendered by default.

Binary file added docs/images/cluster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/complete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/service.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/task.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Examples

Please note - the examples provided serve two primary means:

1. Show users working examples of the various ways in which the module can be configured and features supported
2. A means of testing/validating module changes

Please do not mistake the examples provided as "best practices". It is up to users to consult the AWS service documentation for best practices, usage recommendations, etc.
39 changes: 24 additions & 15 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# ECS Cluster w/ EC2 Autoscaling
# ECS Cluster Complete

Configuration in this directory creates:

- ECS cluster using autoscaling group capacity provider
- Autoscaling groups with IAM instance profile to be used by ECS cluster
- Example ECS service
- ECS cluster using Fargate (on-demand and spot) capacity providers
- Example ECS service that utilizes
- AWS Firelens using FluentBit sidecar container definition
- Service connect configuration
- Load balancer target group attachment
- Security group for access to the example service

## Usage

Expand All @@ -24,31 +27,32 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.6 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.55 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.6 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.55 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_autoscaling"></a> [autoscaling](#module\_autoscaling) | terraform-aws-modules/autoscaling/aws | ~> 6.5 |
| <a name="module_autoscaling_sg"></a> [autoscaling\_sg](#module\_autoscaling\_sg) | terraform-aws-modules/security-group/aws | ~> 4.0 |
| <a name="module_ecs"></a> [ecs](#module\_ecs) | ../.. | n/a |
| <a name="module_ecs_disabled"></a> [ecs\_disabled](#module\_ecs\_disabled) | ../.. | n/a |
| <a name="module_hello_world"></a> [hello\_world](#module\_hello\_world) | ./service-hello-world | n/a |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 3.0 |
| <a name="module_alb"></a> [alb](#module\_alb) | terraform-aws-modules/alb/aws | ~> 8.0 |
| <a name="module_alb_sg"></a> [alb\_sg](#module\_alb\_sg) | terraform-aws-modules/security-group/aws | ~> 4.0 |
| <a name="module_ecs"></a> [ecs](#module\_ecs) | ../../ | n/a |
| <a name="module_ecs_cluster_disabled"></a> [ecs\_cluster\_disabled](#module\_ecs\_cluster\_disabled) | ../../modules/cluster | n/a |
| <a name="module_ecs_disabled"></a> [ecs\_disabled](#module\_ecs\_disabled) | ../../ | n/a |
| <a name="module_service_disabled"></a> [service\_disabled](#module\_service\_disabled) | ../../modules/service | n/a |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 4.0 |

## Resources

| Name | Type |
|------|------|
| [aws_cloudwatch_log_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
| [aws_ssm_parameter.ecs_optimized_ami](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameter) | data source |
| [aws_service_discovery_http_namespace.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/service_discovery_http_namespace) | resource |
| [aws_availability_zones.available](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones) | data source |

## Inputs

Expand All @@ -58,9 +62,14 @@ No inputs.

| Name | Description |
|------|-------------|
| <a name="output_autoscaling_capacity_providers"></a> [autoscaling\_capacity\_providers](#output\_autoscaling\_capacity\_providers) | Map of capacity providers created and their attributes |
| <a name="output_cluster_arn"></a> [cluster\_arn](#output\_cluster\_arn) | ARN that identifies the cluster |
| <a name="output_cluster_autoscaling_capacity_providers"></a> [cluster\_autoscaling\_capacity\_providers](#output\_cluster\_autoscaling\_capacity\_providers) | Map of capacity providers created and their attributes |
| <a name="output_cluster_capacity_providers"></a> [cluster\_capacity\_providers](#output\_cluster\_capacity\_providers) | Map of cluster capacity providers attributes |
| <a name="output_cluster_id"></a> [cluster\_id](#output\_cluster\_id) | ID that identifies the cluster |
| <a name="output_cluster_name"></a> [cluster\_name](#output\_cluster\_name) | Name that identifies the cluster |
| <a name="output_services"></a> [services](#output\_services) | Map of services created and their attributes |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## License

Apache-2.0 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-ecs/blob/master/LICENSE).
Loading