Skip to content

Commit

Permalink
update github org, fix terragrunt bug, new cloudfront dist
Browse files Browse the repository at this point in the history
  • Loading branch information
bryborge committed Dec 3, 2023
1 parent 61af586 commit bcef7c2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion aws/live/production/blog/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ locals {
account_id = "388372205874"
region = "us-west-2"
env = "production"
cloudfront_dist_id = "E3E47UCVRC2WJ9"
cloudfront_dist_id = "E2IV2DY4NDYVVW"
}

module "s3_bucket_site" {
Expand Down
28 changes: 20 additions & 8 deletions aws/live/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
locals {
account_id = get_env("ACCOUNT_ID", get_aws_account_id())
path = path_relative_to_include()
account_id = get_env("ACCOUNT_ID", get_aws_account_id())

# Parse the file path we're in to read the env name: e.g., env will be "development" in the development folder,
# "staging" in the staging folder, etc.
Expand All @@ -13,6 +14,9 @@ locals {
# 3. The return value from `aws configure get region`
default_region = get_env("AWS_DEFAULT_REGION", try(run_cmd("--terragrunt-quiet", "aws", "configure", "get", "region"), ""))
region = get_env("AWS_REGION", local.default_region)

bucket_name = "tf-${local.env}-${local.region}-${local.account_id}"
dynamodb_table = "tf-lock-${local.env}"
}

# Remote state configuration.
Expand All @@ -22,20 +26,28 @@ remote_state {

generate = {
path = "backend.tf"
if_exists = "overwrite"
if_exists = "overwrite_terragrunt"
}

config = {
encrypt = true
bucket = "tf-${local.env}-${local.region}-${local.account_id}"
key = "iac/${local.env}/${local.account_id}/${local.region}/terraform.tfstate"
bucket = local.bucket_name
// key = "iac/${local.env}/${local.account_id}/${local.region}/terraform.tfstate"
key = "iac/${path_relative_to_include()}/${local.account_id}/${local.region}/terraform.tfstate"
region = local.region
dynamodb_table = "tf-lock-${local.env}"
dynamodb_table = local.dynamodb_table
}
}

inputs = {
aws_account_id = local.account_id
aws_region = local.region
environment = local.env
aws_account_id = local.account_id
aws_region = local.region
environment = local.env
environment_bucket = local.bucket_name
environment_dynamodb_table = local.dynamodb_table
tags = {
"Region" = local.region,
"Environment" = local.env,
"DeploymentDirectory" = local.path,
}
}
2 changes: 1 addition & 1 deletion aws/modules/default-vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ resource "aws_default_vpc" "default" {
Region = var.aws_region
Environment = var.environment
GithubRepo = "cosmos"
GithubOrg = "sonofborge"
GithubOrg = "bryborge"
}
}

0 comments on commit bcef7c2

Please sign in to comment.