From ac8628b96280643b9df1a9feb0c9385e92287279 Mon Sep 17 00:00:00 2001 From: Johnny Che <114401755+chej-hod@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:03:43 +0100 Subject: [PATCH] CCL-663: remove tf modules created under ccl-663 (#185) --- .../README.md | 71 --------------- .../main.tf | 73 ---------------- .../outputs.tf | 15 ---- .../variables.tf | 33 ------- .../versions.tf | 9 -- .../route53_zone_with_records/README.md | 87 ------------------- .../route53_zone_with_records/main.tf | 21 ----- .../route53_zone_with_records/outputs.tf | 11 --- .../route53_zone_with_records/variables.tf | 21 ----- .../route53_zone_with_records/versions.tf | 9 -- 10 files changed, 350 deletions(-) delete mode 100644 modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/README.md delete mode 100644 modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/main.tf delete mode 100644 modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/outputs.tf delete mode 100644 modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/variables.tf delete mode 100644 modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/versions.tf delete mode 100644 modules/aws/networking/route53_zone_with_records/README.md delete mode 100644 modules/aws/networking/route53_zone_with_records/main.tf delete mode 100644 modules/aws/networking/route53_zone_with_records/outputs.tf delete mode 100644 modules/aws/networking/route53_zone_with_records/variables.tf delete mode 100644 modules/aws/networking/route53_zone_with_records/versions.tf diff --git a/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/README.md b/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/README.md deleted file mode 100644 index bad55e9..0000000 --- a/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# core-cloud-vpc-endpoint-tf-module - VPC Endpoint Terraform Module - -## Example Usage -``` - module "vpce" { - source = "git::git::https://github.com/UKHomeOffice/core-cloud-vpc-endpoint-tf-module.git?ref=main" - - vpc_endpoint_name = "some_service" - vpc_id = "vpc-xxxxxxxxxxxxxxxxx" - service_name = "com.amazonaws.vpce..xxxxxxxxxxxxxxx" - security_group_ids = ["sg-xxxxxxxxxxxxxx"] - subnet_ids = ["subnet-axxxxxxxxx", "subnet-bxxxxxxxxx", "subnet-cxxxxxxxx"] - managed_private_dns_enabled = false - custom_private_r53_zone = "private.example.com" - } -``` - - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 5.0 | - -## Providers - -| Name | Version | -|------|---------| -| [aws](#provider\_aws) | ~> 5.0 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [route53\_profile](#module\_route53\_profile) | git::https://github.com/UKHomeOffice/core-cloud-route53-profile-tf-module.git | 0.1.0 | -| [vpce](#module\_vpce) | git::https://github.com/UKHomeOffice/core-cloud-vpc-endpoint-tf-module.git | 0.1.1 | - -## Resources - -| Name | Type | -|------|------| -| [aws_route53_record.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource | -| [aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [custom\_private\_r53\_associated\_vpcs](#input\_custom\_private\_r53\_associated\_vpcs) | A list of additional VPC IDs that's to be associated with the custom Route53 PHZ | `list(string)` | `[]` | no | -| [custom\_private\_r53\_zone](#input\_custom\_private\_r53\_zone) | If desired specify a private dns hosted zone for the VPC endpoint | `string` | `""` | no | -| [custom\_private\_r53\_zone\_ttl](#input\_custom\_private\_r53\_zone\_ttl) | If desired specify the ttl of the dns record for the VPC endpoint | `string` | `"300"` | no | -| [dynatrace\_r53\_records](#input\_dynatrace\_r53\_records) | A map of route53 records to generate when provided a map of logical and actual dynatrace environments e.g. {test = nuh63189} | `map(string)` | `{}` | no | -| [managed\_private\_dns\_enabled](#input\_managed\_private\_dns\_enabled) | Whether or not to associate a AWS managed private hosted zone with the specified VPC - AWS services and AWS Marketplace partner services only | `bool` | `false` | no | -| [region](#input\_region) | The AWS region to deploy the vpc endpoint | `string` | `"eu-west-2"` | no | -| [security\_group\_ids](#input\_security\_group\_ids) | The ID of one or more security groups to associate with the network interface. Applicable for endpoints of type Interface. If no security groups are specified, the VPC's default security group is associated with the endpoint. | `list(string)` | `[]` | no | -| [service\_name](#input\_service\_name) | The service name. For AWS services the service name is usually in the form com.amazonaws.. | `string` | n/a | yes | -| [subnet\_ids](#input\_subnet\_ids) | The ID of one or more subnets in which to create a network interface for the endpoint. | `list(string)` | `[]` | no | -| [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no | -| [vpc\_endpoint\_name](#input\_vpc\_endpoint\_name) | The name of the VPC Endpoint resource - try and match the service name as close as possible | `string` | n/a | yes | -| [vpc\_id](#input\_vpc\_id) | The ID of the VPC in which the endpoint will be used | `string` | n/a | yes | - -## Outputs - -| Name | Description | -|------|-------------| -| [aws\_route53\_record\_zone\_id](#output\_aws\_route53\_record\_zone\_id) | n/a | -| [aws\_route53\_records](#output\_aws\_route53\_records) | n/a | -| [vpce\_endpoint\_arn](#output\_vpce\_endpoint\_arn) | n/a | -| [vpce\_endpoint\_id](#output\_vpce\_endpoint\_id) | n/a | - diff --git a/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/main.tf b/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/main.tf deleted file mode 100644 index c7a49dd..0000000 --- a/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/main.tf +++ /dev/null @@ -1,73 +0,0 @@ -module "vpce" { - source = "git::https://github.com/UKHomeOffice/core-cloud-vpc-endpoint-tf-module.git?ref=0.1.1" - - vpc_id = var.vpc_id - service_name = var.service_name - vpc_endpoint_name = "dynatrace" - - security_group_ids = var.security_group_ids - subnet_ids = var.subnet_ids - managed_private_dns_enabled = false - - tags = merge( - var.tags, - { - "vpce_name" = "dynatrace" - "vpce_id" = var.vpc_id - } - ) -} - -resource "aws_route53_zone" "this" { - name = "live.dynatrace.com" - - vpc { - vpc_id = var.vpc_id - } - - tags = merge( - var.tags, - { - "vpce_name" = "dynatrace" - "vpce_id" = var.vpc_id - } - ) - - depends_on = [module.vpce] -} - -resource "aws_route53_record" "this" { - for_each = var.dynatrace_r53_records - - zone_id = aws_route53_zone.this.zone_id - name = each.value - type = "A" - - alias { - name = "${module.vpce.vpce_endpoint_dns[0]["dns_name"]}." - zone_id = module.vpce.vpce_endpoint_dns[0].hosted_zone_id - evaluate_target_health = true - } - - depends_on = [aws_route53_zone.this] -} - -module "route53_profile" { - source = "git::https://github.com/UKHomeOffice/core-cloud-route53-profile-tf-module.git?ref=0.1.0" - - r53_profile_name = "dynatrace" - r53_zone_ids = [aws_route53_zone.this.zone_id] - - tags = merge( - var.tags, - { - "vpce_name" = "dynatrace" - "vpce_id" = var.vpc_id - "r53_phz_id" = aws_route53_zone.this.zone_id - } - ) - - depends_on = [ - aws_route53_zone.this - ] -} diff --git a/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/outputs.tf b/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/outputs.tf deleted file mode 100644 index 515945d..0000000 --- a/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/outputs.tf +++ /dev/null @@ -1,15 +0,0 @@ -output "vpce_endpoint_id" { - value = module.vpce.vpce_endpoint_id -} - -output "vpce_endpoint_arn" { - value = module.vpce.vpce_endpoint_arn -} - -output "aws_route53_record_zone_id" { - value = aws_route53_zone.this.zone_id -} - -output "aws_route53_records_fqdn" { - value = values(aws_route53_record.this).*.fqdn -} diff --git a/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/variables.tf b/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/variables.tf deleted file mode 100644 index 897138d..0000000 --- a/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/variables.tf +++ /dev/null @@ -1,33 +0,0 @@ -variable "vpc_id" { - description = "The ID of the VPC in which the endpoint will be used" - type = string -} - -variable "dynatrace_r53_records" { - description = "A map of route53 records to generate when provided a map of logical and actual dynatrace environments e.g. {test = nuh63189}" - type = map(string) - default = {} -} - -variable "service_name" { - description = "The service name. For AWS services the service name is usually in the form com.amazonaws.." - type = string -} - -variable "security_group_ids" { - description = "The ID of one or more security groups to associate with the network interface. Applicable for endpoints of type Interface. If no security groups are specified, the VPC's default security group is associated with the endpoint." - type = list(string) - default = [] -} - -variable "subnet_ids" { - description = "The ID of one or more subnets in which to create a network interface for the endpoint." - type = list(string) - default = [] -} - -variable "tags" { - description = "A map of tags to add to all resources" - type = map(string) - default = {} -} diff --git a/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/versions.tf b/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/versions.tf deleted file mode 100644 index 802f8c4..0000000 --- a/modules/aws/networking/dynatrace-vpce-r53_phz-r53_profile/versions.tf +++ /dev/null @@ -1,9 +0,0 @@ -terraform { - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 5.0" - } - } - required_version = ">= 1.0" -} diff --git a/modules/aws/networking/route53_zone_with_records/README.md b/modules/aws/networking/route53_zone_with_records/README.md deleted file mode 100644 index 3548c7a..0000000 --- a/modules/aws/networking/route53_zone_with_records/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# core-cloud-vpc-endpoint-tf-module - VPC Endpoint Terraform Module - -## Example Usage -``` -module "r53_zone_with_rec" { - source = "git::git::https://github.com/UKHomeOffice/core-cloud-terraform-modules.git//modules/aws/networking/route53_zone_with_records?ref=main" - - vpc_id = ["vpc-xxxxxxxxxxxxxxxxx"] - r53_zone = "example.com" - r53_records_as_json = jsonencode( - [ - { - name = "api" - type = "A" - alias = { - name = "xxxxxxxxxxx.execute-api.eu-west-1.amazonaws.com" - zone_id = "XXXXXXXXXX" - } - }, - { - name = "www" - type = "A" - ttl = 3600 - records = [ - "127.0.0.1", - ] - }, - ] - ) -} - - module "vpce" { - source = "git::git::https://github.com/UKHomeOffice/core-cloud-vpc-endpoint-tf-module.git?ref=main" - - vpc_endpoint_name = "some_service" - vpc_id = "vpc-xxxxxxxxxxxxxxxxx" - service_name = "com.amazonaws.vpce..xxxxxxxxxxxxxxx" - security_group_ids = ["sg-xxxxxxxxxxxxxx"] - subnet_ids = ["subnet-axxxxxxxxx", "subnet-bxxxxxxxxx", "subnet-cxxxxxxxx"] - managed_private_dns_enabled = false - custom_private_r53_zone = "private.example.com" - } -``` - - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 5.0 | - -## Providers - -| Name | Version | -|------|---------| -| [aws](#provider\_aws) | ~> 5.0 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [records](#module\_records) | terraform-aws-modules/route53/aws//modules/records | ~> 4.0 | - -## Resources - -| Name | Type | -|------|------| -| [aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_zone) | resource | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [r53\_records\_as\_json](#input\_r53\_records\_as\_json) | A JSON encoded String of the records for the Route53 Zone you wish to create, please see example for usage. It's JSON encoded due to Terragrunt Bug - https://github.com/gruntwork-io/terragrunt/issues/1211 | `string` | n/a | yes | -| [r53\_zone](#input\_r53\_zone) | The name of the Route53 Zone. e.g example.com | `string` | n/a | yes | -| [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no | -| [vpc\_id](#input\_vpc\_id) | A list of VPCs to associate the Route53 Zone with - setting this will create a Private Hosted Zone (PHZ) | `list(string)` | `[]` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| [aws\_route53\_record\_fqdn](#output\_aws\_route53\_record\_fqdn) | n/a | -| [aws\_route53\_record\_name](#output\_aws\_route53\_record\_name) | n/a | -| [aws\_route53\_record\_zone\_id](#output\_aws\_route53\_record\_zone\_id) | n/a | - diff --git a/modules/aws/networking/route53_zone_with_records/main.tf b/modules/aws/networking/route53_zone_with_records/main.tf deleted file mode 100644 index d5ceaef..0000000 --- a/modules/aws/networking/route53_zone_with_records/main.tf +++ /dev/null @@ -1,21 +0,0 @@ -resource "aws_route53_zone" "this" { - name = var.r53_zone - - dynamic "vpc" { - for_each = toset(var.vpc_id) - content { - vpc_id = vpc.key - } - } - tags = var.tags -} - -module "records" { - source = "terraform-aws-modules/route53/aws//modules/records" - version = "~> 4.0" - - zone_id = aws_route53_zone.this.zone_id - records_jsonencoded = var.r53_records_as_json - - depends_on = [aws_route53_zone.this] -} diff --git a/modules/aws/networking/route53_zone_with_records/outputs.tf b/modules/aws/networking/route53_zone_with_records/outputs.tf deleted file mode 100644 index 6a68370..0000000 --- a/modules/aws/networking/route53_zone_with_records/outputs.tf +++ /dev/null @@ -1,11 +0,0 @@ -output "aws_route53_record_zone_id" { - value = aws_route53_zone.this.zone_id -} - -output "aws_route53_record_name" { - value = module.records.route53_record_name -} - -output "aws_route53_record_fqdn" { - value = module.records.route53_record_fqdn -} diff --git a/modules/aws/networking/route53_zone_with_records/variables.tf b/modules/aws/networking/route53_zone_with_records/variables.tf deleted file mode 100644 index b5f1f1a..0000000 --- a/modules/aws/networking/route53_zone_with_records/variables.tf +++ /dev/null @@ -1,21 +0,0 @@ -variable "vpc_id" { - description = "A list of VPCs to associate the Route53 Zone with - setting this will create a Private Hosted Zone (PHZ)" - type = list(string) - default = [] -} - -variable "r53_zone" { - description = "The name of the Route53 Zone. e.g example.com" - type = string -} - -variable "r53_records_as_json" { - description = "A JSON encoded String of the records for the Route53 Zone you wish to create, please see example for usage. It's JSON encoded due to Terragrunt Bug - https://github.com/gruntwork-io/terragrunt/issues/1211" - type = string -} - -variable "tags" { - description = "A map of tags to add to all resources" - type = map(string) - default = {} -} diff --git a/modules/aws/networking/route53_zone_with_records/versions.tf b/modules/aws/networking/route53_zone_with_records/versions.tf deleted file mode 100644 index 802f8c4..0000000 --- a/modules/aws/networking/route53_zone_with_records/versions.tf +++ /dev/null @@ -1,9 +0,0 @@ -terraform { - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 5.0" - } - } - required_version = ">= 1.0" -}