-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create terragrunt.hcl to pickup the variables passed in by github act…
…ion and feed them to terrafrom (#87) * adding push to docker build * terragrunt * use placeholder for route53 * use placeholder for route53
- Loading branch information
Showing
4 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
locals { | ||
tfc_hostname = "app.terraform.io" | ||
tfc_organization = "bcgov" | ||
} | ||
|
||
generate "remote_state" { | ||
path = "backend.tf" | ||
if_exists = "overwrite" | ||
contents = <<EOF | ||
terraform { | ||
backend "s3" { | ||
bucket = "terraform-remote-state-${get_env("TFC_PROJECT")}-${get_env("TARGET_ENV")}" # Replace with either generated or custom bucket name | ||
key = "terraform.${get_env("TFC_PROJECT")}-${get_env("TARGET_ENV")}-state" # Path and name of the state file within the bucket | ||
region = "ca-central-1" # AWS region where the bucket is located | ||
dynamodb_table = "terraform-remote-state-lock-${get_env("TFC_PROJECT")}" # Replace with either generated or custom DynamoDB table name | ||
encrypt = true # Enable encryption for the state file | ||
} | ||
} | ||
EOF | ||
} | ||
|
||
generate "tfvars" { | ||
path = "terragrunt.auto.tfvars" | ||
if_exists = "overwrite" | ||
disable_signature = true | ||
contents = <<-EOF | ||
TARGET_ENV = "${get_env("TARGET_ENV")}" | ||
GITHUB_USERNAME = "${get_env("GITHUB_USERNAME")}" | ||
GITHUB_TOKEN = "${get_env("GITHUB_TOKEN")}" | ||
APP_COUNT = "${get_env("APP_COUNT")}" | ||
LOGGING_LEVEL = "${get_env("LOGGING_LEVEL")}" | ||
# server | ||
WFPREV_API_NAME = "${get_env("WFPREV_API_NAME")}" | ||
WFPREV_API_IMAGE = "${get_env("WFPREV_API_IMAGE")}" | ||
WFPREV_API_CPU_UNITS = "${get_env("WFPREV_API_CPU_UNITS")}" | ||
WFPREV_API_MEMORY = "${get_env("WFPREV_API_MEMORY")}" | ||
WFPREV_API_PORT = "${get_env("WFPREV_API_PORT")}" | ||
DEFAULT_APPLICATION_ENVIRONMENT = "${get_env("DEFAULT_APPLICATION_ENVIRONMENT")}" | ||
TARGET_AWS_ACCOUNT_ID = "${get_env("TARGET_AWS_ACCOUNT_ID")}" | ||
# client | ||
WEBADE_OAUTH2_WFPREV_UI_CLIENT_SECRET = "${get_env("WEBADE_OAUTH2_WFPREV_UI_CLIENT_SECRET")}" | ||
CLIENT_IMAGE = "${get_env("CLIENT_IMAGE")}" | ||
WFPREV_UI_PORT = "${get_env("WFPREV_UI_PORT")}" | ||
EOF | ||
} | ||
|
||
generate "provider" { | ||
path = "provider.tf" | ||
if_exists = "overwrite" | ||
contents = <<EOF | ||
provider "aws" { | ||
region = "ca-central-1" | ||
assume_role { | ||
role_arn = "arn:aws:iam::$${var.TARGET_AWS_ACCOUNT_ID}:role/Terraform_Deploy_Role" | ||
} | ||
} | ||
EOF | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters