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

Use AWS region from AWS config by default #77

Closed
vuldin opened this issue Oct 17, 2022 · 3 comments
Closed

Use AWS region from AWS config by default #77

vuldin opened this issue Oct 17, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request v2-branch Will be addressed in v2 branch

Comments

@vuldin
Copy link
Member

vuldin commented Oct 17, 2022

Read from ~/.aws/config to get user's default region rather than hard-coding aws_region to us-west-2.

@vuldin vuldin added enhancement New feature or request v2-branch Will be addressed in v2 branch labels Oct 17, 2022
@vuldin vuldin self-assigned this Oct 17, 2022
@vuldin
Copy link
Member Author

vuldin commented Oct 17, 2022

This will require making AMI IDs dynamic based on region.

@vuldin
Copy link
Member Author

vuldin commented Oct 17, 2022

This is an example of a dynamic AMI data object:

data "aws_ami" "ubuntu" {
  most_recent = true

  filter {
    name   = "name"
    values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
  }

  filter {
    name   = "virtualization-type"
    values = ["hvm"]
  }

  owners = ["099720109477"] # Canonical
}

More details here: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#example-usage

@gene-redpanda
Copy link
Contributor

gene-redpanda commented Jun 6, 2023

Many users do not use ~/.aws/config, and others do not want their infrastructure built in their default region. For instance my default region in ~/.aws/config is us-east-2, but I only build in us-west-2 as that is where most people in the org are.

IMO if a user wants to have a default region they should use the canonical AWS_DEFAULT_REGION

@gene-redpanda gene-redpanda closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2-branch Will be addressed in v2 branch
Projects
None yet
Development

No branches or pull requests

2 participants