diff --git a/terraform/implementation/ecs/README.md b/terraform/implementation/ecs/README.md index e78e653..44450b6 100644 --- a/terraform/implementation/ecs/README.md +++ b/terraform/implementation/ecs/README.md @@ -9,7 +9,7 @@ | Name | Version | |------|---------| -| [aws](#provider\_aws) | 5.56.1 | +| [aws](#provider\_aws) | =5.56.1 | ## Modules @@ -28,7 +28,7 @@ | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [availability\_zones](#input\_availability\_zones) | The availability zones to use | `list(string)` |
[| no | +| [availability\_zones](#input\_availability\_zones) | The availability zones to use | `list(string)` |
"us-east-1a",
"us-east-1b",
"us-east-1c"
]
[| no | | [create\_internet\_gateway](#input\_create\_internet\_gateway) | Flag to determine if an internet gateway should be created | `bool` | `false` | no | | [ecr\_viewer\_database\_schema](#input\_ecr\_viewer\_database\_schema) | The database schema used for the eCR data tables | `string` | `"core"` | no | | [ecr\_viewer\_database\_type](#input\_ecr\_viewer\_database\_type) | The SQL variant used for the eCR data tables | `string` | `"postgres"` | no | @@ -36,9 +36,9 @@ | [enable\_nat\_gateway](#input\_enable\_nat\_gateway) | Enable NAT Gateway | `bool` | `false` | no | | [owner](#input\_owner) | The owner of the infrastructure | `string` | `"skylight"` | no | | [phdi\_version](#input\_phdi\_version) | PHDI container image version | `string` | `"v1.4.4"` | no | -| [private\_subnets](#input\_private\_subnets) | The private subnets | `list(string)` |
"us-east-1a",
"us-east-1b",
"us-east-1c"
]
[| no | -| [project](#input\_project) | The project name | `string` | `"dibbs-ce"` | no | -| [public\_subnets](#input\_public\_subnets) | The public subnets | `list(string)` |
"176.24.1.0/24",
"176.24.3.0/24"
]
[| no | +| [private\_subnets](#input\_private\_subnets) | The private subnets | `list(string)` |
"176.24.2.0/24",
"176.24.4.0/24"
]
[| no | +| [project](#input\_project) | The project name | `string` | `"dibbs"` | no | +| [public\_subnets](#input\_public\_subnets) | The public subnets | `list(string)` |
"176.24.1.0/24",
"176.24.3.0/24"
]
[| no | | [region](#input\_region) | AWS region | `string` | `"us-east-1"` | no | | [single\_nat\_gateway](#input\_single\_nat\_gateway) | Single NAT Gateway | `bool` | `false` | no | | [vpc](#input\_vpc) | The name of the VPC | `string` | `"ecs-vpc"` | no | diff --git a/terraform/implementation/ecs/_variable.tf b/terraform/implementation/ecs/_variable.tf index c09f967..6eef68e 100644 --- a/terraform/implementation/ecs/_variable.tf +++ b/terraform/implementation/ecs/_variable.tf @@ -44,7 +44,7 @@ variable "private_subnets" { variable "project" { description = "The project name" type = string - default = "dibbs-ce" + default = "dibbs" } variable "public_subnets" { diff --git a/terraform/implementation/setup/README.md b/terraform/implementation/setup/README.md index 1c95943..da50e74 100644 --- a/terraform/implementation/setup/README.md +++ b/terraform/implementation/setup/README.md @@ -1,13 +1,14 @@ ## Requirements -No requirements. +| Name | Version | +|------|---------| +| [aws](#requirement\_aws) | =5.70.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | 5.70.0 | | [local](#provider\_local) | 2.5.2 | | [random](#provider\_random) | 3.6.3 | @@ -16,17 +17,12 @@ No requirements. | Name | Source | Version | |------|--------|---------| | [oidc](#module\_oidc) | ../../modules/oidc | n/a | +| [tfstate](#module\_tfstate) | ../../modules/tfstate | n/a | ## Resources | Name | Type | |------|------| -| [aws_dynamodb_table.tfstate_lock](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table) | resource | -| [aws_s3_bucket.tfstate](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | -| [aws_s3_bucket_public_access_block.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource | -| [aws_s3_bucket_server_side_encryption_configuration.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration) | resource | -| [aws_s3_bucket_versioning.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_versioning) | resource | -| [local_file.ecs_env](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource | | [local_file.setup_env](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource | | [random_string.setup](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource | @@ -36,7 +32,7 @@ No requirements. |------|-------------|------|---------|:--------:| | [oidc\_github\_repo](#input\_oidc\_github\_repo) | The GitHub repository for OIDC | `string` | `""` | no | | [owner](#input\_owner) | The owner of the project | `string` | `"skylight"` | no | -| [project](#input\_project) | The name of the project | `string` | `"dibbs-ce"` | no | +| [project](#input\_project) | The name of the project | `string` | `"dibbs"` | no | | [region](#input\_region) | The AWS region where resources are created | `string` | `"us-east-1"` | no | ## Outputs diff --git a/terraform/implementation/setup/_variable.tf b/terraform/implementation/setup/_variable.tf index 1f33a4b..48d81c0 100644 --- a/terraform/implementation/setup/_variable.tf +++ b/terraform/implementation/setup/_variable.tf @@ -13,7 +13,7 @@ variable "owner" { variable "project" { description = "The name of the project" type = string - default = "dibbs-ce" + default = "dibbs" } variable "region" { diff --git a/terraform/implementation/setup/main.tf b/terraform/implementation/setup/main.tf index 35c6574..2d25ae0 100644 --- a/terraform/implementation/setup/main.tf +++ b/terraform/implementation/setup/main.tf @@ -5,11 +5,11 @@ resource "random_string" "setup" { } module "tfstate" { - source = "../../modules/tfstate" + source = "../../modules/tfstate" identifier = random_string.setup.result - owner = var.owner - project = var.project - region = var.region + owner = var.owner + project = var.project + region = var.region } # GitHub OIDC for prod @@ -28,7 +28,7 @@ module "oidc" { workspace = "prod" # state_bucket_arn = module.tfstate.aws_s3_bucket.tfstate.arn - state_bucket_arn = module.tfstate.state_bucket.arn + state_bucket_arn = module.tfstate.state_bucket.arn # dynamodb_table_arn = aws_dynamodb_table.tfstate_lock.arn dynamodb_table_arn = module.tfstate.dynamodb_table.arn } diff --git a/terraform/modules/ecs/README.md b/terraform/modules/ecs/README.md index 5ec2d8f..afe73bb 100644 --- a/terraform/modules/ecs/README.md +++ b/terraform/modules/ecs/README.md @@ -93,7 +93,7 @@ No modules. | [region](#input\_region) | The AWS region where resources are created | `string` | n/a | yes | | [s3\_viewer\_bucket\_name](#input\_s3\_viewer\_bucket\_name) | Name of the S3 bucket for the viewer | `string` | `""` | no | | [s3\_viewer\_bucket\_role\_name](#input\_s3\_viewer\_bucket\_role\_name) | Name of the IAM role for the ecr-viewer bucket | `string` | `""` | no | -| [service\_data](#input\_service\_data) | Data for the DIBBS services |
"176.24.2.0/24",
"176.24.4.0/24"
]
map(object({| `{}` | no | +| [service\_data](#input\_service\_data) | Data for the DIBBS services |
short_name = string
fargate_cpu = number
fargate_memory = number
app_count = number
app_image = string
app_version = string
container_port = number
host_port = number
public = bool
registry_url = string
env_vars = list(object({
name = string
value = string
}))
}))
map(object({| `{}` | no | | [tags](#input\_tags) | Tags to apply to resources | `map(string)` | `{}` | no | | [vpc\_id](#input\_vpc\_id) | ID of the VPC | `string` | n/a | yes | diff --git a/terraform/modules/oidc/_variable.tf b/terraform/modules/oidc/_variable.tf index 4ba5a50..90dfc8c 100644 --- a/terraform/modules/oidc/_variable.tf +++ b/terraform/modules/oidc/_variable.tf @@ -28,7 +28,7 @@ variable "region" { type = string description = "The AWS region where resources are created" default = "" - validation { + validation { condition = can(regex("^(us|eu|ap|sa|ca|cn|af|me|eu)-[[:alnum:]]{2,10}-[0-9]$", var.region)) error_message = "region must be a valid AWS region" } diff --git a/terraform/modules/tfstate/_variable.tf b/terraform/modules/tfstate/_variable.tf index 1c3f694..6973431 100644 --- a/terraform/modules/tfstate/_variable.tf +++ b/terraform/modules/tfstate/_variable.tf @@ -18,7 +18,7 @@ variable "region" { type = string description = "The AWS region where resources are created" default = "" - validation { + validation { condition = can(regex("^(us)-[[:alnum:]]{2,10}-[0-9]$", var.region)) error_message = "region must be a valid AWS region" }
short_name = string
fargate_cpu = number
fargate_memory = number
app_count = number
app_image = string
app_version = string
container_port = number
host_port = number
public = bool
registry_url = string
env_vars = list(object({
name = string
value = string
}))
}))