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

fix: Remove the dependency of hard coded region and availability zones #22

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

ozbillwang
Copy link
Contributor

@ozbillwang ozbillwang commented Jun 23, 2020

Description

remove the dependency of hard coded region and available zones in examples.

Motivation and Context

Normally we set AWS_REGION or AWS_DEFAULT_REGION environment variable, or set region in aws credentials file already.

this PR removes the dependency of hard coded region and available zones, so end users can directly run the example without any codes to be updated in examples.

Breaking Changes

No, just a change in example

but if the region has three or four available zone, it would create more resources than before.

If you do want to limit the number of AZs to 2 only, I can adjust the code to:

 azs             = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]]

How Has This Been Tested?

terraform init
terraform plan
terraform apply

@antonbabenko antonbabenko changed the title remove the dependency of hard coded region and available zones fix: Remove the dependency of hard coded region and availability zones Jun 23, 2020
@antonbabenko antonbabenko merged commit c63d2cb into terraform-aws-modules:master Jun 23, 2020
@antonbabenko
Copy link
Member

Thanks, @ozbillwang !

@ozbillwang
Copy link
Contributor Author

ozbillwang commented Jun 23, 2020

@antonbabenko

Could you please explain, in the example,

  1. why do you set the default value of enable_nat_gateway to false?
  enable_nat_gateway = false # this is faster, but should be "true" for real
  1. Why set the autoscaling group to 0? should it be:
  min_size                  = 1
  max_size                  = 2
  desired_capacity          = 1

I spent more than 1 hour to figure it out that's the reason why I can't see the instance to be added in ecs automatically.

@antonbabenko
Copy link
Member

Just because false is faster, but should be "true" for real, and there are no e2e tests, so having asg size of zero is fine too.

@ozbillwang
Copy link
Contributor Author

ozbillwang commented Jun 23, 2020

but it does waste my time. I can't run a quick ecs cluster/service setup in 5 minutes.

Anyway, I would raise a PR for that, you can decide to merge it or not.

@antonbabenko
Copy link
Member

Change ASG size to 1,2,1 is fine to update, but enabling NAT gateway simply takes more time to create infra (in this example).

@ozbillwang
Copy link
Contributor Author

#23

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants