generated from NHSDigital/nhs-notify-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CCM-5100: Move branch and auth client creation into separate module
- Loading branch information
Showing
15 changed files
with
179 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
locals { | ||
app_domain_name = "app.${var.environment}.${module.route53-zone.zone_name}" | ||
app_domain_name = "app.${module.route53-zone.zone_name}" | ||
} |
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,15 @@ | ||
output "user_pool_id" { | ||
value = module.userpool.user_pool_id | ||
} | ||
|
||
output "identity_provider_names" { | ||
value = module.userpool.identity_provider_names | ||
} | ||
|
||
output "app_id" { | ||
value = module.amplify_app.app_id | ||
} | ||
|
||
output "zone_name" { | ||
value = module.route53-zone.zone_name | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 @@ | ||
terraform { | ||
backend "s3" { | ||
region = "eu-west-2" | ||
} | ||
} |
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,3 @@ | ||
bucket = "tf-state-975050048865" | ||
key = "dynamic/branch.tfstate" | ||
# dynamodb_table = "${project}-terraform-statelock" |
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,17 @@ | ||
data "aws_caller_identity" "current" {} | ||
|
||
data "terraform_remote_state" "state" { | ||
backend = "s3" | ||
config = { | ||
region = "eu-west-2" | ||
bucket = "tf-state-${data.aws_caller_identity.current.account_id}" | ||
key = "auth/dev.tfstate" | ||
} | ||
} | ||
|
||
locals { | ||
app_domain_name = "app.${data.terraform_remote_state.state.outputs.zone_name}" | ||
user_pool_id = data.terraform_remote_state.state.outputs.user_pool_id | ||
identity_provider_names = data.terraform_remote_state.state.outputs.identity_provider_names | ||
app_id = data.terraform_remote_state.state.outputs.app_id | ||
} |
14 changes: 14 additions & 0 deletions
14
infrastructure/environments/dynamic/module-amplify-branch.tf
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,14 @@ | ||
module "amplify_branch" { | ||
source = "../../modules/amplify-branch" | ||
domain = var.domain | ||
environment = var.environment | ||
component = var.component | ||
stage = var.stage | ||
|
||
cognito_user_pool_id = local.user_pool_id | ||
cognito_user_pool_identity_provider_names = local.identity_provider_names | ||
amplify_app_id = local.app_id | ||
branch = "abcd01/CCM-1500-test" #var.branch # TODO get branch name from dynamic env setup | ||
subdomain = var.environment | ||
domain_name = local.app_domain_name | ||
} |
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,3 @@ | ||
provider "aws" { | ||
region = "eu-west-2" | ||
} |
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,24 @@ | ||
variable "domain" { | ||
type = string | ||
default = "iam" | ||
} | ||
|
||
variable "stage" { | ||
type = string | ||
default = "nonprod" | ||
} | ||
|
||
variable "environment" { | ||
type = string | ||
default = "dynamic" | ||
} | ||
|
||
variable "component" { | ||
type = string | ||
default = "auth" | ||
} | ||
|
||
variable "branch" { | ||
type = string | ||
default = "custom-branch" # currently ignored | ||
} |
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,19 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "5.55.0" | ||
} | ||
|
||
awscc = { | ||
source = "hashicorp/awscc" | ||
version = "0.74.0" | ||
} | ||
random = { | ||
source = "hashicorp/random" | ||
version = "3.4.2" | ||
} | ||
} | ||
|
||
required_version = ">= 1.3.0" | ||
} |
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
data "aws_caller_identity" "current" {} | ||
|
||
locals { | ||
# Compound Scope Identifier | ||
csi = replace( | ||
|
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