-
-
Notifications
You must be signed in to change notification settings - Fork 556
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
Conversation
…efinition` sub-module
…sk definition changes instead
… policy for task execution role
…ask definition, add support for service alarms
Co-authored-by: Bryant Biggs <[email protected]>
…statements` variable
@antonbabenko I made some updates and provided some responses/feedback - please take another look when you have some time and let me know what your thoughts are. I also added a design doc to capture a lot of the information that went into the current proposal. Hopefully that is useful for both the review and future users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good. The only big thing is related to the submodule for ECS Cluster, and we are good to go!
variable "memory" { | ||
description = "Amount (in MiB) of memory used by the task. If the `requires_compatibilities` is `FARGATE` this field is required" | ||
type = number | ||
default = 2048 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Why not 4096? Trying to understand the logic in the default value :)
.pre-commit-config.yaml
Outdated
@@ -1,6 +1,6 @@ | |||
repos: | |||
- repo: https://github.com/antonbabenko/pre-commit-terraform | |||
rev: v1.77.0 | |||
rev: v1.77.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this hook after terraform_fmt:
- id: terraform_wrapper_module_for_each
Co-authored-by: Anton Babenko <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work (as usual)!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hit approved a bit too early :) Let's make a submodule for the ECS cluster.
@antonbabenko I've moved the container-definition up to the service module. I added the wrapper pre-commit hook as requested but it seems to be fighting with the format hook |
I'm not really digging this influence terragrunt is having over the modules. It seems to be more complexity than value |
Fixed in antonbabenko/pre-commit-terraform#503 , please use
|
Terragrunt is one of the tools, but the overall suggestion I have is to have both options:
It will allow users to achieve flexibility as they need regardless of the wrapper tool they use. I see you merged the container-definition submodule into the service. I think it was good to have it as a submodule, though. This way users may use it completely separately from the rest of the ECS resources we manage in this repository. |
@antonbabenko I think I captured all of the changes, please take another look when you get a chance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good. It was hard to review in GitHub UI. Minor comments related to docs mostly.
README.md
Outdated
|
||
```hcl | ||
module "ecs" { | ||
source = "terraform-aws-modules/ecs/aws" | ||
source = "terraform-aws-modules/ecs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source = "terraform-aws-modules/ecs" | |
source = "terraform-aws-modules/ecs/aws" |
This is in many places throughout the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in c6fef3b
main.tf
Outdated
task_exec_iam_role_permissions_boundary = var.task_exec_iam_role_permissions_boundary | ||
task_exec_iam_role_tags = var.task_exec_iam_role_tags | ||
task_exec_iam_role_policies = var.task_exec_iam_role_policies | ||
create_task_exec_policy = var.create_task_exec_policy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a new line before create_...
and comments like you do in the service
module to separate blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in c6fef3b
modules/cluster/README.md
Outdated
@@ -0,0 +1,214 @@ | |||
# AWS ECS Terraform module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# AWS ECS Terraform module | |
# AWS ECS Cluster Terraform module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in c6fef3b
outputs.tf
Outdated
output "services" { | ||
description = "Map of services created and their attributes" | ||
value = module.service | ||
sensitive = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately. I really dislike this feature of Terraform... :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! See below (its now removed)
|
||
output "container_definition" { | ||
description = "Container definition" | ||
value = local.container_definition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this output be marked as sensitive? I see that in modules/service/outputs.tf
it is marked so, so here it should probably be also marked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was my bad - in the examples I was using an SSM parameter data source to pull a container image and the second you use that, it requires outputs to be marked as sensitive. So for now, I removed that and used a static string and will leave this up to users to mark the output as sensitive (if they need to)
great work !! I am trying to use this module, really need this to make my billion dollar app work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍👍👍
This PR is included in version 5.0.0 🎉 |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
service
sub-moduleMotivation and Context
service
andcontainer-definition
sub-modulesBreaking Changes
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request