Skip to content

Commit f947643

Browse files
authored
CCM-11751: Use github release assests for shared modules call (#142)
* CCM-11751: Use github release assests for shared modules call * CCM-11751: Use github release assests for shared modules call * CCM-11751: Use github release assests for shared modules call * CCM-11751: Use github release assests for shared modules call
1 parent 02abed9 commit f947643

16 files changed

+52
-50
lines changed

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ jobs:
4646
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
4747
echo "version=$(echo $version)" >> $GITHUB_OUTPUT
4848
echo "is_version_prerelease=$(if [[ $version == *-* ]]; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT
49-
5049
- name: "Check if pull request exists for this branch"
5150
id: pr_exists
5251
env:

.github/workflows/stage-4-acceptance.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ on:
3131
description: "Version of the software, set by the CI/CD pipeline workflow"
3232
required: true
3333
type: string
34+
pr_number:
35+
required: true
36+
type: string
3437

3538
jobs:
3639
environment-set-up:

infrastructure/terraform/components/api/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ No requirements.
2929

3030
| Name | Source | Version |
3131
|------|--------|---------|
32-
| <a name="module_authorizer_lambda"></a> [authorizer\_lambda](#module\_authorizer\_lambda) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda | v2.0.4 |
32+
| <a name="module_authorizer_lambda"></a> [authorizer\_lambda](#module\_authorizer\_lambda) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-lambda.zip | n/a |
3333
| <a name="module_domain_truststore"></a> [domain\_truststore](#module\_domain\_truststore) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v2.0.17 |
34-
| <a name="module_get_letters"></a> [get\_letters](#module\_get\_letters) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda | v2.0.10 |
35-
| <a name="module_hello_world"></a> [hello\_world](#module\_hello\_world) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda | v2.0.10 |
36-
| <a name="module_kms"></a> [kms](#module\_kms) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/kms | v2.0.10 |
34+
| <a name="module_get_letters"></a> [get\_letters](#module\_get\_letters) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-lambda.zip | n/a |
35+
| <a name="module_hello_world"></a> [hello\_world](#module\_hello\_world) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-lambda.zip | n/a |
36+
| <a name="module_kms"></a> [kms](#module\_kms) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-kms.zip | n/a |
3737
| <a name="module_logging_bucket"></a> [logging\_bucket](#module\_logging\_bucket) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v2.0.17 |
38-
| <a name="module_patch_letters"></a> [patch\_letters](#module\_patch\_letters) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda | v2.0.10 |
38+
| <a name="module_patch_letters"></a> [patch\_letters](#module\_patch\_letters) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-lambda.zip | n/a |
3939
| <a name="module_supplier_ssl"></a> [supplier\_ssl](#module\_supplier\_ssl) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/ssl | v2.0.17 |
4040
## Outputs
4141

infrastructure/terraform/components/api/acm_certificate.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ resource "aws_acm_certificate" "main" {
88
}
99

1010
resource "aws_acm_certificate_validation" "main" {
11-
certificate_arn = aws_acm_certificate.main.arn
11+
certificate_arn = aws_acm_certificate.main.arn
1212
validation_record_fqdns = [for record in aws_route53_record.acm_validation : record.fqdn]
1313
}

infrastructure/terraform/components/api/api_gateway_domain.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ resource "aws_api_gateway_domain_name" "main" {
88
}
99

1010
mutual_tls_authentication {
11-
truststore_uri = var.manually_configure_mtls_truststore ? "s3://${local.acct.s3_buckets["truststore"]["id"]}/${var.ca_pem_filename}" : "s3://${local.acct.s3_buckets["truststore"]["id"]}/${aws_s3_object.placeholder_truststore[0].key}"
12-
truststore_version = var.manually_configure_mtls_truststore ? data.aws_s3_object.external_ca_cert[0].version_id : aws_s3_object.placeholder_truststore[0].version_id
11+
truststore_uri = var.manually_configure_mtls_truststore ? "s3://${local.acct.s3_buckets["truststore"]["id"]}/${var.ca_pem_filename}" : "s3://${local.acct.s3_buckets["truststore"]["id"]}/${aws_s3_object.placeholder_truststore[0].key}"
12+
truststore_version = var.manually_configure_mtls_truststore ? data.aws_s3_object.external_ca_cert[0].version_id : aws_s3_object.placeholder_truststore[0].version_id
1313
}
1414
}
1515

1616
data "aws_s3_object" "external_ca_cert" {
1717
count = var.manually_configure_mtls_truststore ? 1 : 0
1818

1919
bucket = local.acct.s3_buckets["truststore"]["id"]
20-
key = "${local.csi}/${var.ca_pem_filename}"
20+
key = "${local.csi}/${var.ca_pem_filename}"
2121
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
resource "aws_api_gateway_rest_api" "main" {
2-
name = local.csi
3-
body = local.openapi_spec
4-
description = "Suppliers API"
2+
name = local.csi
3+
body = local.openapi_spec
4+
description = "Suppliers API"
55
disable_execute_api_endpoint = true
66
}

infrastructure/terraform/components/api/locals.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ locals {
55
root_domain_nameservers = local.acct.route53_zone_nameservers["supplier-api"]
66

77
openapi_spec = templatefile("${path.module}/resources/spec.tmpl.json", {
8-
APIG_EXECUTION_ROLE_ARN = aws_iam_role.api_gateway_execution_role.arn
9-
AWS_REGION = var.region
10-
AUTHORIZER_LAMBDA_ARN = module.authorizer_lambda.function_arn
11-
HELLO_WORLD_LAMBDA_ARN = module.hello_world.function_arn
12-
GET_LETTERS_LAMBDA_ARN = module.get_letters.function_arn
13-
PATCH_LETTERS_LAMBDA_ARN = module.patch_letters.function_arn
8+
APIG_EXECUTION_ROLE_ARN = aws_iam_role.api_gateway_execution_role.arn
9+
AWS_REGION = var.region
10+
AUTHORIZER_LAMBDA_ARN = module.authorizer_lambda.function_arn
11+
HELLO_WORLD_LAMBDA_ARN = module.hello_world.function_arn
12+
GET_LETTERS_LAMBDA_ARN = module.get_letters.function_arn
13+
PATCH_LETTERS_LAMBDA_ARN = module.patch_letters.function_arn
1414
})
1515

1616
destination_arn = "arn:aws:logs:${var.region}:${var.shared_infra_account_id}:destination:nhs-main-obs-firehose-logs"

infrastructure/terraform/components/api/module_authorizer_lambda.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "authorizer_lambda" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/lambda?ref=v2.0.4"
2+
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-lambda.zip"
33

44
aws_account_id = var.aws_account_id
55
component = var.component

infrastructure/terraform/components/api/module_domain_truststore.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module "domain_truststore" {
88
project = var.project
99
region = var.region
1010

11-
default_tags = local.default_tags
12-
kms_key_arn = module.kms.key_id
11+
default_tags = local.default_tags
12+
kms_key_arn = module.kms.key_id
1313

1414
bucket_logging_target = {
1515
bucket = module.logging_bucket.bucket

infrastructure/terraform/components/api/module_kms.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "kms" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/kms?ref=v2.0.10"
2+
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-kms.zip"
33

44
providers = {
55
aws = aws

0 commit comments

Comments
 (0)