Skip to content

Commit

Permalink
PREPROD - Configuration modifications made to support pre-prod deploy…
Browse files Browse the repository at this point in the history
…ment (#69)

* enabled pre-prod configuartion changes

---------

Co-authored-by: Scott Alexander <[email protected]>
  • Loading branch information
SRAlexander and Scott Alexander authored Oct 19, 2023
1 parent a60cf06 commit 994fc02
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/terraform-deploy-to-pre-prod-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:

- name: Terraform Init
id: init
run: terraform init -backend-config=backend.conf
run: terraform init -backend-config=backend-pre-prod.conf
working-directory: ./infrastructure
shell: bash

Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ terraform init -backend-config=backend.conf

The following commands currently exist in the make file:

- `make pre-commit` -> runs both the `make generate-docs` and `make format-all` commands.
- `make pre-commit` -> runs both the `make generate-docs` and `make format-all` commands.


### Deploying to a new AWS Account

The details on how to run this terraform process on a new AWS account can be found on our confluence guides found [here](https://gpitbjss.atlassian.net/wiki/spaces/TW/pages/12581568619/Infrastructure+-+Deploy+to+a+new+Account)
2 changes: 1 addition & 1 deletion bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.15.0 |

## Modules

Expand Down
2 changes: 2 additions & 0 deletions infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.14.0 |


## Modules

| Name | Source | Version |
Expand Down Expand Up @@ -99,6 +100,7 @@
| <a name="input_auth_session_dynamodb_table_name"></a> [auth\_session\_dynamodb\_table\_name](#input\_auth\_session\_dynamodb\_table\_name) | The name of dynamodb table to store user login sessions | `string` | `"AuthSessionReferenceMetadata"` | no |
| <a name="input_auth_state_dynamodb_table_name"></a> [auth\_state\_dynamodb\_table\_name](#input\_auth\_state\_dynamodb\_table\_name) | The name of dynamodb table to store the state values (for CIS2 authorisation) | `string` | `"AuthStateReferenceMetadata"` | no |
| <a name="input_availability_zones"></a> [availability\_zones](#input\_availability\_zones) | This is a list that specifies all the Availability Zones that will have a pair of public and private subnets | `list(string)` | <pre>[<br> "eu-west-2a",<br> "eu-west-2b",<br> "eu-west-2c"<br>]</pre> | no |
| <a name="input_certificate_domain"></a> [certificate\_domain](#input\_certificate\_domain) | n/a | `string` | n/a | yes |
| <a name="input_docstore_bucket_name"></a> [docstore\_bucket\_name](#input\_docstore\_bucket\_name) | The name of S3 bucket to store ARF documents | `string` | `"document-store"` | no |
| <a name="input_docstore_dynamodb_table_name"></a> [docstore\_dynamodb\_table\_name](#input\_docstore\_dynamodb\_table\_name) | The name of dynamodb table to store the metadata of ARF documents | `string` | `"DocumentReferenceMetadata"` | no |
| <a name="input_domain"></a> [domain](#input\_domain) | n/a | `string` | n/a | yes |
Expand Down
1 change: 1 addition & 0 deletions infrastructure/backend-pre-prod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bucket = "ndr-pre-prod-terraform-state-694282683086"
7 changes: 4 additions & 3 deletions infrastructure/dev.tfvars
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
environment = "dev"
owner = "nhse/ndr-team"
domain = "access-request-fulfilment.patient-deductions.nhs.uk"
environment = "dev"
owner = "nhse/ndr-team"
domain = "access-request-fulfilment.patient-deductions.nhs.uk"
certificate_domain = "access-request-fulfilment.patient-deductions.nhs.uk"
1 change: 1 addition & 0 deletions infrastructure/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ module "ndr-ecs-fargate" {
environment = var.environment
owner = var.owner
domain = var.domain
certificate_domain = var.certificate_domain
container_port = 80
}
1 change: 1 addition & 0 deletions infrastructure/modules/ecs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ No modules.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | n/a | `string` | `"eu-west-2"` | no |
| <a name="input_certificate_domain"></a> [certificate\_domain](#input\_certificate\_domain) | n/a | `string` | n/a | yes |
| <a name="input_container_port"></a> [container\_port](#input\_container\_port) | n/a | `number` | `8080` | no |
| <a name="input_domain"></a> [domain](#input\_domain) | n/a | `string` | n/a | yes |
| <a name="input_ecr_repository_url"></a> [ecr\_repository\_url](#input\_ecr\_repository\_url) | n/a | `any` | n/a | yes |
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/modules/ecs/lb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ resource "aws_lb_listener" "https" {
}

data "aws_acm_certificate" "amazon_issued" {
domain = var.domain
domain = var.certificate_domain
types = ["AMAZON_ISSUED"]
most_recent = true
}
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/modules/ecs/variable.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ variable "domain" {
type = string
}

variable "certificate_domain" {
type = string
}

variable "container_port" {
type = number
default = 8080
Expand Down
1 change: 1 addition & 0 deletions infrastructure/modules/route53/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_certificate_domain"></a> [certificate\_domain](#input\_certificate\_domain) | n/a | `string` | n/a | yes |
| <a name="input_dns_name"></a> [dns\_name](#input\_dns\_name) | n/a | `string` | n/a | yes |
| <a name="input_domain"></a> [domain](#input\_domain) | n/a | `string` | n/a | yes |
| <a name="input_environment"></a> [environment](#input\_environment) | n/a | `string` | n/a | yes |
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/modules/route53/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resource "aws_route53_zone" "ndr_zone" {
count = var.using_arf_hosted_zone ? 0 : 1
name = var.domain
tags = {
Name = "${terraform.workspace}-"
Name = "${terraform.workspace}-ndr_zone"
Owner = var.owner
Environment = var.environment
Workspace = terraform.workspace
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/modules/route53/variable.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ variable "domain" {
type = string
}

variable "certificate_domain" {
type = string
}

variable "using_arf_hosted_zone" {
type = bool
default = true
Expand Down
7 changes: 4 additions & 3 deletions infrastructure/preprod.tfvars
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
environment = "pre-prod"
owner = "nhse/ndr-team"
domain = "access-request-fulfilment.patient-deductions.nhs.uk"
environment = "pre-prod"
owner = "nhse/ndr-team"
domain = "access-request-fulfilment.patient-deductions.nhs.uk"
certificate_domain = "pre-prod.access-request-fulfilment.patient-deductions.nhs.uk"
1 change: 1 addition & 0 deletions infrastructure/route53.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module "route53_fargate_ui" {
environment = var.environment
owner = var.owner
domain = var.domain
certificate_domain = var.certificate_domain
using_arf_hosted_zone = true
dns_name = module.ndr-ecs-fargate.dns_name
}
7 changes: 4 additions & 3 deletions infrastructure/test.tfvars
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
environment = "test"
owner = "nhse/ndr-team"
domain = "access-request-fulfilment.patient-deductions.nhs.uk"
environment = "test"
owner = "nhse/ndr-team"
domain = "access-request-fulfilment.patient-deductions.nhs.uk"
certificate_domain = "access-request-fulfilment.patient-deductions.nhs.uk"
4 changes: 4 additions & 0 deletions infrastructure/variable.tf
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,7 @@ variable "enable_dns_hostnames" {
variable "domain" {
type = string
}

variable "certificate_domain" {
type = string
}

0 comments on commit 994fc02

Please sign in to comment.