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

AWS region as variable #11

Open
vadimAnte opened this issue Feb 15, 2019 · 4 comments
Open

AWS region as variable #11

vadimAnte opened this issue Feb 15, 2019 · 4 comments

Comments

@vadimAnte
Copy link

Hello,

Please add AWS region to variables.
Imagine that you are deploying an many AWS regions, but prefer keep all back-end files in one region only.

@stavxyz
Copy link
Owner

stavxyz commented Feb 22, 2019

@vadimAnte I think I like this idea, thanks for the suggestion!

I have three questions.

  1. Should the region variable have a default, or just be blank?

  2. In the case of "no default", what happens when the variable is unset/blank?

  3. Would it not be "better" to encourage users to use the AWS_DEFAULT_REGION variable before plan/apply?

@cbfx
Copy link
Contributor

cbfx commented Nov 27, 2019

› terraform apply backend.plan

Error: Missing required argument

The argument "region" is required, but was not set.

@cbfx
Copy link
Contributor

cbfx commented Nov 27, 2019

@samstav

  1. i think you should allow this as a config option in the backend module.
module "backend" {
  source = "github.com/samstav/terraform-aws-backend"
  backend_bucket = "somebucket"
  region = "${var.region}"
}
  1. following the steps in the README.md, the module asked me for a region when i ran the plan command terraform plan -out=backend.plan -target=module.backend. after I chose us-east-1, the error above returned. if there's no default set and the user does not set one, allow it to exit 0.

  2. yes, i will set and try again using AWS_DEFAULT_REGION.

@stavxyz
Copy link
Owner

stavxyz commented Dec 3, 2019

Thanks @cbfx.

So, expose the region variable but default it to blank?

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

No branches or pull requests

3 participants