Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions infrastructure/modules/dynamodb/default_variables.tf
2 changes: 1 addition & 1 deletion infrastructure/modules/dynamodb/dynamodb.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_dynamodb_table" "dynamodb_table" {
name = "${terraform.workspace == "default" ? "" : "${terraform.workspace}-"}${var.table_name_suffix}"
name = "${terraform.workspace == "default" ? "" : "${terraform.workspace}-"}${var.project_name}-${var.environment}-${var.table_name_suffix}"
billing_mode = "PAY_PER_REQUEST"
hash_key = var.partition_key

Expand Down
16 changes: 0 additions & 16 deletions infrastructure/modules/dynamodb/variables.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
variable "workspace" {
description = "Usually the developer short code or the name of the environment."
type = string
}

variable "project_name" {
default = "eligibility-signposting-api"
type = string
}

variable "table_name_suffix" {
description = "Name of the DynamoDB table"
type = string
Expand All @@ -34,9 +24,3 @@ variable "sort_key_type" {
type = string
default = null
}

variable "tags" {
description = "A map of tags to assign to resources."
type = map(string)
default = {}
}
1 change: 1 addition & 0 deletions infrastructure/modules/s3/default_variables.tf
10 changes: 0 additions & 10 deletions infrastructure/modules/s3/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ variable "bucket_name" {
type = string
}

variable "project_name" {
default = "eligibility-signposting-api"
type = string
}

variable "environment" {
description = "The purpose of the account dev/test/ref/prod or the workspace"
type = string
}

variable "bucket_expiration_days" {
default = 90
description = "How long to keep bucket contents before expiring"
Expand Down
5 changes: 5 additions & 0 deletions infrastructure/stacks/_shared/default_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ variable "default_aws_region" {
description = "Default AWS region"
type = string
}

variable "workspace" {
description = "Usually the developer short code or the name of the environment."
type = string
}
15 changes: 0 additions & 15 deletions infrastructure/stacks/_shared/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,9 @@ locals {
workspace = lower(terraform.workspace)
}

sso_role_patterns = {
dev = "AWSReservedSSO_vdselid_dev_*"
test = "AWSReservedSSO_vdselid_test_*"
preprod = "AWSReservedSSO_vdselid_preprod_*"
}

terraform_state_bucket_name = "eligibility-signposting-api-${var.environment}-tfstate"
terraform_state_bucket_arn = "arn:aws:s3:::eligibility-signposting-api-${var.environment}-tfstate"

account_ids = {
Comment thread
eddalmond1 marked this conversation as resolved.
dev = "448049830832"
test = "050451367081"
preprod = "203918864209"
# prod = "476114145616"
}

current_account_id = lookup(local.account_ids, var.environment, data.aws_caller_identity.current.account_id)

role_arn_pre = "arn:aws:iam::603871901111:role/db-system-worker"
role_arn_prod = "arn:aws:iam::232116723729:role/db-system-worker"

Expand Down
4 changes: 3 additions & 1 deletion infrastructure/stacks/api-layer/dynamodb.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module "eligibility_status_table" {
source = "../../modules/dynamodb"
workspace = local.workspace
table_name_suffix = "eligibilty_data_store"
table_name_suffix = "eligibility_datastore"
partition_key = "NHS_NUMBER"
partition_key_type = "S"
sort_key = "ATTRIBUTE_TYPE"
sort_key_type = "S"
tags = local.tags
environment = local.environment
stack_name = local.stack_name
}
1 change: 0 additions & 1 deletion infrastructure/stacks/bootstrap/locals.tf

This file was deleted.

5 changes: 5 additions & 0 deletions infrastructure/stacks/bootstrap/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
locals {

stack_name = "bootstrap"

}
2 changes: 2 additions & 0 deletions infrastructure/stacks/bootstrap/modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ module "tfstate" {

project_name = var.project_name
environment = var.environment
workspace = var.workspace
stack_name = local.stack_name
}
1 change: 1 addition & 0 deletions infrastructure/stacks/bootstrap/shared_locals.tf
Loading