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

Add support for associating an ECS service with a NLB. #15

Merged
merged 3 commits into from
Sep 12, 2018

Conversation

dynamike
Copy link
Contributor

This PR will allows the ECS service to register with a Network Load Balancer's target group. I also modified the associate_lb variable to be split into associate_alb and associate_nlb. NLBs don't have security groups so this PR will allow the ingress from the NLB's subnets to the ECS containers.

I'll release v1.9.0 once this PR merges.

main.tf Outdated
"protocol": "tcp"
"containerPort": 80,
"hostPort": 80,
"protocol": "tcp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with this weird whitespace adjustment?

main.tf Outdated
"awslogs-stream-prefix": "nginx"
"awslogs-group": "${local.awslogs_group}",
"awslogs-region": "${data.aws_region.current.name}",
"awslogs-stream-prefix": "nginx"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with this weird whitespace adjustment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some how tabs snuck in there

@@ -308,7 +346,7 @@ locals {
}

resource "aws_ecs_service" "main" {
count = "${var.associate_lb}"
count = "${var.associate_alb || var.associate_nlb ? 1 : 0}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this really need the ? 1: 0? These are both bools. I think it makes it extra clear this is different from the one below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get cannot parse "true" as an integer if I'm not being explicit

Copy link
Contributor

@brainsik brainsik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌞

@dynamike dynamike merged commit 1e491e1 into master Sep 12, 2018
@dynamike dynamike deleted the mk-nlb-support branch September 12, 2018 22:23
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.

3 participants