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

[feature] Add ECS modules #132

Merged
merged 11 commits into from
Sep 25, 2019
Merged

[feature] Add ECS modules #132

merged 11 commits into from
Sep 25, 2019

Conversation

mbarrien
Copy link
Contributor

@mbarrien mbarrien commented Sep 23, 2019

Summary

Adds ECS service (public facing with a frontend) and ECS job (internal headless applications) modules to the public cztack repo, with separate modules for Fargate and non-Fargate jobs.

Changes relative to internal repo:

  • Uses aws_lb_* resources instead of aws_alb_* resources
  • Separate modules for fargate and EC2 jobs. EC2 tasks default to host networking and the host's security group, but we add support for awsvpc networking that assigns an ENI with its own security group to the task (Fargate always has this.)
  • Variable names do not have fargate_* prefix since module is Fargate-specific.
  • We now have a variable called manage_task_definitions instead of relying on a non-empty/non-null task_definition variable. This gets rid of the problem with "count cannot be determined from compute value" errors, but now requires the user to properly specify manage_task_definitions for their use case.
  • Supports source security groups for the ingress LB. This will allow us to limit services by security group instead of just CIDR blocks, which is useful when you have a service that only should ever talk to a single upstream service (e.g. a proxy)
  • Adds AWS tags to the ECS service and task definitions.

@mbarrien mbarrien requested a review from a team as a code owner September 23, 2019 22:08
@mbarrien mbarrien force-pushed the mbarrien/ecs branch 2 times, most recently from 05784d7 to 13ba232 Compare September 23, 2019 22:15
@ryanking
Copy link
Contributor

  • Separate modules for fargate and EC2 jobs (note that although theoretically possible, ECS EC2 module does not support

?

@mbarrien
Copy link
Contributor Author

Fixed PR description

@mbarrien mbarrien force-pushed the mbarrien/ecs branch 2 times, most recently from 8f64b7b to 046205b Compare September 24, 2019 15:39
aws-ecs-job-fargate/main.tf Outdated Show resolved Hide resolved
aws-ecs-job-fargate/main.tf Show resolved Hide resolved
aws-ecs-job/README.md Outdated Show resolved Hide resolved
aws-ecs-job/README.md Outdated Show resolved Hide resolved
aws-ecs-service-fargate/README.md Outdated Show resolved Hide resolved
aws-ecs-service-fargate/README.md Show resolved Hide resolved
aws-ecs-service-fargate/README.md Outdated Show resolved Hide resolved
aws-ecs-service-fargate/README.md Outdated Show resolved Hide resolved
aws-ecs-service/README.md Outdated Show resolved Hide resolved
@mbarrien
Copy link
Contributor Author

Added untested support for awsvpc networking for non-Fargate jobs, via var.awsvpc_network_mode flag. Also added secrets manager for Docker image fetching. Note that using that flag also means that jobs using czecs would need to add networkMode and/or execution role to the definition.

@ryanking ryanking changed the title Add ECS modules to cztack [feature] Add ECS modules to cztack Sep 25, 2019
@mbarrien mbarrien changed the title [feature] Add ECS modules to cztack [feature] Add ECS modules Sep 25, 2019
@mbarrien mbarrien merged commit 6918848 into master Sep 25, 2019
@mbarrien mbarrien deleted the mbarrien/ecs branch September 25, 2019 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants