Skip to content

Commit 61e6738

Browse files
committed
un-hardcode the region
1 parent c7242df commit 61e6738

File tree

8 files changed

+16
-10
lines changed

8 files changed

+16
-10
lines changed

eks.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module "eks" {
3030
resource "null_resource" "kubectl" {
3131
depends_on = [module.eks]
3232
provisioner "local-exec" {
33-
command = "aws --region us-east-1 eks update-kubeconfig --name ${module.eks.cluster_name}"
33+
command = "aws eks update-kubeconfig --name ${module.eks.cluster_name}"
3434
}
3535
}
3636

nbc.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ resource "aws_instance" "nbc_instance" {
2727
}
2828

2929
output "nbc_ssm_command" {
30-
value = "aws --region us-east-1 ssm start-session --target ${aws_instance.nbc_instance.id}"
30+
value = "aws ssm start-session --target ${aws_instance.nbc_instance.id}"
3131
}
3232

3333
output "nbc_url" {

nbe.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ resource "aws_instance" "nbe_instance" {
5353
}
5454

5555
output "nbe_ssm_command" {
56-
value = "aws --region us-east-1 ssm start-session --target ${aws_instance.nbe_instance.id}"
56+
value = "aws ssm start-session --target ${aws_instance.nbe_instance.id}"
5757
}
5858

5959
output "nbe_console_url" {

orb.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ resource "aws_instance" "orb_instance" {
2424
}
2525

2626
output "orb_ssm_command" {
27-
value = "aws --region us-east-1 ssm start-session --target ${aws_instance.orb_instance.id}"
27+
value = "aws ssm start-session --target ${aws_instance.orb_instance.id}"
2828
}

providers.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ data "external" "whoami" {
1212
}
1313

1414
provider "aws" {
15-
region = "us-east-1"
15+
region = var.aws_region
1616
default_tags {
1717
tags = {
1818
Owner = data.external.whoami.result.username

terraform.tfvars.example

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
nbe_token = ""
2-
nbe_console_password = "6chars"
3-
nbe_admin_password = "12characters"
4-
postgres_password = "yesql123"
1+
aws_region = "us-east-1"
2+
nbe_token = "your-nbe-token"
3+
nbe_console_password = "your-console-password"
4+
nbe_admin_password = "your-admin-password"
5+
postgres_password = "your-postgres-password"

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
variable "aws_region" {
2+
type = string
3+
default = "us-east-1"
4+
}
5+
16
variable "nbe_token" {
27
type = string
38
sensitive = true

vpc.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module "vpc" {
22
source = "terraform-aws-modules/vpc/aws"
33
name = "terraform-vpc"
44
cidr = "10.0.0.0/16"
5-
azs = ["us-east-1a", "us-east-1b", "us-east-1c"]
5+
azs = ["${var.aws_region}a", "${var.aws_region}b", "${var.aws_region}c"]
66
public_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
77
private_subnets = ["10.0.11.0/24", "10.0.12.0/24", "10.0.13.0/24"]
88
enable_nat_gateway = true

0 commit comments

Comments
 (0)