Skip to content

Conversation

Vadim-Zenin
Copy link

No description provided.

@stavxyz
Copy link
Owner

stavxyz commented Feb 28, 2019

@vadimAnte thanks!

What happens if the variable is unset? I assume it will use AWS_DEFAULT_REGION, and if that is also unset then the tf run will fail?

@Vadim-Zenin
Copy link
Author

You are welcome.
If you added default value and user started few times it could be hard to change after.
If user uses CloudFront better to use default = "us-east-1".
If user does not use CloudFront closest location is preferable.

May be better add an example for varibles.tf

variable "backend_region" {
  type = "string"
  description = "AWS region"
  default = "us-east-1"
}

main.tf example:

module "backend" {
  /*
   * Since this example lives in the module repository,
   * we use a relative path '../', but typically we would use
   * the github url, like so:
   *
   * source = "github.com/samstav/terraform-aws-backend"
  */

  # source         = "../../"
  # source = "./modules/backend_aws_s3"
  source = "git::[email protected]:samstav/terraform-aws-backend.git//backend_aws_s3?ref=v1.0"
  backend_bucket = "${var.backend_bucket}"
  backend_region = "${var.backend_region}"
}

The module returns error if variable "backend_region" was hod defined.

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