Kolbe Face
08/07/2023, 11:15 AMRachel Perkins
08/07/2023, 1:37 PMregion to us-west using something like:
provider "aws" {
region = "us-west"
}Kolbe Face
08/07/2023, 3:48 PMterraform apply -target module.fleet.module.vpc
it doesn't occur if I run a normal
terraform apply
this guide tells me to first run the terraform apply -target command to create the VPC is there a way to force this command to us-west or do I need to BYO my own VPC?Kolbe Face
08/07/2023, 6:18 PMterraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
provider "aws" {
region = "us-west-2"
profile = "security"
}
and still everything is being created in us-westRachel Perkins
08/07/2023, 8:19 PMKathy Satterlee
08/07/2023, 8:43 PMterraform destroy and rebuild everything?Kolbe Face
08/07/2023, 10:23 PM│ Error: Invalid for_each argument
│
│ on .terraform/modules/fleet/terraform/byo-vpc/main.tf line 68, in data "aws_subnet" "redis":
│ 68: for_each = toset(var.redis_config.subnets)
│ ├────────────────
│ │ var.redis_config.subnets is list of string with 3 elements
but no issues with region however if I use
terraform apply -target module.fleet.module.vpc
as per the documentation it tries to set all the regions to us-eastKolbe Face
08/07/2023, 10:24 PMKathy Satterlee
08/07/2023, 10:28 PMKolbe Face
08/07/2023, 10:44 PMterraform apply -target module.fleet.module.vpc
is required first. I just don't understand why it is defaulting to west, I even tried
export AWS_DEFAULT_REGION=us-west-2
to no availBenjamin Edwards
08/07/2023, 10:50 PMKolbe Face
08/07/2023, 10:50 PMBenjamin Edwards
08/07/2023, 10:51 PMKolbe Face
08/07/2023, 10:51 PMKolbe Face
08/07/2023, 10:52 PMcat ~/.aws/config
[default]
region = us-west-2
output = yamlKolbe Face
08/07/2023, 10:52 PM[profile security]
role_arn = arn:aws:iam::<private>:role/security_admin
source_profile = default
region = us-west-2