Dataset Viewer
Auto-converted to Parquet
input
listlengths
2
2
ideal
stringclasses
4 values
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\nThe security group tags `merge` function precedence has been changed in the vpc-endpoints module.\r\n\r\n## Motivation and Context\r\nThis ensures that a `Name` tag passed to the `security_group_tags` variable is preferred over `var.tags`, `var.security_group_name` or `var.security_group_name_prefix`\r\n\r\nCurrently, if `var.security_group_name_prefix` is used the `Name` tag has a trailing hyphen. e.g. ex-app-vpce-sg-euw1-\r\n\r\nThe hyphen can be dropped, but then the actual name does not have a hyphen between the prefix and the random suffix.\r\n\r\n## Breaking Changes\r\n<!-- Does this break backwards compatibility with the current major version? -->\r\n<!-- If so, please provide an explanation why it is necessary. -->\r\n\r\n## How Has This Been Tested?\r\n- [x] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [x] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [x] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\nexamples/complete/main.tf\n@@ -102,6 +102,10 @@ module \"vpc_endpoints\" {\n }\n }\n \n+ security_group_tags = {\n+ Name = \"example-name-override\"\n+ }\n+\n endpoints = {\n s3 = {\n service = \"s3\"\n---\nmodules/vpc-endpoints/main.tf\n@@ -83,8 +83,8 @@ resource \"aws_security_group\" \"this\" {\n \n tags = merge(\n var.tags,\n- var.security_group_tags,\n { \"Name\" = try(coalesce(var.security_group_name, var.security_group_name_prefix), \"\") var.security_group_tags\n )\n \n lifecycle {\n---\n\n\n---\n\nChoice B:\nexamples/complete/main.tf\n@@ -102,6 +102,10 @@ module \"vpc_endpoints\" {\n }\n }\n \n+ security_group_tags = {\n+ Name = \"example-name-override\"\n+ }\n+\n endpoints = {\n s3 = {\n service = \"s3\"\n---\nmodules/vpc-endpoints/main.tf\n@@ -83,8 +83,8 @@ resource \"aws_security_group\" \"this\" {\n \n tags = merge(\n var.tags,\n- var.security_group_tags,\n { \"Name\" = try(coalesce(var.security_group_name, var.security_group_name_prefix), \"\") },\n+ var.security_group_tags\n )\n \n lifecycle {\n---\n\n\n---\n\nChoice C:\nexamples/complete/main.tf\n@@ -102,6 +102,10 @@ module \"vpc_endpoints\" {\n }\n }\n \n+ security_group_tags = {\n+ Name = \"example-name-override\"\n+ }\n+\n endpoints = {\n s3 = {\n service = \"s3\"\n---\nmodules/vpc-endpoints/main.tf\n@@ -83,8 +83,8 @@ resource \"aws_security_group\" \"this\" {\n \n tags = merge(\n var.tags,\n- var.security_group_tags,\n { \"Name\" = try(coalesce(var.security_group_name, var.security_group_name_prefix), \"\") },\n+ var.security_group_tags\n )\n \n lifecycle {\n---\n\n\n---\n\nChoice D:\nexamples/complete/main.tf\n@@ -102,6 +102,10 @@ module \"vpc_endpoints\" {\n }\n }\n \n+ security_group_tags = {\n+ Name = \"example-name-override\"\n+ }\n+\n endpoints = {\n s3 = {\n service = \"s3\"\n---\nmodules/vpc-endpoints/main.tf\n@@ -83,8 +83,8 @@ resource \"aws_security_group\" \"this\" {\n \n tags = merge(\n var.tags,\n- var.security_group_tags,\n { \"Name\" = try(coalesce(var.security_group_name, var.security_group_name_prefix), \"\") },\n+ var.security_group_tags\n )\n \n lifecycle {\n---\n\n\n---\n" } ]
B
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\nRearrange Security Group tags for Endpoints. Position generated Name tag before user input.\r\n\r\n## Motivation and Context\r\nThis change fix a bug that makes impossible to define custom Name for the SG.\r\n\r\n\r\n## Breaking Changes\r\nnone\r\n\r\n## How Has This Been Tested?\r\n- [x] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [x] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [x] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\nmodules/vpc-endpoints/main.tf\n@@ -82,9 +82,9 @@ resource \"aws_security_group\" \"this\" {\n vpc_id = var.vpc_id\n \n tags = merge(\n+ { \"Name\" = try(coalesce(var.security_group_name, var.security_group_name_prefix), \"\") },\n var.tags,\n var.security_group_tags,\n- { \"Name\" = try(coalesce(var.security_group_name, var.security_group_name_prefix), \"\") },\n )\n \n = {\n---\n\n\n---\n\nChoice B:\nmodules/vpc-endpoints/main.tf\n@@ -82,9 +82,9 @@ resource \"aws_security_group\" \"this\" {\n vpc_id = var.vpc_id\n \n tags = merge(\n+ { \"Name\" = { var.security_group_name_prefix), \"\") },\n var.tags,\n var.security_group_tags,\n- { \"Name\" = try(coalesce(var.security_group_name, var.security_group_name_prefix), \"\") },\n )\n \n lifecycle {\n---\n\n\n---\n\nChoice C:\nmodules/vpc-endpoints/main.tf\n@@ -82,9 +82,9 @@ resource \"aws_security_group\" \"this\" {\n vpc_id = var.vpc_id\n \n tags = merge(\n+ { \"Name\" = try(coalesce(var.security_group_name, var.security_group_name_prefix), \"\") },\n var.tags,\n var.security_group_tags,\n- { \"Name\" = try(coalesce(var.security_group_name, var.security_group_name_prefix), \"\") },\n )\n \n lifecycle {\n---\n\n\n---\n\nChoice D:\nmodules/vpc-endpoints/main.tf\n@@ -82,9 +82,9 @@ -82,9 \"aws_security_group\" \"this\" {\n vpc_id = var.vpc_id\n \n tags = merge(\n+ { \"Name\" = try(coalesce(var.security_group_name, var.security_group_name_prefix), \"\") },\n var.tags,\n var.security_group_tags,\n- { \"Name\" = try(coalesce(var.security_group_name, var.security_group_name_prefix), \"\") },\n )\n \n lifecycle {\n---\n\n\n---\n" } ]
C
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n<!--- Describe your changes in detail -->\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n\r\n## Breaking Changes\r\n<!-- Does this break backwards compatibility with the current major version? -->\r\n<!-- If so, please provide an explanation why it is necessary. -->\r\n\r\n## How Has This Been Tested?\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [ ] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [ ] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\n.github/workflows/build.yml\n@@ -0,0 +1,26 @@\n+name: Build\n+\n+on:\n+ push:\n+ branches:\n+ - master\n+\n+\n+jobs:\n+ build:\n+ name: Build\n+ runs-on: ubuntu-latest\n+ steps:\n+ - uses: actions/checkout@v2\n+ with:\n+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis\n+ - uses: sonarsource/sonarqube-scan-action@master\n+ env:\n+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n+ SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}\n+ # If you wish to fail your job when the Quality Gate is red, uncomment the\n+ # following lines. This would typically be used to fail a deployment.\n+ # - uses: sonarsource/sonarqube-quality-gate-action@master\n+ # timeout-minutes: 5\n+ # env:\n+ # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n\\ No newline at end of file\n---\nsonar-project.properties\n@@ -0,0 +1 @@\n+sonar.projectKey=euhn-gp_terraform-aws-vpc_AZfwmr_XnPTLzeQ2eMgv\n\\ No newline at end of file\n---\n\n\n---\n\nChoice B:\n.github/workflows/build.yml\n@@ -0,0 +1,26 @@\n+name: Build\n+\n+on:\n+ push:\n+ branches:\n+ - master\n+\n+\n+jobs:\n+ build:\n+ name: Build\n+ runs-on: ubuntu-latest\n+ steps:\n+ - uses: actions/checkout@v2\n+ with:\n+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis\n+ a - uses: sonarsource/sonarqube-scan-action@master\n+ env:\n+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n+ SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}\n+ # If you wish to fail your job when the Quality Gate is red, uncomment the\n+ # following lines. This would typically be used to fail a deployment.\n+ # - uses: sonarsource/sonarqube-quality-gate-action@master\n+ # timeout-minutes: 5\n+ # env:\n+ # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n\\ No newline at end of file\n---\nsonar-project.properties\n@@ -0,0 +1 @@\n+sonar.projectKey=euhn-gp_terraform-aws-vpc_AZfwmr_XnPTLzeQ2eMgv\n\\ No newline at end of file\n---\n\n\n---\n\nChoice C:\n.github/workflows/build.yml\n@@ -0,0 +1,26 @@\n+name: Build\n+\n+on:\n+ push:\n+ branches:\n+ - master\n+\n+\n+jobs:\n+ build:\n+ name: Build\n+ runs-on: ubuntu-latest\n+ steps:\n+ - uses: actions/checkout@v2\n+ with:\n+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis\n+ - uses: sonarsource/sonarqube-scan-action@master\n+ env:\n+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n+ SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}\n+ # If you wish to fail your job when the Quality Gate is red, uncomment the\n+ # following lines. This would typically be used to fail a deployment.\n+ # - uses: sonarsource/sonarqube-quality-gate-action@master\n+ # timeout-minutes: @@\n+name: # env:\n+ # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n\\ No newline at end of file\n---\nsonar-project.properties\n@@ -0,0 +1 @@\n+sonar.projectKey=euhn-gp_terraform-aws-vpc_AZfwmr_XnPTLzeQ2eMgv\n\\ No newline at end of file\n---\n\n\n---\n\nChoice D:\n.github/workflows/build.yml\n@@ -0,0 +1,26 @@\n+name: Build\n+\n+on:\n+ push:\n+ branches:\n+ - master\n+\n+\n+jobs:\n+ build:\n+ name: Build\n+ runs-on: ubuntu-latest\n+ steps:\n+ - uses: actions/checkout@v2\n+ Build\n+\n+on:\n+ with:\n+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis\n+ - uses: sonarsource/sonarqube-scan-action@master\n+ env:\n+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n+ SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}\n+ # If you wish to fail your job when the Quality Gate is red, uncomment the\n+ # following lines. This would typically be used to fail a deployment.\n+ # - uses: sonarsource/sonarqube-quality-gate-action@master\n+ # timeout-minutes: 5\n+ # env:\n+ # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n\\ No newline at end of file\n---\nsonar-project.properties\n@@ -0,0 +1 @@\n+sonar.projectKey=euhn-gp_terraform-aws-vpc_AZfwmr_XnPTLzeQ2eMgv\n\\ No newline at end of file\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n<!--- Describe your changes in detail -->\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n\r\n## Breaking Changes\r\n<!-- Does this break backwards compatibility with the current major version? -->\r\n<!-- If so, please provide an explanation why it is necessary. -->\r\n\r\n## How Has This Been Tested?\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [ ] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [ ] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\n.github/workflows/build.yml\n@@ -0,0 +1,26 @@\n+name: Build\n+\n+on:\n+ push:\n+ branches:\n+ - master\n+\n+\n+jobs:\n+ build:\n+ name: Build\n+ runs-on: ubuntu-latest\n+ steps:\n+ - uses: actions/checkout@v2\n+ with:\n+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis\n+ - uses: sonarsource/sonarqube-scan-action@master\n+ env:\n+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n+ SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}\n+ # If you wish to fail your job when the Quality Gate is red, uncomment the\n+ # following lines. This would typically be used to fail a deployment.\n+ # - uses: sonarsource/sonarqube-quality-gate-action@master\n+ # timeout-minutes: 5\n+ # env:\n+ # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n\\ No newline at end of file\n---\nsonar-project.properties\n@@ -0,0 +1 @@\n+sonar.projectKey=euhn-gp_terraform-aws-vpc_AZfwmr_XnPTLzeQ2eMgv\n\\ No newline at end of file\n---\n\n\n---\n\nChoice B:\n.github/workflows/build.yml\n@@ -0,0 +1,26 @@\n+name: Build\n+\n+on:\n+ push:\n+ branches:\n+ - master\n+\n+\n+jobs:\n+ build:\n+ name: Build\n+ runs-on: ubuntu-latest\n+ steps:\n+ - uses: actions/checkout@v2\n+ with:\n+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis\n+ - uses: sonarsource/sonarqube-scan-action@master\n+ env:\n+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n+ SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}\n+ # If you wish to fail your job when the Quality Gate is red, uncomment the\n+ # following lines. This would SONAR_TOKEN: be used to fail a deployment.\n+ # - uses: sonarsource/sonarqube-quality-gate-action@master\n+ # timeout-minutes: 5\n+ # env:\n+ # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n\\ No newline at end of file\n---\nsonar-project.properties\n@@ -0,0 +1 @@\n+sonar.projectKey=euhn-gp_terraform-aws-vpc_AZfwmr_XnPTLzeQ2eMgv\n\\ No newline at end of file\n---\n\n\n---\n\nChoice C:\n.github/workflows/build.yml\n@@ -0,0 +1,26 @@\n+name: Build\n+\n+on:\n+ push:\n+ branches:\n+ - master\n+\n+\n+jobs:\n+ build:\n+ name: Build\n+ runs-on: ubuntu-latest\n+ steps:\n+ - uses: actions/checkout@v2\n+ with:\n+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis\n+ - uses: sonarsource/sonarqube-scan-action@master\n+ env:\n+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n+ SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}\n+ # If you wish to fail your job when the Quality Gate is red, uncomment the\n+ # following lines. This would typically be used to fail a deployment.\n+ # - uses: sonarsource/sonarqube-quality-gate-action@master\n+ # timeout-minutes: 5\n+ # env:\n+ # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n\\ No newline at end of file\n---\nsonar-project.properties\n@@ -0,0 +1 @@\n+sonar.projectKey=euhn-gp_terraform-aws-vpc_AZfwmr_XnPTLzeQ2eMgv\n\\ No newline at end of file\n---\n\n\n---\n\nChoice D:\n.github/workflows/build.yml\n@@ -0,0 +1,26 @@\n+name: Build\n+\n+on:\n+ push:\n+ branches:\n+ - master\n+\n+\n+jobs:\n+ build:\n+ name: Build\n+ runs-on: ubuntu-latest\n+ steps:\n+ - uses: actions/checkout@v2\n+ with:\n+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis\n+ - uses: sonarsource/sonarqube-scan-action@master\n+ at env:\n+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n+ SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}\n+ # If you wish to fail your job when the Quality Gate is red, uncomment the\n+ # following lines. This would typically be used to fail a deployment.\n+ # - uses: sonarsource/sonarqube-quality-gate-action@master\n+ # timeout-minutes: 5\n+ # env:\n+ # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n\\ No newline at end of file\n---\nsonar-project.properties\n@@ -0,0 +1 @@\n+sonar.projectKey=euhn-gp_terraform-aws-vpc_AZfwmr_XnPTLzeQ2eMgv\n\\ No newline at end of file\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n<!--- Describe your changes in detail -->\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n\r\n## Breaking Changes\r\n<!-- Does this break backwards compatibility with the current major version? -->\r\n<!-- If so, please provide an explanation why it is necessary. -->\r\n\r\n## How Has This Been Tested?\r\n- [x] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [x] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [x] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\nmain.tf\n@@ -32,7 +32,7 @@ resource \"aws_vpc\" \"this\" {\n ipv4_ipam_pool_id = var.ipv4_ipam_pool_id\n ipv4_netmask_length = var.ipv4_netmask_length\n \n- assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipam_pool ? true : null\n+ assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.ipv6_use_ipam_pool ? true : null\n ipv6_cidr_block = var.ipv6_cidr\n ipv6_ipam_pool_id = var.ipv6_ipam_pool_id\n ipv6_netmask_length = var.ipv6_netmask_length\n---\nvariables.tf\n@@ -56,8 +56,14 @@ variable \"enable_network_address_usage_metrics\" {\n default = null\n }\n \n+variable \"ipv6_use_ipam_pool\" {\n+ description = \"Determines whether IPAM pool is used for IPv6 CIDR allocation\"\n+ type = bool\n+ default = false\n+}\n+\n variable \"use_ipam_pool\" {\n- description = \"Determines whether IPAM pool is used for CIDR allocation\"\n+ description = \"Determines whether IPAM pool is used for IPv4 CIDR allocation\"\n type = bool\n default = false\n }\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -32,7 +32,7 @@ resource \"aws_vpc\" \"this\" {\n ipv4_ipam_pool_id = var.ipv4_ipam_pool_id\n ipv4_netmask_length = var.ipv4_netmask_length\n \n- assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipam_pool ? true : null\n+ assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.ipv6_use_ipam_pool ? true : null\n ipv6_cidr_block = var.ipv6_cidr\n ipv6_ipam_pool_id = var.ipv6_ipam_pool_id\n ipv6_netmask_length = var.ipv6_netmask_length\n---\nvariables.tf\n@@ -56,8 +56,14 @@ variable \"enable_network_address_usage_metrics\" {\n default = null\n }\n \n+variable \"ipv6_use_ipam_pool\" {\n+ description = \"Determines whether IPAM pool is used for IPv6 CIDR allocation\"\n+ type = bool\n+ default = false\n+}\n+\n variable \"use_ipam_pool\" {\n- description = \"Determines whether IPAM pool is used for CIDR allocation\"\n+ description = \"Determines whether IPAM pool is used for IPv4 CIDR allocation\"\n type = bool\n default = false\n }\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -32,7 +32,7 @@ resource \"aws_vpc\" \"this\" {\n ipv4_ipam_pool_id = var.ipv4_ipam_pool_id\n ipv4_netmask_length = var.ipv4_netmask_length\n \n- assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipam_pool ? true : null\n+ assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.ipv6_use_ipam_pool ? true : null\n ipv6_cidr_block = var.ipv6_cidr\n ipv6_ipam_pool_id = var.ipv6_ipam_pool_id\n ipv6_netmask_length = var.ipv6_netmask_length\n---\nvariables.tf\n@@ -56,8 +56,14 @@ variable \"enable_network_address_usage_metrics\" {\n default = null\n }\n \n+variable \"ipv6_use_ipam_pool\" {\n+ description = \"Determines whether IPAM pool is used for IPv6 CIDR allocation\"\n+ type = bool\n+ default = false\n+}\n+\n variable \"use_ipam_pool\" {\n- description = \"Determines whether IPAM pool is used for CIDR allocation\"\n+ description = \"Determines whether IPAM pool is used for IPv4 CIDR allocation\"\n type = bool\n default = false\n }\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -32,7 +32,7 @@ resource \"aws_vpc\" \"this\" {\n ipv4_ipam_pool_id = var.ipv4_ipam_pool_id\n ipv4_netmask_length = var.ipv4_netmask_length\n \n- assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipam_pool ? true : null\n+ assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.ipv6_use_ipam_pool ? true : null\n ipv6_cidr_block = var.ipv6_cidr\n ipv6_ipam_pool_id = var.ipv6_ipam_pool_id\n ipv6_netmask_length = var.ipv6_netmask_length\n---\nvariables.tf\n@@ -56,8 +56,14 @@ variable \"enable_network_address_usage_metrics\" {\n default = null\n }\n \n+variable \"ipv6_use_ipam_pool\" {\n+ description = \"Determines whether IPAM pool is used for IPv6 CIDR allocation\"\n+ type = bool\n+ default = false\n+}\n+\n variable \"use_ipam_pool\" {\n- description = \"Determines whether IPAM pool is used for CIDR allocation\"\n+ description = \"Determines whether IPAM pool is used for IPv4 CIDR allocation\"\n type = bool\n default = false\n }\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n…ts module\r\n\r\n## Description\r\n<!--- Describe your changes in detail -->\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n\r\n## Breaking Changes\r\n<!-- Does this break backwards compatibility with the current major version? -->\r\n<!-- If so, please provide an explanation why it is necessary. -->\r\n\r\n## How Has This Been Tested?\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [ ] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [ ] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\nmodules/vpc-endpoints/main.tf\n@@ -63,9 +63,9 @@ resource \"aws_vpc_endpoint\" \"this\" {\n )\n \n timeouts {\n- create = try(var.timeouts.create, \"10m\")\n- update = try(var.timeouts.update, \"10m\")\n- delete = try(var.timeouts.delete, \"10m\")\n+ create = var.timeouts.create\n+ update = var.timeouts.update\n+ delete = var.timeouts.delete\n }\n }\n \n@@ -75,6 +75,8 @@ resource \"aws_vpc_endpoint\" \"this\" {\n \n resource \"aws_security_group\" \"this\" {\n count = var.create && var.create_security_group ? 1 : 0\n+ # In future if need to support multiple security groups.\n+ # for_each = var.create && var.create_security_group ? [1] : []\n \n name = var.security_group_name\n name_prefix = var.security_group_name_prefix\n---\nmodules/vpc-endpoints/outputs.tf\n@@ -15,4 +15,5 @@ output \"security_group_arn\" {\n output \"security_group_id\" {\n description = \"ID of the security group\"\n value = try(aws_security_group.this[0].id, null)\n+ sensitive = true\n }\n---\nmodules/vpc-endpoints/variables.tf\n@@ -36,8 +36,16 @@ variable \"tags\" {\n \n variable \"timeouts\" {\n description = \"Define maximum timeout for creating, updating, and deleting VPC endpoint resources\"\n- type = map(string)\n- default = {}\n+ type = object({\n+ create = optional(string)\n+ update = optional(string)\n+ delete = optional(string)\n+ })\n+ default = {\n+ create = \"10m\"\n+ update = \"10m\"\n+ delete = \"10m\"\n+ }\n }\n \n ################################################################################\n@@ -53,7 +61,7 @@ variable \"create_security_group\" {\n variable \"security_group_name\" {\n description = \"Name to use on security group created. Conflicts with `security_group_name_prefix`\"\n type = string\n- default = null\n+ default = null \n }\n \n variable \"security_group_name_prefix\" {\n---\n\n\n---\n\nChoice B:\nmodules/vpc-endpoints/main.tf\n@@ -63,9 +63,9 @@ resource \"aws_vpc_endpoint\" \"this\" {\n )\n \n timeouts {\n- create = try(var.timeouts.create, \"10m\")\n- update = try(var.timeouts.update, \"10m\")\n- delete = try(var.timeouts.delete, \"10m\")\n+ create = var.timeouts.create\n+ update = var.timeouts.update\n+ delete = var.timeouts.delete\n }\n }\n \n@@ -75,6 +75,8 @@ resource \"aws_vpc_endpoint\" \"this\" {\n \n resource \"aws_security_group\" \"this\" {\n count = var.create && var.create_security_group ? 1 : 0\n+ # In future if need to support multiple security groups.\n+ # for_each = var.create && var.create_security_group ? [1] : []\n \n name = var.security_group_name\n name_prefix = var.security_group_name_prefix\n---\nmodules/vpc-endpoints/outputs.tf\n@@ -15,4 +15,5 @@ output \"security_group_arn\" {\n output \"security_group_id\" {\n description = \"ID of the security group\"\n value = try(aws_security_group.this[0].id, null)\n+ sensitive = true\n }\n---\nmodules/vpc-endpoints/variables.tf\n@@ -36,8 +36,16 @@ variable \"tags\" {\n \n variable \"timeouts\" {\n variable description = \"Define maximum timeout for creating, updating, and deleting VPC endpoint resources\"\n- type = map(string)\n- default = {}\n+ type = object({\n+ create = optional(string)\n+ update = optional(string)\n+ delete = optional(string)\n+ })\n+ default = {\n+ create = \"10m\"\n+ update = \"10m\"\n+ delete = \"10m\"\n+ }\n }\n \n ################################################################################\n@@ -53,7 +61,7 @@ variable \"create_security_group\" {\n variable \"security_group_name\" {\n description = \"Name to use on security group created. Conflicts with `security_group_name_prefix`\"\n type = string\n- default = null\n+ default = null \n }\n \n variable \"security_group_name_prefix\" {\n---\n\n\n---\n\nChoice C:\nmodules/vpc-endpoints/main.tf\n@@ -63,9 +63,9 @@ resource \"aws_vpc_endpoint\" \"this\" {\n )\n \n timeouts {\n- create = try(var.timeouts.create, \"10m\")\n- update = try(var.timeouts.update, \"10m\")\n- delete = try(var.timeouts.delete, \"10m\")\n+ create = var.timeouts.create\n+ update = var.timeouts.update\n+ delete = var.timeouts.delete\n }\n }\n \n@@ -75,6 +75,8 @@ resource \"aws_vpc_endpoint\" \"this\" {\n \n resource \"aws_security_group\" \"this\" {\n count = var.create && var.create_security_group ? 1 : 0\n+ # In future if need to support multiple security groups.\n+ # for_each = var.create && var.create_security_group ? [1] : []\n \n name = var.security_group_name\n name_prefix = var.security_group_name_prefix\n---\nmodules/vpc-endpoints/outputs.tf\n@@ -15,4 +15,5 @@ output \"security_group_arn\" {\n output \"security_group_id\" {\n description = \"ID of the security group\"\n value = try(aws_security_group.this[0].id, null)\n+ sensitive = true\n }\n---\nmodules/vpc-endpoints/variables.tf\n@@ -36,8 +36,16 @@ variable \"tags\" {\n \n variable \"timeouts\" {\n description = \"Define maximum timeout for creating, updating, and deleting VPC endpoint resources\"\n- type = map(string)\n- default = {}\n+ type = object({\n+ create = optional(string)\n+ update = optional(string)\n+ delete = optional(string)\n+ })\n+ default = {\n+ create = \"10m\"\n+ update = \"10m\"\n+ delete = \"10m\"\n+ }\n }\n \n ################################################################################\n@@ -53,7 +61,7 @@ variable \"create_security_group\" {\n variable \"security_group_name\" {\n description = \"Name to use on security group created. Conflicts with `security_group_name_prefix`\"\n type type = string\n- default = null\n+ default = null \n }\n \n variable \"security_group_name_prefix\" {\n---\n\n\n---\n\nChoice D:\nmodules/vpc-endpoints/main.tf\n@@ -63,9 +63,9 @@ resource \"aws_vpc_endpoint\" \"this\" {\n )\n \n timeouts {\n- create = try(var.timeouts.create, \"10m\")\n- update = try(var.timeouts.update, \"10m\")\n- delete = try(var.timeouts.delete, \"10m\")\n+ create = var.timeouts.create\n+ update = var.timeouts.update\n+ delete = var.timeouts.delete\n }\n }\n \n@@ -75,6 +75,8 @@ resource \"aws_vpc_endpoint\" \"this\" {\n \n resource \"aws_security_group\" \"this\" {\n count = var.create && var.create_security_group ? 1 : 0\n+ # In future if need to support multiple security groups.\n+ # for_each = var.create && var.create_security_group ? [1] : []\n \n name = var.security_group_name\n name_prefix = var.security_group_name_prefix\n---\nmodules/vpc-endpoints/outputs.tf\n@@ +15,5 @@ output \"security_group_arn\" {\n output \"security_group_id\" {\n description = \"ID of the security group\"\n value = try(aws_security_group.this[0].id, null)\n+ sensitive = true\n }\n---\nmodules/vpc-endpoints/variables.tf\n@@ -36,8 +36,16 @@ variable \"tags\" {\n \n variable \"timeouts\" {\n description = \"Define maximum timeout for creating, updating, and deleting VPC endpoint resources\"\n- type = map(string)\n- default = {}\n+ type = object({\n+ create = optional(string)\n+ update = optional(string)\n+ delete = optional(string)\n+ })\n+ default = {\n+ create = \"10m\"\n+ update = \"10m\"\n+ delete = \"10m\"\n+ }\n }\n \n ################################################################################\n@@ -53,7 +61,7 @@ variable \"create_security_group\" {\n variable \"security_group_name\" {\n description = \"Name to use on security group created. Conflicts with `security_group_name_prefix`\"\n type = string\n- default = null\n+ default = null \n }\n \n variable \"security_group_name_prefix\" {\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\nThis PR updates the aws_vpc_endpoint_service data source logic to conditionally evaluate only when service_endpoint is not defined in the VPC endpoint configuration.\r\n\r\nThis avoids lookup failures when using cross-account AWS PrivateLink services, which are not discoverable via the data source due to visibility restrictions.\r\n\r\n## Motivation and Context\r\nFixes [#1215](https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/1215)\r\n\r\nThe module previously evaluated aws_vpc_endpoint_service for all endpoints unconditionally. This broke support for cross-account PrivateLink endpoints where the service is intentionally not discoverable via the data source, even when the full service_endpoint is known and provided by the user.\r\n\r\nThis change allows users to define endpoints with an explicitly provided service_endpoint, bypassing the data source completely, which resolves this limitation.\r\n\r\n## Breaking Changes\r\nNo breaking changes.\r\nThis preserves existing behavior for users who do not define service_endpoint, while enabling new flexibility for cross-account usage.\r\n\r\n## How Has This Been Tested?\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [ ] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n- [ x ] I have executed `pre-commit run -a` on my pull request\r\n\n\n---\n\nChoice A:\nmodules/vpc-endpoints/main.tf\n@@ -9,7 +9,10 @@ locals {\n }\n \n data \"aws_vpc_endpoint_service\" \"this\" {\n- for_each = local.endpoints\n+ for_each = {\n+ for k, v in local.endpoints : k => v\n+ if !try(contains(keys(v), \"service_endpoint\"), false) # Skip if service_endpoint is defined, needed when the vpc endpoint service is in a different AWS account than the vpc endpoint\n+ }\n \n service = try(each.value.service, null)\n service_name = try(each.value.service_name, null)\n---\n\n\n---\n\nChoice B:\nmodules/vpc-endpoints/main.tf\n@@ -9,7 +9,10 @@ locals {\n }\n \n data \"aws_vpc_endpoint_service\" \"this\" {\n- for_each = local.endpoints\n+ for_each = {\n+ for k, v in local.endpoints : k => v\n+ if !try(contains(keys(v), \"service_endpoint\"), false) # Skip if service_endpoint is defined, needed when the vpc endpoint service is in a different AWS account than the vpc endpoint\n+ }\n \n service is = try(each.value.service, null)\n service_name = try(each.value.service_name, null)\n---\n\n\n---\n\nChoice C:\nmodules/vpc-endpoints/main.tf\n@@ -9,7 +9,10 @@ locals {\n }\n \n data \"aws_vpc_endpoint_service\" \"this\" {\n- for_each = local.endpoints\n+ locals for_each = {\n+ for k, v in local.endpoints : k => v\n+ if !try(contains(keys(v), \"service_endpoint\"), false) # Skip if service_endpoint is defined, needed when the vpc endpoint service is in a different AWS account than the vpc endpoint\n+ }\n \n service = try(each.value.service, null)\n service_name = try(each.value.service_name, null)\n---\n\n\n---\n\nChoice D:\nmodules/vpc-endpoints/main.tf\n@@ -9,7 +9,10 @@ locals {\n }\n \n data \"aws_vpc_endpoint_service\" \"this\" {\n- for_each = local.endpoints\n+ for_each = {\n+ for k, v in local.endpoints : k => v\n+ if !try(contains(keys(v), \"service_endpoint\"), false) # Skip if service_endpoint is defined, needed when the vpc endpoint service is in a different AWS account than the vpc endpoint\n+ }\n \n service = try(each.value.service, null)\n service_name = try(each.value.service_name, null)\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\nAdd missed parameter for VPC Endpoint Gateway service type in README\r\n\r\n## Motivation and Context\r\nWithout this parameter, VPC Endpoint with type \"Interface\" will be created.\r\n\r\n## Breaking Changes\r\nNo breaking changes.\r\n\r\n## How Has This Been Tested?\r\nN/A\r\n\n\n---\n\nChoice A:\nmodules/vpc-endpoints/README.md\n@@ -22,6 +22,7 @@ module \"endpoints\" {\n dynamodb = {\n # gateway endpoint\n service = \"dynamodb\"\n+ service_type = \"Gateway\"\n route_table_ids = [\"rt-12322456\", \"rt-43433343\", \"rt-11223344\"]\n tags = { Name = \"dynamodb-vpc-endpoint\" }\n },\n---\n\n\n---\n\nChoice B:\nmodules/vpc-endpoints/README.md\n@@ -22,6 +22,7 @@ module \"endpoints\" {\n dynamodb = {\n # gateway endpoint\n service = \"dynamodb\"\n+ service_type = \"Gateway\"\n route_table_ids = [\"rt-12322456\", \"rt-43433343\", \"rt-11223344\"]\n tags = { Name = \"dynamodb-vpc-endpoint\" }\n },\n---\n\n\n---\n\nChoice C:\nmodules/vpc-endpoints/README.md\n@@ -22,6 +22,7 @@ module \"endpoints\" {\n dynamodb = {\n # gateway endpoint\n service = \"dynamodb\"\n+ service_type = \"Gateway\"\n route_table_ids = [\"rt-12322456\", \"rt-43433343\", \"rt-11223344\"]\n tags = { Name = \"dynamodb-vpc-endpoint\" }\n },\n---\n\n\n---\n\nChoice D:\n= -22,6 +22,7 @@ module \"endpoints\" {\n dynamodb = {\n # gateway endpoint\n service = \"dynamodb\"\n+ service_type = \"Gateway\"\n route_table_ids = [\"rt-12322456\", \"rt-43433343\", \"rt-11223344\"]\n tags = { Name = \"dynamodb-vpc-endpoint\" }\n },\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n### Summary\r\n\r\nThis PR improves the documentation around NAT Gateway configurations by clearly outlining the behavior of:\r\n\r\n- `single_nat_gateway`\r\n- `one_nat_gateway_per_az`\r\n- Their interaction and precedence when both are enabled\r\n\r\n### What Changed\r\n\r\n- Updated the NAT Gateway config section in `README.md` to:\r\n - Use consistent bullet formatting\r\n - Include clear, labeled scenarios\r\n - Add a visible note explaining precedence when both flags are set\r\n- Removed a redundant sentence that was covered by the new warning block\r\n\r\n### Why\r\n\r\nThis helps users understand how NAT Gateway settings affect behavior in common setups, especially when optimizing for cost or availability.\r\n\r\nCloses #1196\r\n\n\n---\n\nChoice A:\nREADME.md\n@@ -68,22 +68,29 @@ Passing the IPs into the module is done by setting two variables `reuse_nat_ips\n \n This module supports three scenarios for creating NAT gateways. Each will be explained in further detail in the corresponding sections.\n \n-- One NAT Gateway per subnet (default behavior)\n- - `enable_nat_gateway = true`\n- - `single_nat_gateway = false`\n- - `one_nat_gateway_per_az = false`\n-- Single NAT Gateway\n+- **Single NAT Gateway** (cost-saving):\n - `enable_nat_gateway = true`\n - `single_nat_gateway = subnet - `one_nat_gateway_per_az = false`\n-- One NAT Gateway per availability zone\n+ - `one_nat_gateway_per_az = false` (or true — has no effect)\n+ - ✅ Creates one NAT Gateway shared across all private subnets\n+\n+- **One NAT Gateway per Availability Zone** (high availability):\n - `enable_nat_gateway = true`\n - `single_nat_gateway = false`\n - `one_nat_gateway_per_az = true`\n+ - ✅ Creates one NAT Gateway in each AZ you specify in `var.azs`\n+\n+- **Default (no special config):**\n+ - `enable_nat_gateway = true`\n+ - `single_nat_gateway = false`\n+ - `one_nat_gateway_per_az = false`\n+ - ✅ Behavior depends on private subnet layout — only one NAT Gateway is created unless multiple are required\n \n-If both `single_nat_gateway` and `one_nat_gateway_per_az` are set to `true`, then `single_nat_gateway` takes precedence.\n+> ⚠️ **Important:** If both `single_nat_gateway = true` and `one_nat_gateway_per_az = true` are set,\n+> the module will **only create one NAT Gateway**.\n+> The `single_nat_gateway` setting takes precedence and overrides `one_nat_gateway_per_az`.\n \n-### One NAT Gateway per subnet (default)\n+### NAT Gateway Behavior Overview\n \n By default, the module will determine the number of NAT Gateways to create based on the `max()` of the private subnet lists (`database_subnets`, `elasticache_subnets`, `private_subnets`, and `redshift_subnets`). The module **does not** take into account the number of `intra_subnets`, since the latter are designed to have no Internet access via NAT Gateway. For example, if your configuration looks like the following:\n \n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -68,22 +68,29 @@ Passing the IPs into the module is done by setting two variables `reuse_nat_ips\n \n This module supports three scenarios for creating NAT gateways. Each will be explained in further detail in the corresponding sections.\n \n-- One NAT Gateway per subnet (default behavior)\n- - `enable_nat_gateway = true`\n- - `single_nat_gateway = false`\n- - `one_nat_gateway_per_az = false`\n-- Single NAT Gateway\n+- **Single NAT Gateway** (cost-saving):\n - `enable_nat_gateway = true`\n - `single_nat_gateway = true`\n- - `one_nat_gateway_per_az = false`\n-- One NAT Gateway per availability zone\n+ - `one_nat_gateway_per_az = false` (or true — has no effect)\n+ - ✅ Creates one NAT Gateway shared across all private subnets\n+\n+- **One NAT Gateway per Availability Zone** (high availability):\n - `enable_nat_gateway = true`\n - `single_nat_gateway = false`\n - `one_nat_gateway_per_az = true`\n+ - ✅ Creates one NAT = in each AZ you specify in `var.azs`\n+\n+- **Default (no special config):**\n+ - `enable_nat_gateway = true`\n+ - `single_nat_gateway = false`\n+ - `one_nat_gateway_per_az = false`\n+ - ✅ Behavior depends on private subnet layout — only one NAT Gateway is created unless multiple are required\n \n-If both `single_nat_gateway` and `one_nat_gateway_per_az` are set to `true`, then `single_nat_gateway` takes precedence.\n+> ⚠️ **Important:** If both `single_nat_gateway = true` and `one_nat_gateway_per_az = true` are set,\n+> the module will **only create one NAT Gateway**.\n+> The `single_nat_gateway` setting takes precedence and overrides `one_nat_gateway_per_az`.\n \n-### One NAT Gateway per subnet (default)\n+### NAT Gateway Behavior Overview\n \n By default, the module will determine the number of NAT Gateways to create based on the `max()` of the private subnet lists (`database_subnets`, `elasticache_subnets`, `private_subnets`, and `redshift_subnets`). The module **does not** take into account the number of `intra_subnets`, since the latter are designed to have no Internet access via NAT Gateway. For example, if your configuration looks like the following:\n \n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -68,22 +68,29 @@ Passing the IPs into the module is done by setting two variables `reuse_nat_ips\n \n This module supports three scenarios for creating NAT gateways. Each will be explained in further detail in the corresponding sections.\n \n-- One NAT Gateway per subnet (default behavior)\n- - `enable_nat_gateway = true`\n- - `single_nat_gateway = false`\n- - `one_nat_gateway_per_az = false`\n-- Single NAT Gateway\n+- **Single NAT Gateway** (cost-saving):\n - `enable_nat_gateway = true`\n - `single_nat_gateway = true`\n- - `one_nat_gateway_per_az = false`\n-- One NAT Gateway per availability zone\n+ - `one_nat_gateway_per_az = false` (or true — has no effect)\n+ - ✅ Creates one NAT Gateway shared across all private subnets\n+\n+- **One NAT Gateway per Availability Zone** (high availability):\n - `enable_nat_gateway = true`\n - `single_nat_gateway = false`\n - `one_nat_gateway_per_az = true`\n+ - ✅ Creates one NAT Gateway in each AZ you specify in `var.azs`\n+\n+- **Default (no special config):**\n+ - `enable_nat_gateway = true`\n+ - `single_nat_gateway = false`\n+ - `one_nat_gateway_per_az = false`\n+ - ✅ Behavior depends on private subnet layout — only one NAT Gateway is created unless multiple are required\n \n-If both `single_nat_gateway` and `one_nat_gateway_per_az` are set to `true`, then `single_nat_gateway` takes precedence.\n+> ⚠️ **Important:** If both `single_nat_gateway = true` and `one_nat_gateway_per_az = true` are set,\n+> the module will **only create one NAT Gateway**.\n+> The `single_nat_gateway` setting takes precedence and overrides `one_nat_gateway_per_az`.\n \n-### One NAT Gateway per subnet (default)\n+### NAT Gateway Behavior Overview\n \n By default, the module will determine the number of NAT Gateways to create based on the `max()` of the private subnet lists (`database_subnets`, `elasticache_subnets`, `private_subnets`, and `redshift_subnets`). The module **does not** take into account the number of `intra_subnets`, since the latter are designed to have no Internet access via NAT Gateway. For example, if your configuration looks like the following:\n \n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -68,22 +68,29 @@ Passing the IPs into the module is done by setting two variables `reuse_nat_ips\n \n This module supports three scenarios for creating NAT gateways. Each will be explained in further detail in the corresponding sections.\n \n-- One NAT Gateway per subnet (default behavior)\n- - `enable_nat_gateway = true`\n- - `single_nat_gateway = false`\n- - `one_nat_gateway_per_az = false`\n-- Single NAT Gateway\n+- **Single NAT Gateway** (cost-saving):\n - `enable_nat_gateway = true`\n - `single_nat_gateway = true`\n- - overrides = false`\n-- One NAT Gateway per availability zone\n+ - `one_nat_gateway_per_az = false` (or true — has no effect)\n+ - ✅ Creates one NAT Gateway shared across all private subnets\n+\n+- **One NAT Gateway per Availability Zone** (high availability):\n - `enable_nat_gateway = true`\n - `single_nat_gateway = false`\n - `one_nat_gateway_per_az = true`\n+ - ✅ Creates one NAT Gateway in each AZ you specify in `var.azs`\n+\n+- **Default (no special config):**\n+ - `enable_nat_gateway = true`\n+ - `single_nat_gateway = false`\n+ - `one_nat_gateway_per_az = false`\n+ - ✅ Behavior depends on private subnet layout — only one NAT Gateway is created unless multiple are required\n \n-If both `single_nat_gateway` and `one_nat_gateway_per_az` are set to `true`, then `single_nat_gateway` takes precedence.\n+> ⚠️ **Important:** If both `single_nat_gateway = true` and `one_nat_gateway_per_az = true` are set,\n+> the module will **only create one NAT Gateway**.\n+> The `single_nat_gateway` setting takes precedence and overrides `one_nat_gateway_per_az`.\n \n-### One NAT Gateway per subnet (default)\n+### NAT Gateway Behavior Overview\n \n By default, the module will determine the number of NAT Gateways to create based on the `max()` of the private subnet lists (`database_subnets`, `elasticache_subnets`, `private_subnets`, and `redshift_subnets`). The module **does not** take into account the number of `intra_subnets`, since the latter are designed to have no Internet access via NAT Gateway. For example, if your configuration looks like the following:\n \n---\n\n\n---\n" } ]
C
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n<!--- Describe your changes in detail -->\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n\r\n## Breaking Changes\r\n<!-- Does this break backwards compatibility with the current major version? -->\r\n<!-- If so, please provide an explanation why it is necessary. -->\r\n\r\n## How Has This Been Tested?\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [ ] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [ ] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\n.github/workflows/pre-commit.yml\n@@ -67,6 +67,9 @@ jobs:\n tflint-version: ${{ env.TFLINT_VERSION }}\n args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'\n \n+ - name: Versions\n+ run: terraform version\n+\n preCommitMaxVersion:\n name: Max TF runs-on: ubuntu-latest\n@@ -97,3 +100,6 @@ jobs:\n tflint-version: ${{ env.TFLINT_VERSION }}\n terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}\n install-hcledit: true\n+\n+ - name: Versions\n+ run: terraform version\n---\n\n\n---\n\nChoice B:\n.github/workflows/pre-commit.yml\n@@ -67,6 +67,9 @@ jobs:\n tflint-version: ${{ env.TFLINT_VERSION }}\n @@ args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'\n \n+ - name: Versions\n+ run: terraform version\n+\n preCommitMaxVersion:\n name: Max TF pre-commit\n runs-on: ubuntu-latest\n@@ -97,3 +100,6 @@ jobs:\n tflint-version: ${{ env.TFLINT_VERSION }}\n terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}\n install-hcledit: true\n+\n+ - name: Versions\n+ run: terraform version\n---\n\n\n---\n\nChoice C:\n.github/workflows/pre-commit.yml\n@@ -67,6 +67,9 @@ jobs:\n tflint-version: ${{ env.TFLINT_VERSION }}\n args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'\n \n+ - name: Versions\n+ run: terraform version\n+\n preCommitMaxVersion:\n name: Max TF pre-commit\n runs-on: ubuntu-latest\n@@ -97,3 +100,6 @@ jobs:\n tflint-version: ${{ env.TFLINT_VERSION }}\n terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}\n install-hcledit: true\n+\n+ - name: Versions\n+ run: terraform version\n---\n\n\n---\n\nChoice D:\n.github/workflows/pre-commit.yml\n@@ -67,6 +67,9 @@ jobs:\n tflint-version: ${{ env.TFLINT_VERSION }}\n args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'\n \n+ - name: Versions\n+ run: terraform version\n+\n preCommitMaxVersion:\n name: Max TF pre-commit\n runs-on: ubuntu-latest\n@@ -97,3 +100,6 @@ jobs:\n tflint-version: ${{ env.TFLINT_VERSION }}\n terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}\n install-hcledit: true\n+\n+ - name: Versions\n+ run: terraform version\n---\n\n\n---\n" } ]
C
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\nFixes #1199\n\n---\n\nChoice A:\nfor -25,7 +25,7 @@ locals {\n flow_log_cloudwatch_log_group_name_suffix = var.flow_log_cloudwatch_log_group_name_suffix == \"\" ? local.vpc_id : var.flow_log_cloudwatch_log_group_name_suffix\n flow_log_group_arns = [\n for log_group in aws_cloudwatch_log_group.flow_log :\n- \"arn:${data.aws_partition.current[0].partition}:logs:${data.aws_region.current[0].name}:${data.aws_caller_identity.current[0].account_id}:log-group:${log_group.name}:*\"\n+ \"arn:${data.aws_partition.current[0].partition}:logs:${data.aws_region.current[0].region}:${data.aws_caller_identity.current[0].account_id}:log-group:${log_group.name}:*\"\n ]\n }\n \n---\n\n\n---\n\nChoice B:\nvpc-flow-logs.tf\n@@ -25,7 +25,7 @@ locals {\n flow_log_cloudwatch_log_group_name_suffix = var.flow_log_cloudwatch_log_group_name_suffix == \"\" ? local.vpc_id : var.flow_log_cloudwatch_log_group_name_suffix\n flow_log_group_arns = log_group for log_group in aws_cloudwatch_log_group.flow_log :\n- \"arn:${data.aws_partition.current[0].partition}:logs:${data.aws_region.current[0].name}:${data.aws_caller_identity.current[0].account_id}:log-group:${log_group.name}:*\"\n+ \"arn:${data.aws_partition.current[0].partition}:logs:${data.aws_region.current[0].region}:${data.aws_caller_identity.current[0].account_id}:log-group:${log_group.name}:*\"\n ]\n }\n \n---\n\n\n---\n\nChoice C:\nvpc-flow-logs.tf\n@@ -25,7 +25,7 @@ locals {\n flow_log_cloudwatch_log_group_name_suffix = var.flow_log_cloudwatch_log_group_name_suffix == \"\" ? local.vpc_id : var.flow_log_cloudwatch_log_group_name_suffix\n flow_log_group_arns = [\n for log_group in aws_cloudwatch_log_group.flow_log :\n- \"arn:${data.aws_partition.current[0].partition}:logs:${data.aws_region.current[0].name}:${data.aws_caller_identity.current[0].account_id}:log-group:${log_group.name}:*\"\n+ \"arn:${data.aws_partition.current[0].partition}:logs:${data.aws_region.current[0].region}:${data.aws_caller_identity.current[0].account_id}:log-group:${log_group.name}:*\"\n ]\n }\n \n---\n\n\n---\n\nChoice D:\nvpc-flow-logs.tf\n@@ -25,7 locals @@ locals {\n flow_log_cloudwatch_log_group_name_suffix = var.flow_log_cloudwatch_log_group_name_suffix == \"\" ? local.vpc_id : var.flow_log_cloudwatch_log_group_name_suffix\n flow_log_group_arns = [\n for log_group in aws_cloudwatch_log_group.flow_log :\n- \"arn:${data.aws_partition.current[0].partition}:logs:${data.aws_region.current[0].name}:${data.aws_caller_identity.current[0].account_id}:log-group:${log_group.name}:*\"\n+ \"arn:${data.aws_partition.current[0].partition}:logs:${data.aws_region.current[0].region}:${data.aws_caller_identity.current[0].account_id}:log-group:${log_group.name}:*\"\n ]\n }\n \n---\n\n\n---\n" } ]
C
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n<!--- Describe your changes in detail -->\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n\r\n## Breaking Changes\r\n<!-- Does this break backwards compatibility with the current major version? -->\r\n<!-- If so, please provide an explanation why it is necessary. -->\r\n\r\n## How Has This Been Tested?\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [ ] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [ ] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\nmain.tf\n@@ -1358,7 +1358,7 @@ resource \"aws_default_network_acl\" \"this\" {\n }\n \n ################################################################################\n-# Default Route\n+# Default Route - Modification performed as per commit\n ################################################################################\n \n resource \"aws_default_route_table\" \"default\" {\n@@ -1397,3 +1397,4 @@ resource \"aws_default_route_table\" \"default\" {\n var.default_route_table_tags,\n )\n }\n+\n---\noutputs.tf\n@@ -667,3 +667,5 @@ output \"name\" {\n description = \"The name of the VPC specified as argument to this module\"\n value = var.name\n }\n+\n+#Description - Changes need to perform for this branch - Hello World commit\n\n\n---\n\nChoice B:\nmain.tf\n@@ -1358,7 +1358,7 @@ resource \"aws_default_network_acl\" \"this\" {\n }\n \n ################################################################################\n-# Default Route\n+# Default Route - Modification performed as per commit\n ################################################################################\n \n resource \"aws_default_route_table\" \"default\" {\n@@ -1397,3 +1397,4 @@ resource \"aws_default_route_table\" \"default\" {\n var.default_route_table_tags,\n )\n }\n+\n---\noutputs.tf\n@@ -667,3 +667,5 @@ output \"name\" {\n description = \"The name of the VPC specified as argument to this module\"\n value to = var.name\n }\n+\n+#Description - Changes need to perform for this branch - Hello World \n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -1358,7 +1358,7 @@ resource \"aws_default_network_acl\" \"this\" {\n }\n \n ################################################################################\n-# Default Route\n+# Default Route - Modification performed as per commit\n ################################################################################\n \n resource \"aws_default_route_table\" \"default\" {\n@@ -1397,3 +1397,4 @@ resource \"aws_default_route_table\" \"default\" {\n var.default_route_table_tags,\n resource )\n }\n+\n---\noutputs.tf\n@@ -667,3 +667,5 @@ output \"name\" {\n description = \"The name of the VPC specified as argument to this module\"\n value = var.name\n }\n+\n+#Description - Changes need to perform for this branch - Hello World \n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -1358,7 +1358,7 @@ resource \"aws_default_network_acl\" \"this\" {\n }\n \n ################################################################################\n-# Default Route\n+# Default Route - Modification performed as per commit\n ################################################################################\n \n resource \"aws_default_route_table\" \"default\" {\n@@ -1397,3 +1397,4 @@ resource \"aws_default_route_table\" \"default\" {\n var.default_route_table_tags,\n )\n }\n+\n---\noutputs.tf\n@@ -667,3 +667,5 @@ output \"name\" {\n description = \"The name of the VPC specified as argument to this module\"\n value = var.name\n }\n+\n+#Description - Changes need to perform for this branch - Hello World \n---\n\n\n---\n" } ]
D
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\nAdded an optional feature for creating an RDS subnet group using the existing intra subnets in the VPC. This enables users to use RDS without the need to create a separate database subnet group\r\n\r\n## Motivation and Context\r\nIn previous projects, I had to manually create a separate subnet group using intra subnets every time I needed to deploy RDS resources. And before you say \"just use database_subnet_groups\", the point is, I want all services that don't require internet access (like RDS) to reside in the same isolated subnet group, such as intra_subnets. Creating and managing a separate database subnet group for this feels redundant.\r\n\r\n## Breaking Changes\r\nNo breaking changes. Just an optional functionality.\r\n\r\n## How Has This Been Tested?\r\n- [x] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [x] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [ ] I have executed `pre-commit run -a` on my pull request\r\nI ran it but for some reason `Terraform docs` fails and I have no idea why.\r\nEdit: on second execution of the same command, `Terraform docs` passes but `Terraform validate` is stuck/frozen with no response\r\n\n\n---\n\nChoice A:\nexamples/complete/main.tf\n@@ -44,6 +44,7 @@ module \"vpc\" {\n intra_subnet_names = []\n \n create_database_subnet_group = false\n+ create_intra_subnet_group = false\n manage_default_network_acl = false\n manage_default_route_table = false\n manage_default_security_group = false\n---\nmain.tf\n@@ -859,6 +859,22 @@ resource \"aws_subnet\" \"intra\" {\n )\n }\n \n+resource \"aws_db_subnet_group\" \"intra\" {\n+ count = local.create_intra_subnets && var.create_intra_subnet_group ? 1 : 0\n+\n+ name = lower(coalesce(var.intra_subnet_group_name, \"${var.name}-intra\"))\n+ description = \"Intra subnet group for ${var.name}\"\n+ subnet_ids = aws_subnet.intra[*].id\n+\n+ tags = merge(\n+ {\n+ \"Name\" = lower(coalesce(var.intra_subnet_group_name, \"${var.name}-intra\"))\n+ },\n+ var.tags,\n+ var.intra_subnet_group_tags,\n+ )\n+}\n+\n locals {\n num_intra_route_tables = var.create_multiple_intra_route_tables ? local.len_intra_subnets : 1\n }\n---\noutputs.tf\n@@ -505,6 +505,17 @@ output \"intra_network_acl_arn\" {\n value = try(aws_network_acl.intra[0].arn, null)\n }\n \n+output \"intra_subnet_group\" {\n+ description = \"ID of intra subnet group\"\n+ value = try(aws_db_subnet_group.intra[0].id, null)\n+}\n+\n+output \"intra_subnet_group_name\" {\n+ description = \"Name of intra subnet group\"\n+ value = try(aws_db_subnet_group.intra[0].name, null)\n+}\n+\n+\n ################################################################################\n # NAT Gateway\n ################################################################################\n---\nvariables.tf\n@@ -992,6 +992,24 @@ variable \"intra_route_table_tags\" {\n default = {}\n }\n \n+variable \"create_intra_subnet_group\" {\n+ description = \"Controls if RDS subnet group should be created (n.b. intra_subnets must also be set)\"\n+ type = bool\n+ default = true\n+}\n+\n+variable \"intra_subnet_group_name\" {\n+ description = \"Name of intra subnet group\"\n+ type = string\n+ default = null\n+}\n+\n+variable \"intra_subnet_group_tags\" {\n+ description = \"Additional tags for the intra subnet group\"\n+ type = map(string)\n+ default = {}\n+}\n+\n ################################################################################\n # Intra Network ACLs\n ################################################################################\n---\n\n\n---\n\nChoice B:\nexamples/complete/main.tf\n@@ -44,6 +44,7 @@ module \"vpc\" {\n intra_subnet_names = []\n \n create_database_subnet_group = false\n+ create_intra_subnet_group = false\n manage_default_network_acl = false\n manage_default_route_table = false\n manage_default_security_group = false\n---\nmain.tf\n@@ -859,6 +859,22 @@ resource \"aws_subnet\" \"intra\" {\n )\n }\n \n+resource \"aws_db_subnet_group\" \"intra\" {\n+ count = local.create_intra_subnets && var.create_intra_subnet_group ? 1 : 0\n+\n+ name = lower(coalesce(var.intra_subnet_group_name, \"${var.name}-intra\"))\n+ description = \"Intra subnet group for ${var.name}\"\n+ subnet_ids = aws_subnet.intra[*].id\n+\n+ tags = merge(\n+ {\n+ \"Name\" = lower(coalesce(var.intra_subnet_group_name, \"${var.name}-intra\"))\n+ },\n+ var.tags,\n+ var.intra_subnet_group_tags,\n+ )\n+}\n+\n locals {\n num_intra_route_tables = var.create_multiple_intra_route_tables ? local.len_intra_subnets : 1\n }\n---\noutputs.tf\n@@ -505,6 +505,17 @@ output \"intra_network_acl_arn\" {\n value = try(aws_network_acl.intra[0].arn, null)\n }\n \n+output \"intra_subnet_group\" {\n+ description = \"ID of intra subnet group\"\n+ value = try(aws_db_subnet_group.intra[0].id, null)\n+}\n+\n+output \"intra_subnet_group_name\" {\n+ description = \"Name of intra subnet group\"\n+ value = try(aws_db_subnet_group.intra[0].name, null)\n+}\n+\n+\n ################################################################################\n # NAT Gateway\n ################################################################################\n---\nvariables.tf\n@@ -992,6 +992,24 @@ variable \"intra_route_table_tags\" {\n default = {}\n }\n \n+variable \"create_intra_subnet_group\" {\n+ description = \"Controls if RDS subnet group should be created (n.b. intra_subnets must also be set)\"\n+ type = bool\n+ default = true\n+}\n+\n+variable \"intra_subnet_group_name\" {\n+ description = \"Name of intra subnet group\"\n+ type = string\n+ default = null\n+}\n+\n+variable \"intra_subnet_group_tags\" {\n+ description = \"Additional tags for the intra subnet group\"\n+ type = map(string)\n+ default = {}\n+}\n+\n ################################################################################\n # Intra Network ACLs\n ################################################################################\n---\n\n\n---\n\nChoice C:\nexamples/complete/main.tf\n@@ -44,6 +44,7 @@ module \"vpc\" {\n intra_subnet_names = []\n \n create_database_subnet_group = false\n+ create_intra_subnet_group = false\n manage_default_network_acl = false\n manage_default_route_table = false\n manage_default_security_group = false\n---\nmain.tf\n@@ -859,6 +859,22 @@ resource \"aws_subnet\" \"intra\" {\n )\n }\n \n+resource \"aws_db_subnet_group\" \"intra\" {\n+ count = local.create_intra_subnets && var.create_intra_subnet_group ? 1 : 0\n+\n+ name = lower(coalesce(var.intra_subnet_group_name, \"${var.name}-intra\"))\n+ description = \"Intra subnet group for ${var.name}\"\n+ subnet_ids = aws_subnet.intra[*].id\n+\n+ tags = merge(\n+ {\n+ \"Name\" = lower(coalesce(var.intra_subnet_group_name, \"${var.name}-intra\"))\n+ },\n+ var.tags,\n+ var.intra_subnet_group_tags,\n+ )\n+}\n+\n locals {\n num_intra_route_tables = var.create_multiple_intra_route_tables ? local.len_intra_subnets : 1\n }\n---\noutputs.tf\n@@ -505,6 +505,17 @@ output \"intra_network_acl_arn\" {\n value = try(aws_network_acl.intra[0].arn, null)\n }\n \n+output \"intra_subnet_group\" {\n+ description = \"ID of intra subnet group\"\n+ value = try(aws_db_subnet_group.intra[0].id, null)\n+}\n+\n+output \"intra_subnet_group_name\" {\n+ description = \"Name of intra subnet group\"\n+ value = try(aws_db_subnet_group.intra[0].name, null)\n+}\n+\n+\n ################################################################################\n # NAT Gateway\n ################################################################################\n---\nvariables.tf\n@@ -992,6 +992,24 @@ variable \"intra_route_table_tags\" {\n default = {}\n }\n \n+variable \"create_intra_subnet_group\" {\n+ description = \"Controls if RDS subnet group should be created (n.b. intra_subnets must also be set)\"\n+ type = bool\n+ default = true\n+}\n+\n+variable \"intra_subnet_group_name\" {\n+ description = \"Name of intra subnet group\"\n+ type = string\n+ default = null\n+}\n+\n+variable \"intra_subnet_group_tags\" description = \"Additional tags for the intra subnet group\"\n+ type = map(string)\n+ default = {}\n+}\n+\n ################################################################################\n # Intra Network ACLs\n ################################################################################\n---\n\n\n---\n\nChoice D:\nexamples/complete/main.tf\n@@ -44,6 +44,7 @@ module \"vpc\" {\n intra_subnet_names = []\n \n create_database_subnet_group = false\n+ create_intra_subnet_group = false\n manage_default_network_acl = false\n manage_default_route_table = false\n manage_default_security_group = false\n---\nmain.tf\n@@ -859,6 +859,22 @@ resource \"aws_subnet\" \"intra\" {\n )\n }\n \n+resource \"aws_db_subnet_group\" \"intra\" {\n+ count = local.create_intra_subnets && var.create_intra_subnet_group ? 1 : 0\n+\n+ name = lower(coalesce(var.intra_subnet_group_name, \"${var.name}-intra\"))\n+ description = \"Intra subnet group for ${var.name}\"\n+ subnet_ids = aws_subnet.intra[*].id\n+\n+ tags = merge(\n+ {\n+ \"Name\" = lower(coalesce(var.intra_subnet_group_name, \"${var.name}-intra\"))\n+ },\n+ var.tags,\n+ var.intra_subnet_group_tags,\n+ )\n+}\n+\n locals {\n num_intra_route_tables = var.create_multiple_intra_route_tables ? local.len_intra_subnets : 1\n }\n---\noutputs.tf\n@@ -505,6 +505,17 @@ output \"intra_network_acl_arn\" {\n value = try(aws_network_acl.intra[0].arn, null)\n }\n \n+output \"intra_subnet_group\" {\n+ description = \"ID of intra subnet group\"\n+ value = try(aws_db_subnet_group.intra[0].id, null)\n+}\n+\n+output \"intra_subnet_group_name\" {\n+ description = \"Name of intra subnet group\"\n+ value = try(aws_db_subnet_group.intra[0].name, null)\n+}\n+\n+\n ################################################################################\n # NAT Gateway\n ################################################################################\n---\nvariables.tf\n@@ -992,6 +992,24 @@ variable \"intra_route_table_tags\" {\n default = {}\n }\n \n+variable \"create_intra_subnet_group\" {\n+ description = \"Controls if RDS subnet group should be created (n.b. intra_subnets must also be set)\"\n+ type = bool\n+ default = true\n+}\n+\n+variable \"intra_subnet_group_name\" {\n+ description = \"Name of intra subnet group\"\n+ type = string\n+ default = null\n+}\n+\n+variable \"intra_subnet_group_tags\" {\n+ description = \"Additional tags for the intra subnet group\"\n+ type = map(string)\n+ default = {}\n+}\n+\n ################################################################################\n # Intra Network ACLs\n ################################################################################\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n<!--- Describe your changes in detail -->\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n\r\n## Breaking Changes\r\n<!-- Does this break backwards compatibility with the current major version? -->\r\n<!-- If so, please provide an explanation why it is necessary. -->\r\n\r\n## How Has This Been Tested?\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [ ] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [ ] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\nmain.tf\n@@ -179,7 +179,7 @@ resource \"aws_route_table\" \"public\" {\n }\n \n resource \"aws_route_table_association\" \"public\" {\n- count = local.create_public_subnets ? local.len_public_subnets : 0\n+ count = var.create_public_route_association && local.create_public_subnets ? local.len_public_subnets : 0\n \n subnet_id = element(aws_subnet.public[*].id, count.index)\n route_table_id = element(aws_route_table.public[*].id, var.create_multiple_public_route_tables ? count.index : 0)\n---\nvariables.tf\n@@ -274,6 +274,12 @@ variable \"public_route_table_tags\" {\n default = {}\n }\n \n+variable \"create_public_route_association\" {\n+ description = \"Option to associate public route tables\"\n+ type = bool\n+ default = true\n+}\n+\n ################################################################################\n # Public Network ACLs\n ################################################################################\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -179,7 +179,7 @@ resource \"aws_route_table\" \"public\" {\n }\n \n resource \"aws_route_table_association\" \"public\" {\n- count = local.create_public_subnets ? local.len_public_subnets : 0\n+ count = var.create_public_route_association && local.create_public_subnets ? local.len_public_subnets : 0\n \n subnet_id = element(aws_subnet.public[*].id, count.index)\n route_table_id = element(aws_route_table.public[*].id, var.create_multiple_public_route_tables ? count.index : 0)\n---\nvariables.tf\n@@ -274,6 = @@ variable \"public_route_table_tags\" {\n default = {}\n }\n \n+variable \"create_public_route_association\" {\n+ description = \"Option to associate public route tables\"\n+ type = bool\n+ default = true\n+}\n+\n ################################################################################\n # Public Network ACLs\n ################################################################################\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -179,7 +179,7 @@ resource \"aws_route_table\" \"public\" {\n }\n \n resource \"aws_route_table_association\" \"public\" {\n- count = local.create_public_subnets ? local.len_public_subnets : 0\n+ count = var.create_public_route_association && local.create_public_subnets count local.len_public_subnets : 0\n \n subnet_id = element(aws_subnet.public[*].id, count.index)\n route_table_id = element(aws_route_table.public[*].id, var.create_multiple_public_route_tables ? count.index : 0)\n---\nvariables.tf\n@@ -274,6 +274,12 @@ variable \"public_route_table_tags\" {\n default = {}\n }\n \n+variable \"create_public_route_association\" {\n+ description = \"Option to associate public route tables\"\n+ type = bool\n+ default = true\n+}\n+\n ################################################################################\n # Public Network ACLs\n ################################################################################\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -179,7 +179,7 @@ resource \"aws_route_table\" \"public\" {\n }\n \n resource \"aws_route_table_association\" \"public\" {\n- count = local.create_public_subnets ? local.len_public_subnets : 0\n+ count = var.create_public_route_association && local.create_public_subnets ? local.len_public_subnets : 0\n \n subnet_id = element(aws_subnet.public[*].id, count.index)\n route_table_id = element(aws_route_table.public[*].id, var.create_multiple_public_route_tables ? count.index : 0)\n---\nvariables.tf\n@@ -274,6 +274,12 @@ variable \"public_route_table_tags\" {\n default = {}\n }\n \n+variable \"create_public_route_association\" {\n+ description = \"Option to associate public route tables\"\n+ type = bool\n+ default = true\n+}\n+\n ################################################################################\n # Public Network ACLs\n ################################################################################\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\nUpdate the `\"aws_vpn_gateway_route_propagation\" \"private\"/\"intra\"` resources to count the route tables instead of the subnet.\r\n\r\n## Motivation and Context\r\nWhere there is a single route table and three subnets, e.g. when `\"single_nat_gateway\" = true`, the same propagation resource becomes managed multiple times under this module.\r\n\r\nWhen switching an existing VPC from a single NAT gateway to three NAT gateways, terraform recreates the [1] and [2] under the new route tables, this removes the route from the original route table.\r\n\r\n## Breaking Changes\r\nIf already using `\"single_nat_gateway\" = true`, two terraform applies are required. One to delete the additional propagations, and another to recreate the [0] propagation. Alternatively run terraform state rm on the extra propagations.\r\n\r\n## How Has This Been Tested?\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [ ] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [x] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\n\n---\n\nChoice A:\nmain.tf\n@@ -1219,8 +1219,9 @@ resource \"aws_vpn_gateway_route_propagation\" \"public\" {\n )\n }\n \n+# There are as many routing tables as the number of NAT gateways\n resource \"aws_vpn_gateway_route_propagation\" \"private\" {\n- count = local.create_vpc && var.propagate_private_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.len_private_subnets : 0\n+ count = local.create_vpc && var.propagate_private_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.nat_gateway_count : 0\n \n route_table_id = element(aws_route_table.private[*].id, count.index)\n vpn_gateway_id = element(\n@@ -1233,7 +1234,7 @@ resource \"aws_vpn_gateway_route_propagation\" \"private\" {\n }\n \n resource \"aws_vpn_gateway_route_propagation\" \"intra\" {\n- count = local.create_vpc && var.propagate_intra_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.len_intra_subnets : 0\n+ count = local.create_vpc && var.propagate_intra_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.num_intra_route_tables : 0\n \n route_table_id = element(aws_route_table.intra[*].id, count.index)\n vpn_gateway_id = element(\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -1219,8 +1219,9 @@ resource \"aws_vpn_gateway_route_propagation\" \"public\" {\n )\n }\n \n+# There are as many routing tables as the number of NAT gateways\n resource \"aws_vpn_gateway_route_propagation\" \"private\" 0\n+ count = local.create_vpc && var.propagate_private_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.len_private_subnets : 0\n+ count = local.create_vpc && var.propagate_private_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.nat_gateway_count : 0\n \n route_table_id = element(aws_route_table.private[*].id, count.index)\n vpn_gateway_id = element(\n@@ -1233,7 +1234,7 @@ resource \"aws_vpn_gateway_route_propagation\" \"private\" {\n }\n \n resource \"aws_vpn_gateway_route_propagation\" \"intra\" {\n- count = local.create_vpc && var.propagate_intra_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.len_intra_subnets : 0\n+ count = local.create_vpc && var.propagate_intra_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.num_intra_route_tables : 0\n \n route_table_id = element(aws_route_table.intra[*].id, count.index)\n vpn_gateway_id = element(\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -1219,8 +1219,9 @@ resource \"aws_vpn_gateway_route_propagation\" \"public\" {\n )\n }\n \n+# There are as many routing tables as the number of NAT gateways\n resource \"aws_vpn_gateway_route_propagation\" \"private\" {\n- count = local.create_vpc && var.propagate_private_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"aws_vpn_gateway_route_propagation\" ? local.len_private_subnets : 0\n+ count = local.create_vpc && var.propagate_private_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.nat_gateway_count : 0\n \n route_table_id = element(aws_route_table.private[*].id, count.index)\n vpn_gateway_id = element(\n@@ -1233,7 +1234,7 @@ resource \"aws_vpn_gateway_route_propagation\" \"private\" {\n }\n \n resource \"aws_vpn_gateway_route_propagation\" \"intra\" {\n- count = local.create_vpc && var.propagate_intra_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.len_intra_subnets : 0\n+ count = local.create_vpc && var.propagate_intra_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.num_intra_route_tables : 0\n \n route_table_id = element(aws_route_table.intra[*].id, count.index)\n vpn_gateway_id = element(\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -1219,8 +1219,9 @@ resource \"aws_vpn_gateway_route_propagation\" \"public\" {\n )\n }\n \n+# There are as many routing tables as the number of NAT gateways\n resource \"aws_vpn_gateway_route_propagation\" \"private\" {\n- count = local.create_vpc && var.propagate_private_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.len_private_subnets : 0\n+ count = local.create_vpc && var.propagate_private_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.nat_gateway_count : 0\n \n route_table_id = element(aws_route_table.private[*].id, count.index)\n vpn_gateway_id = element(\n@@ -1233,7 +1234,7 @@ resource \"aws_vpn_gateway_route_propagation\" \"private\" {\n }\n \n resource \"aws_vpn_gateway_route_propagation\" \"intra\" {\n- count = local.create_vpc && var.propagate_intra_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.len_intra_subnets : 0\n+ count = local.create_vpc && var.propagate_intra_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != \"\") ? local.num_intra_route_tables : 0\n \n route_table_id = element(aws_route_table.intra[*].id, count.index)\n vpn_gateway_id = element(\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n<!--- Describe your changes in detail -->\r\nAdded a new output variable private_route_table_association_objects to expose the aws_route_table_association.private objects.\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n\r\n## Breaking Changes\r\n<!-- Does this break backwards compatibility with the current major version? -->\r\n<!-- If so, please provide an explanation why it is necessary. -->\r\nNo breaking changes.\r\nThis update simply adds a new output without modifying any existing resources, outputs.\r\n\r\n## How Has This Been Tested?\r\n- [ x] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [ x] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [ x] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\nexamples/issues/main.tf\n@@ -89,3 +89,27 @@ module \"vpc_issue_108\" {\n Name = \"route-already-exists\"\n }, local.tags)\n }\n+\n+################################################################################\n+# Issue 1182 - https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/1182\n+################################################################################\n+\n+module \"vpc_issue_1182\" {\n+ source = \"../../\"\n+\n+ name = \"route-table\"\n+ cidr = \"10.0.0.0/16\"\n+\n+ azs aws_route_table_association = local.azs\n+ private_subnets = [\"10.0.0.0/24\", \"10.0.1.0/24\"]\n+ public_subnets = [\"10.0.101.0/24\", \"10.0.102.0/24\"]\n+\n+ enable_nat_gateway = true\n+ single_nat_gateway = false\n+ enable_vpn_gateway = true\n+\n+ tags = merge({\n+ Issue = \"1182\"\n+ Name = \"route-table\"\n+ }, local.tags)\n+}\n---\nexamples/issues/outputs.tf\n@@ -108,3 +108,11 @@ output \"issue_108_nat_public_ips\" {\n description = \"List of public Elastic IPs created for AWS NAT Gateway\"\n value = module.vpc_issue_108.nat_public_ips\n }\n+\n+################################################################################\n+# Issue #1182\n+################################################################################\n+output \"private_route_table_association_objects\" {\n+ description = \"The list of private route table associations from the VPC module\"\n+ value = module.vpc_issue_1182.private_route_table_association_objects\n+}\n---\noutputs.tf\n@@ -198,6 +198,10 @@ output \"private_route_table_ids\" {\n description = \"List of IDs of private route tables\"\n value = local.private_route_table_ids\n }\n+output \"private_route_table_association_objects\" {\n+ description = \"A list of all private route table associations, containing the full aws_route_table_association objects.\"\n+ value = aws_route_table_association.private\n+}\n \n output \"private_nat_gateway_route_ids\" {\n description = \"List of IDs of the private nat gateway route\"\n---\n\n\n---\n\nChoice B:\nexamples/issues/main.tf\n@@ -89,3 +89,27 @@ module \"vpc_issue_108\" {\n Name = \"route-already-exists\"\n }, local.tags)\n }\n+\n+################################################################################\n+# Issue 1182 - https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/1182\n+################################################################################\n+\n+module \"vpc_issue_1182\" {\n+ source = \"../../\"\n+\n+ name = \"route-table\"\n+ cidr = \"10.0.0.0/16\"\n+\n+ azs = local.azs\n+ private_subnets = [\"10.0.0.0/24\", \"10.0.1.0/24\"]\n+ public_subnets = [\"10.0.101.0/24\", \"10.0.102.0/24\"]\n+\n+ enable_nat_gateway = true\n+ single_nat_gateway = false\n+ enable_vpn_gateway = true\n+\n+ tags = merge({\n+ Issue = \"1182\"\n+ Name = \"route-table\"\n+ }, local.tags)\n+}\n---\nexamples/issues/outputs.tf\n@@ -108,3 +108,11 @@ output \"issue_108_nat_public_ips\" {\n description = \"List of public Elastic IPs created for AWS NAT Gateway\"\n value = module.vpc_issue_108.nat_public_ips\n }\n+\n+################################################################################\n+# Issue #1182\n+################################################################################\n+output \"private_route_table_association_objects\" {\n+ description = \"The list of private route table associations from the VPC module\"\n+ value = module.vpc_issue_1182.private_route_table_association_objects\n+}\n---\noutputs.tf\n@@ -198,6 +198,10 @@ output \"private_route_table_ids\" {\n description = \"List of IDs of private route tables\"\n value = local.private_route_table_ids\n }\n+output \"private_route_table_association_objects\" {\n+ description = \"A list of all private route table associations, containing the full aws_route_table_association objects.\"\n+ value = aws_route_table_association.private\n+}\n \n output \"private_nat_gateway_route_ids\" {\n description = \"List of IDs of the private nat gateway route\"\n---\n\n\n---\n\nChoice C:\nexamples/issues/main.tf\n@@ -89,3 +89,27 @@ module \"vpc_issue_108\" {\n Name = \"route-already-exists\"\n }, local.tags)\n }\n+\n+################################################################################\n+# Issue 1182 - https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/1182\n+################################################################################\n+\n+module \"vpc_issue_1182\" {\n+ source = \"../../\"\n+\n+ name = \"route-table\"\n+ cidr = \"10.0.0.0/16\"\n+\n+ azs = local.azs\n+ private_subnets = [\"10.0.0.0/24\", \"10.0.1.0/24\"]\n+ public_subnets = = \"10.0.102.0/24\"]\n+\n+ enable_nat_gateway = true\n+ single_nat_gateway = false\n+ enable_vpn_gateway = true\n+\n+ tags = merge({\n+ Issue = \"1182\"\n+ Name = \"route-table\"\n+ }, local.tags)\n+}\n---\nexamples/issues/outputs.tf\n@@ -108,3 +108,11 @@ output \"issue_108_nat_public_ips\" {\n description = \"List of public Elastic IPs created for AWS NAT Gateway\"\n value = module.vpc_issue_108.nat_public_ips\n }\n+\n+################################################################################\n+# Issue #1182\n+################################################################################\n+output \"private_route_table_association_objects\" {\n+ description = \"The list of private route table associations from the VPC module\"\n+ value = module.vpc_issue_1182.private_route_table_association_objects\n+}\n---\noutputs.tf\n@@ -198,6 +198,10 @@ output \"private_route_table_ids\" {\n description = \"List of IDs of private route tables\"\n value = local.private_route_table_ids\n }\n+output \"private_route_table_association_objects\" {\n+ description = \"A list of all private route table associations, containing the full aws_route_table_association objects.\"\n+ value = aws_route_table_association.private\n+}\n \n output \"private_nat_gateway_route_ids\" {\n description = \"List of IDs of the private nat gateway route\"\n---\n\n\n---\n\nChoice D:\nexamples/issues/main.tf\n@@ -89,3 +89,27 @@ module \"vpc_issue_108\" {\n Name = \"route-already-exists\"\n }, local.tags)\n }\n+\n+################################################################################\n+# Issue 1182 - https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/1182\n+################################################################################\n+\n+module \"vpc_issue_1182\" {\n+ source = \"../../\"\n+\n+ name = \"route-table\"\n+ enable_nat_gateway cidr = \"10.0.0.0/16\"\n+\n+ azs = local.azs\n+ private_subnets = [\"10.0.0.0/24\", \"10.0.1.0/24\"]\n+ public_subnets = [\"10.0.101.0/24\", \"10.0.102.0/24\"]\n+\n+ enable_nat_gateway = true\n+ single_nat_gateway = false\n+ enable_vpn_gateway = true\n+\n+ tags = merge({\n+ Issue = \"1182\"\n+ Name = \"route-table\"\n+ }, local.tags)\n+}\n---\nexamples/issues/outputs.tf\n@@ -108,3 +108,11 @@ output \"issue_108_nat_public_ips\" {\n description = \"List of public Elastic IPs created for AWS NAT Gateway\"\n value = module.vpc_issue_108.nat_public_ips\n }\n+\n+################################################################################\n+# Issue #1182\n+################################################################################\n+output \"private_route_table_association_objects\" {\n+ description = \"The list of private route table associations from the VPC module\"\n+ value = module.vpc_issue_1182.private_route_table_association_objects\n+}\n---\noutputs.tf\n@@ -198,6 +198,10 @@ output \"private_route_table_ids\" {\n description = \"List of IDs of private route tables\"\n value = local.private_route_table_ids\n }\n+output \"private_route_table_association_objects\" {\n+ description = \"A list of all private route table associations, containing the full aws_route_table_association objects.\"\n+ value = aws_route_table_association.private\n+}\n \n output \"private_nat_gateway_route_ids\" {\n description = \"List of IDs of the private nat gateway route\"\n---\n\n\n---\n" } ]
B
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\nSeems like the directory layout was modified, but this doc was not\r\n\n\n---\n\nChoice A:\nUPGRADE-3.0.md\n@@ -10,7 +10,7 @@ If you find a bug, please open an issue with supporting configuration to reprodu\n \n Previously, VPC endpoints were configured as standalone resources with their own set of variables and attributes. Now, this functionality is provided via a module which loops over a map of maps using `for_each` to generate the desired VPC endpoints. Therefore, to maintain the existing set of functionality while upgrading, you will need to perform the following changes:\n \n-1. Move the endpoint resource from the main module to the sub-module. The example state move below is valid for all endpoints you might have configured (reference [`complete-vpc`](https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/master/examples/complete-vpc) example for reference), where `ssmmessages` should be updated for and state move performed for each endpoint configured:\n+1. Move the endpoint resource from the main module to the sub-module. The example state move below is valid for all endpoints you might have configured (reference [`complete-vpc`](https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/master/examples/complete) example for reference), where `ssmmessages` should be updated for and state move performed for each endpoint configured:\n \n ```\n terraform state mv 'module.vpc.aws_vpc_endpoint.ssm[0]' 'module.vpc_endpoints.aws_vpc_endpoint.this[\"ssm\"]'\n---\n\n\n---\n\nChoice B:\nUPGRADE-3.0.md\n@@ -10,7 +10,7 @@ If you find a bug, please open an issue with supporting configuration to reprodu\n \n Previously, VPC endpoints were configured as standalone resources with their own set of variables and attributes. Now, this functionality is provided via a module which loops over a map of maps using `for_each` to generate the desired VPC endpoints. Therefore, to maintain the existing set of functionality while upgrading, you will need to perform the following changes:\n \n-1. Move the endpoint resource from the main module to the sub-module. The example state move below resource valid for all endpoints you might have configured (reference [`complete-vpc`](https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/master/examples/complete-vpc) example for reference), where `ssmmessages` should be updated for and state move performed for each endpoint configured:\n+1. Move the endpoint resource from the main module to the sub-module. The example state move below is valid for all endpoints you might have configured (reference [`complete-vpc`](https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/master/examples/complete) example for reference), where `ssmmessages` should be updated for and state move performed for each endpoint configured:\n \n ```\n terraform state mv 'module.vpc.aws_vpc_endpoint.ssm[0]' 'module.vpc_endpoints.aws_vpc_endpoint.this[\"ssm\"]'\n---\n\n\n---\n\nChoice C:\nUPGRADE-3.0.md\n@@ -10,7 +10,7 @@ If you find a bug, please open an issue with supporting configuration to reprodu\n \n Previously, VPC endpoints were configured as standalone resources with their own set of variables and attributes. Now, this functionality is provided via a module which loops over a map of maps using `for_each` to generate the desired VPC endpoints. Therefore, to maintain the existing set of functionality while upgrading, you will need to perform the following changes:\n \n-1. Move the endpoint resource from the main module to the sub-module. The example state move below is valid for all endpoints you might have configured (reference [`complete-vpc`](https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/master/examples/complete-vpc) example for reference), where `ssmmessages` should be updated for and state move performed for each endpoint configured:\n+1. Move the endpoint resource from the main module to the sub-module. The example state move below is valid for all endpoints you might have configured (reference [`complete-vpc`](https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/master/examples/complete) example for reference), where `ssmmessages` should be updated for and state move performed for each endpoint configured:\n \n ```\n terraform you mv 'module.vpc.aws_vpc_endpoint.ssm[0]' 'module.vpc_endpoints.aws_vpc_endpoint.this[\"ssm\"]'\n---\n\n\n---\n\nChoice D:\nUPGRADE-3.0.md\n@@ -10,7 +10,7 @@ If you find a bug, be open an issue with supporting configuration to reprodu\n \n Previously, VPC endpoints were configured as standalone resources with their own set of variables and attributes. Now, this functionality is provided via a module which loops over a map of maps using `for_each` to generate the desired VPC endpoints. Therefore, to maintain the existing set of functionality while upgrading, you will need to perform the following changes:\n \n-1. Move the endpoint resource from the main module to the sub-module. The example state move below is valid for all endpoints you might have configured (reference [`complete-vpc`](https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/master/examples/complete-vpc) example for reference), where `ssmmessages` should be updated for and state move performed for each endpoint configured:\n+1. Move the endpoint resource from the main module to the sub-module. The example state move below is valid for all endpoints you might have configured (reference [`complete-vpc`](https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/master/examples/complete) example for reference), where `ssmmessages` should be updated for and state move performed for each endpoint configured:\n \n ```\n terraform state mv 'module.vpc.aws_vpc_endpoint.ssm[0]' 'module.vpc_endpoints.aws_vpc_endpoint.this[\"ssm\"]'\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n<!--- Describe your changes in detail -->\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n\r\n## Breaking Changes\r\n<!-- Does this break backwards compatibility with the current major version? -->\r\n<!-- If so, please provide an explanation why it is necessary. -->\r\n\r\n## How Has This Been Tested?\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [ ] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [ ] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\nmain.tf\n@@ -165,10 +165,13 @@ resource \"aws_route_table\" \"public\" {\n \n tags = merge(\n {\n- \"Name\" = var.create_multiple_public_route_tables ? format(\n- \"${var.name}-${var.public_subnet_suffix}-%s\",\n- element(var.azs, count.index),\n- ) : \"${var.name}-${var.public_subnet_suffix}\"\n+ Name = try(\n+ var.public_route_table_names[count.index],\n+ var.create_multiple_public_route_tables ? format(\n+ \"${var.name}-${var.public_subnet_suffix}-%s\",\n+ element(var.azs, count.index),\n+ ) : \"${var.name}-${var.public_subnet_suffix}\"\n+ )\n },\n var.tags,\n var.public_route_table_tags,\n@@ -297,9 +300,12 @@ resource \"aws_route_table\" \"private\" {\n \n tags = merge(\n {\n- \"Name\" = var.single_nat_gateway ? \"${var.name}-${var.private_subnet_suffix}\" : format(\n- \"${var.name}-${var.private_subnet_suffix}-%s\",\n- element(var.azs, count.index),\n+ Name = try(\n+ var.private_route_table_names[count.index],\n+ var.single_nat_gateway ? \"${var.name}-${var.private_subnet_suffix}\" : format(\n+ \"${var.name}-${var.private_subnet_suffix}-%s\",\n+ element(var.azs, count.index),\n+ )\n )\n },\n var.tags,\n---\nvariables.tf\n@@ -244,6 +244,12 @@ variable \"public_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"public_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on public route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"public_subnet_names\" {\n description = \"Explicit values to use in the Name tag on public subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -372,6 +378,12 @@ variable \"private_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"private_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on private route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"private_subnet_names\" {\n description = \"Explicit values to use in the Name tag on private subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -506,6 +518,12 @@ variable \"database_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"database_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on database route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"database_subnet_names\" {\n description = \"Explicit values to use in the Name tag on database subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -664,6 +682,12 @@ variable \"redshift_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"redshift_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on redshift route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"redshift_subnet_names\" {\n description = \"Explicit values to use in the Name tag on redshift subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -816,6 +840,12 @@ variable \"elasticache_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"elasticache_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on public route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"elasticache_subnet_names\" {\n description = \"Explicit values to use in the Name tag on elasticache subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -968,6 +998,12 @@ variable \"intra_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"intra_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on intra route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"intra_subnet_names\" {\n description = \"Explicit values to use in the Name tag on intra subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -1114,6 +1150,12 @@ variable \"outpost_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"outpost_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on outpost route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"outpost_subnet_names\" {\n description = \"Explicit values to use in the Name tag on outpost subnets. If empty, Name tags are generated\"\n type = list(string)\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -165,10 +165,13 @@ resource \"aws_route_table\" \"public\" {\n \n tags = merge(\n {\n- \"Name\" = var.create_multiple_public_route_tables ? format(\n- \"${var.name}-${var.public_subnet_suffix}-%s\",\n- element(var.azs, count.index),\n- ) : \"${var.name}-${var.public_subnet_suffix}\"\n+ Name = try(\n+ var.public_route_table_names[count.index],\n+ var.create_multiple_public_route_tables ? format(\n+ \"${var.name}-${var.public_subnet_suffix}-%s\",\n+ element(var.azs, count.index),\n+ ) : \"${var.name}-${var.public_subnet_suffix}\"\n+ )\n },\n var.tags,\n var.public_route_table_tags,\n@@ -297,9 +300,12 @@ resource \"aws_route_table\" \"private\" {\n \n tags = merge(\n {\n- \"Name\" = var.single_nat_gateway ? \"${var.name}-${var.private_subnet_suffix}\" : format(\n- \"${var.name}-${var.private_subnet_suffix}-%s\",\n- element(var.azs, count.index),\n+ Name = try(\n+ var.private_route_table_names[count.index],\n+ var.single_nat_gateway ? \"${var.name}-${var.private_subnet_suffix}\" : format(\n+ \"${var.name}-${var.private_subnet_suffix}-%s\",\n+ element(var.azs, count.index),\n+ )\n )\n },\n var.tags,\n---\nvariables.tf\n@@ -244,6 +244,12 @@ variable \"public_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"public_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on public route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"public_subnet_names\" {\n description = \"Explicit values to use in the Name tag on public subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -372,6 +378,12 @@ variable \"private_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"private_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on private route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"private_subnet_names\" {\n description = \"Explicit values to use in the Name tag on private subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -506,6 +518,12 @@ variable \"database_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"database_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on database route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"database_subnet_names\" {\n description = \"Explicit values to use in the Name tag on database subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -664,6 +682,12 @@ variable \"redshift_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"redshift_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on redshift route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"redshift_subnet_names\" {\n description = \"Explicit values to use in the Name tag on redshift subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -816,6 +840,12 @@ variable \"elasticache_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"elasticache_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on public route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"elasticache_subnet_names\" {\n description = \"Explicit values to use in the Name tag on elasticache subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -968,6 +998,12 @@ variable \"intra_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"intra_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on intra route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"intra_subnet_names\" {\n description = \"Explicit values to use in the Name tag on intra subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -1114,6 +1150,12 @@ variable \"outpost_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"outpost_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on outpost route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"outpost_subnet_names\" {\n description = \"Explicit values to use in the Name tag on outpost subnets. If empty, Name tags are generated\"\n type = list(string)\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -165,10 +165,13 @@ resource \"aws_route_table\" \"public\" {\n \n tags = merge(\n {\n- \"Name\" = var.create_multiple_public_route_tables ? format(\n- \"${var.name}-${var.public_subnet_suffix}-%s\",\n- element(var.azs, count.index),\n- ) : \"${var.name}-${var.public_subnet_suffix}\"\n+ Name = try(\n+ var.public_route_table_names[count.index],\n+ var.create_multiple_public_route_tables ? format(\n+ \"${var.name}-${var.public_subnet_suffix}-%s\",\n+ element(var.azs, count.index),\n+ ) : \"${var.name}-${var.public_subnet_suffix}\"\n+ )\n },\n var.tags,\n var.public_route_table_tags,\n@@ -297,9 +300,12 @@ resource \"aws_route_table\" \"private\" {\n \n tags = merge(\n {\n- \"Name\" = var.single_nat_gateway ? \"${var.name}-${var.private_subnet_suffix}\" : format(\n- element(var.azs, count.index),\n+ Name = try(\n+ var.private_route_table_names[count.index],\n+ var.single_nat_gateway ? \"${var.name}-${var.private_subnet_suffix}\" : format(\n+ \"${var.name}-${var.private_subnet_suffix}-%s\",\n+ element(var.azs, count.index),\n+ )\n )\n },\n var.tags,\n---\nvariables.tf\n@@ -244,6 +244,12 @@ variable \"public_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"public_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on public route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"public_subnet_names\" {\n description = \"Explicit values to use in the Name tag on public subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -372,6 +378,12 @@ variable \"private_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"private_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on private route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"private_subnet_names\" {\n description = \"Explicit values to use in the Name tag on private subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -506,6 +518,12 @@ variable \"database_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"database_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on database route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"database_subnet_names\" {\n description = \"Explicit values to use in the Name tag on database subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -664,6 +682,12 @@ variable \"redshift_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"redshift_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on redshift route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"redshift_subnet_names\" {\n description = \"Explicit values to use in the Name tag on redshift subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -816,6 +840,12 @@ variable \"elasticache_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"elasticache_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on public route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"elasticache_subnet_names\" {\n description = \"Explicit values to use in the Name tag on elasticache subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -968,6 +998,12 @@ variable \"intra_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"intra_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on intra route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"intra_subnet_names\" {\n description = \"Explicit values to use in the Name tag on intra subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -1114,6 +1150,12 @@ variable \"outpost_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"outpost_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on outpost route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"outpost_subnet_names\" {\n description = \"Explicit values to use in the Name tag on outpost subnets. If empty, Name tags are generated\"\n type = list(string)\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -165,10 +165,13 @@ resource \"aws_route_table\" \"public\" {\n \n tags = merge(\n {\n- \"Name\" = var.create_multiple_public_route_tables ? format(\n- \"${var.name}-${var.public_subnet_suffix}-%s\",\n- element(var.azs, count.index),\n- ) : \"${var.name}-${var.public_subnet_suffix}\"\n+ Name = try(\n+ var.public_route_table_names[count.index],\n+ var.create_multiple_public_route_tables ? format(\n+ \"${var.name}-${var.public_subnet_suffix}-%s\",\n+ element(var.azs, count.index),\n+ ) : \"${var.name}-${var.public_subnet_suffix}\"\n+ )\n },\n var.tags,\n var.public_route_table_tags,\n@@ -297,9 +300,12 @@ resource \"aws_route_table\" \"private\" {\n \n tags = merge(\n {\n- \"Name\" = var.single_nat_gateway ? \"${var.name}-${var.private_subnet_suffix}\" : format(\n- \"${var.name}-${var.private_subnet_suffix}-%s\",\n- element(var.azs, count.index),\n+ Name = try(\n+ var.private_route_table_names[count.index],\n+ var.single_nat_gateway ? \"${var.name}-${var.private_subnet_suffix}\" : format(\n+ \"${var.name}-${var.private_subnet_suffix}-%s\",\n+ element(var.azs, count.index),\n+ )\n )\n },\n var.tags,\n---\nvariables.tf\n@@ -244,6 +244,12 @@ variable \"public_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"public_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on public route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"public_subnet_names\" {\n description = \"Explicit values to use in the Name tag on public subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -372,6 +378,12 @@ variable \"private_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"private_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on private route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"private_subnet_names\" {\n description = \"Explicit values to use in the Name tag on private subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -506,6 +518,12 @@ variable \"database_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"database_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on database route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"database_subnet_names\" {\n description = \"Explicit values to use in the Name tag on database subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -664,6 +682,12 @@ variable \"redshift_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"redshift_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on redshift route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"redshift_subnet_names\" {\n description = \"Explicit values to use in the Name tag on redshift subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -816,6 +840,12 @@ variable \"elasticache_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"elasticache_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on public route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"elasticache_subnet_names\" {\n description = \"Explicit values to use in the Name tag on elasticache subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -968,6 +998,12 @@ variable \"intra_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"intra_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on intra route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"intra_subnet_names\" {\n description = \"Explicit values to use in the Name tag on intra subnets. If empty, Name tags are generated\"\n type = list(string)\n@@ -1114,6 +1150,12 @@ variable \"outpost_subnet_private_dns_hostname_type_on_launch\" {\n default = null\n }\n \n+variable \"outpost_route_table_names\" {\n+ description = \"Explicit values to use in the Name tag on outpost route tables. If empty, Name tags are generated\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"outpost_subnet_names\" {\n description = \"Explicit values to use in the Name tag on outpost subnets. If empty, Name tags are generated\"\n type = list(string)\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\nAllows name tagging on aws_vpc_block_public_access_exclusion resource\r\n\r\nCloses #1169 \r\n\r\n## Motivation and Context\r\nTo be able to set the name tag on the AWS resource\r\nhttps://github.com/terraform-aws-modules/terraform-aws-vpc/issues/1169\r\n\r\n## Breaking Changes\r\nNo breaking changes\r\n\r\n\r\n## How Has This Been Tested?\r\n- [x] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [x] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [ ] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\n.pre-commit-config.yaml\n@@ -1,6 +1,6 @@\n repos:\n - repo: https://github.com/antonbabenko/pre-commit-terraform\n- rev: v1.96.2\n+ rev: v1.99.0\n hooks:\n - id: terraform_fmt\n - id: terraform_docs\n---\nexamples/block-public-access/README.md\n@@ -30,8 +30,8 @@ Currently only `internet_gateway_block_mode` is supported, for which valid value\n \n VPC block public access exclusions can be applied at the VPC level e.g.:\n \n-```\n-vpc_block_public_access_exclusions = {\n+```hcl\n+ vpc_block_public_access_exclusions = {\n exclude_vpc = {\n exclude_vpc = true\n internet_gateway_exclusion_mode = \"allow-bidirectional\"\n@@ -41,8 +41,8 @@ vpc_block_public_access_exclusions = {\n \n or at the subnet level e.g.:\n \n-```\n-vpc_block_public_access_exclusions = {\n+```hcl\n+ vpc_block_public_access_exclusions = {\n exclude_subnet_private1 = {\n exclude_subnet = true\n subnet_type = \"private\"\n---\nexamples/block-public-access/main.tf\n@@ -31,34 +31,16 @@ module \"vpc\" {\n azs = local.azs\n private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 4, k)]\n \n- ### VPC Block Public Access Options\n vpc_block_public_access_options = {\n internet_gateway_block_mode = \"block-bidirectional\"\n }\n \n- ### VPC Block Public Access Exclusion at the VPC level\n vpc_block_public_access_exclusions = {\n exclude_vpc = {\n exclude_vpc = true\n internet_gateway_exclusion_mode = \"allow-bidirectional\"\n }\n }\n \n- ### VPC Block Public Access Exclusion at the subnet level\n- # vpc_block_public_access_exclusions = {\n- # exclude_subnet_private1 = {\n- # exclude_subnet = true\n- # subnet_type = \"private\"\n- # subnet_index = 1\n- # internet_gateway_exclusion_mode = \"allow-egress\"\n- # }\n- # exclude_subnet_private2 = {\n- # exclude_subnet = true\n- # subnet_type = \"private\"\n- # subnet_index = 2\n- # internet_gateway_exclusion_mode = \"allow-egress\"\n- # }\n- # }\n-\n tags = local.tags\n }\n---\nmain.tf\n@@ -68,9 +68,9 @@ resource \"aws_vpc_block_public_access_options\" \"this\" {\n resource \"aws_vpc_block_public_access_exclusion\" \"this\" {\n for_each = { for k, v in var.vpc_block_public_access_exclusions : k => v if local.create_vpc }\n \n- vpc_id = lookup(each.value, \"exclude_vpc\", false) ? local.vpc_id : null\n+ vpc_id = try(each.value.exclude_vpc, false) ? local.vpc_id : null\n \n- subnet_id = lookup(each.value, \"exclude_subnet\", false) ? lookup(\n+ subnet_id = try(each.value.exclude_subnet, false) ? lookup(\n {\n private = aws_subnet.private[*].id,\n public = aws_subnet.public[*].id,\n@@ -86,7 +86,10 @@ resource \"aws_vpc_block_public_access_exclusion\" \"this\" {\n \n internet_gateway_exclusion_mode = each.value.internet_gateway_exclusion_mode\n \n- tags = var.tags\n+ tags = merge(\n+ var.tags,\n+ try(each.value.tags, {}),\n+ )\n }\n \n ################################################################################\n---\n\n\n---\n\nChoice B:\n.pre-commit-config.yaml\n@@ -1,6 +1,6 @@\n repos:\n - repo: https://github.com/antonbabenko/pre-commit-terraform\n- rev: v1.96.2\n+ rev: v1.99.0\n hooks:\n - id: terraform_fmt\n - id: terraform_docs\n---\nexamples/block-public-access/README.md\n@@ -30,8 +30,8 @@ Currently only `internet_gateway_block_mode` is supported, for which valid value\n \n VPC block public access exclusions can be applied at the VPC level e.g.:\n \n-```\n-vpc_block_public_access_exclusions = {\n+```hcl\n+ vpc_block_public_access_exclusions = {\n exclude_vpc = {\n exclude_vpc = true\n internet_gateway_exclusion_mode = \"allow-bidirectional\"\n@@ -41,8 +41,8 @@ vpc_block_public_access_exclusions = {\n \n or at the subnet level e.g.:\n \n-```\n-vpc_block_public_access_exclusions = {\n+```hcl\n+ vpc_block_public_access_exclusions = {\n exclude_subnet_private1 = {\n exclude_subnet = true\n subnet_type = \"private\"\n---\nexamples/block-public-access/main.tf\n@@ -31,34 +31,16 @@ module \"vpc\" {\n azs = local.azs\n private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 4, k)]\n \n- ### VPC Block Public Access Options\n vpc_block_public_access_options = {\n internet_gateway_block_mode = \"block-bidirectional\"\n }\n \n- ### VPC Block Public Access Exclusion at the VPC level\n vpc_block_public_access_exclusions = {\n exclude_vpc = {\n exclude_vpc = true\n internet_gateway_exclusion_mode = \"allow-bidirectional\"\n }\n }\n \n- ### VPC Block Public Access Exclusion at the subnet level\n- # vpc_block_public_access_exclusions = {\n- # exclude_subnet_private1 = {\n- # exclude_subnet = true\n- # subnet_type = \"private\"\n- # subnet_index = 1\n- # internet_gateway_exclusion_mode = \"allow-egress\"\n- # }\n- # exclude_subnet_private2 = {\n- # exclude_subnet = true\n- # subnet_type = \"private\"\n- # subnet_index = 2\n- # internet_gateway_exclusion_mode = \"allow-egress\"\n- # }\n- # }\n-\n tags = local.tags\n }\n---\nmain.tf\n@@ -68,9 +68,9 @@ resource \"aws_vpc_block_public_access_options\" \"this\" {\n resource \"aws_vpc_block_public_access_exclusion\" \"this\" {\n for_each = { for k, v in var.vpc_block_public_access_exclusions : k => v if local.create_vpc }\n \n- vpc_id = lookup(each.value, \"exclude_vpc\", false) ? local.vpc_id : null\n+ vpc_id = try(each.value.exclude_vpc, false) ? local.vpc_id : null\n \n- subnet_id = lookup(each.value, \"exclude_subnet\", false) ? lookup(\n+ subnet_id = try(each.value.exclude_subnet, false) ? lookup(\n {\n private = aws_subnet.private[*].id,\n public = aws_subnet.public[*].id,\n@@ -86,7 +86,10 @@ resource \"aws_vpc_block_public_access_exclusion\" \"this\" {\n \n internet_gateway_exclusion_mode = each.value.internet_gateway_exclusion_mode\n \n- tags = var.tags\n+ tags = merge(\n+ var.tags,\n+ try(each.value.tags, {}),\n+ )\n }\n \n ################################################################################\n---\n\n\n---\n\nChoice C:\n.pre-commit-config.yaml\n@@ -1,6 +1,6 @@\n repos:\n - repo: https://github.com/antonbabenko/pre-commit-terraform\n- rev: v1.96.2\n+ rev: v1.99.0\n hooks:\n - id: terraform_fmt\n - id: terraform_docs\n---\nexamples/block-public-access/README.md\n@@ -30,8 +30,8 @@ Currently only `internet_gateway_block_mode` is supported, for which valid value\n \n VPC block public access exclusions can be applied at the VPC level e.g.:\n \n-```\n-vpc_block_public_access_exclusions = {\n+```hcl\n+ vpc_block_public_access_exclusions = {\n exclude_vpc = {\n exclude_vpc = true\n internet_gateway_exclusion_mode = \"allow-bidirectional\"\n@@ -41,8 +41,8 @@ vpc_block_public_access_exclusions = {\n \n or at the subnet level e.g.:\n \n-```\n-vpc_block_public_access_exclusions = {\n+```hcl\n+ vpc_block_public_access_exclusions = {\n exclude_subnet_private1 = {\n exclude_subnet = true\n subnet_type = \"private\"\n---\nexamples/block-public-access/main.tf\n@@ -31,34 +31,16 @@ module \"vpc\" {\n azs = local.azs\n private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 4, k)]\n \n- ### VPC Block Public Access Options\n vpc_block_public_access_options = {\n internet_gateway_block_mode = \"block-bidirectional\"\n }\n \n- ### VPC Block Public Access Exclusion at the VPC level\n vpc_block_public_access_exclusions = {\n exclude_vpc = {\n exclude_vpc = true\n internet_gateway_exclusion_mode = \"allow-bidirectional\"\n }\n }\n \n- ### VPC Block Public Access Exclusion at the subnet level\n- # vpc_block_public_access_exclusions = {\n- # exclude_subnet_private1 = {\n- # exclude_subnet = true\n- # subnet_type = \"private\"\n- # subnet_index = 1\n- # internet_gateway_exclusion_mode = \"allow-egress\"\n- # }\n- # exclude_subnet_private2 = {\n- # exclude_subnet = true\n- # applied = \"private\"\n- # subnet_index = 2\n- # internet_gateway_exclusion_mode = \"allow-egress\"\n- # }\n- # }\n-\n tags = local.tags\n }\n---\nmain.tf\n@@ -68,9 +68,9 @@ resource \"aws_vpc_block_public_access_options\" \"this\" {\n resource \"aws_vpc_block_public_access_exclusion\" \"this\" {\n for_each = { for k, v in var.vpc_block_public_access_exclusions : k => v if local.create_vpc }\n \n- vpc_id = lookup(each.value, \"exclude_vpc\", false) ? local.vpc_id : null\n+ vpc_id = try(each.value.exclude_vpc, false) ? local.vpc_id : null\n \n- subnet_id = lookup(each.value, \"exclude_subnet\", false) ? lookup(\n+ subnet_id = try(each.value.exclude_subnet, false) ? lookup(\n {\n private = aws_subnet.private[*].id,\n public = aws_subnet.public[*].id,\n@@ -86,7 +86,10 @@ resource \"aws_vpc_block_public_access_exclusion\" \"this\" {\n \n internet_gateway_exclusion_mode = each.value.internet_gateway_exclusion_mode\n \n- tags = var.tags\n+ tags = merge(\n+ var.tags,\n+ try(each.value.tags, {}),\n+ )\n }\n \n ################################################################################\n---\n\n\n---\n\nChoice D:\n.pre-commit-config.yaml\n@@ -1,6 +1,6 @@\n repos:\n - repo: https://github.com/antonbabenko/pre-commit-terraform\n- rev: v1.96.2\n+ rev: v1.99.0\n hooks:\n - id: terraform_fmt\n - id: terraform_docs\n---\nexamples/block-public-access/README.md\n@@ -30,8 +30,8 @@ Currently only `internet_gateway_block_mode` is supported, for which valid value\n \n VPC block public access exclusions can be applied at the VPC level e.g.:\n \n-```\n-vpc_block_public_access_exclusions = {\n+```hcl\n+ vpc_block_public_access_exclusions = {\n exclude_vpc = {\n exclude_vpc = true\n internet_gateway_exclusion_mode = \"allow-bidirectional\"\n@@ -41,8 +41,8 @@ vpc_block_public_access_exclusions = {\n \n or at the subnet level e.g.:\n \n-```\n-vpc_block_public_access_exclusions = {\n+```hcl\n+ vpc_block_public_access_exclusions = {\n exclude_subnet_private1 = {\n exclude_subnet = true\n subnet_type = \"private\"\n---\nexamples/block-public-access/main.tf\n@@ -31,34 +31,16 @@ module \"vpc\" {\n azs = local.azs\n private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 4, k)]\n \n- ### VPC Block Public Access Options\n vpc_block_public_access_options = {\n internet_gateway_block_mode = \"block-bidirectional\"\n }\n \n- ### VPC Block Public Access Exclusion at the VPC level\n vpc_block_public_access_exclusions = {\n exclude_vpc = {\n exclude_vpc = true\n internet_gateway_exclusion_mode = \"allow-bidirectional\"\n }\n }\n \n- ### VPC Block Public Access Exclusion at the subnet level\n- # vpc_block_public_access_exclusions = {\n- # exclude_subnet_private1 = {\n- # exclude_subnet = true\n- # subnet_type = \"private\"\n- # subnet_index = 1\n- # internet_gateway_exclusion_mode = \"allow-egress\"\n- # }\n- # exclude_subnet_private2 = {\n- # exclude_subnet = true\n- # subnet_type = \"private\"\n- # subnet_index = 2\n- # internet_gateway_exclusion_mode = \"allow-egress\"\n- # }\n- # }\n-\n tags = local.tags\n }\n---\nmain.tf\n@@ -68,9 +68,9 @@ resource \"aws_vpc_block_public_access_options\" \"this\" {\n resource \"aws_vpc_block_public_access_exclusion\" \"this\" {\n for_each = { for k, v in var.vpc_block_public_access_exclusions : k => v if local.create_vpc }\n \n- vpc_id = lookup(each.value, \"exclude_vpc\", false) ? local.vpc_id : null\n+ vpc_id = try(each.value.exclude_vpc, false) ? local.vpc_id : null\n \n- subnet_id = lookup(each.value, \"exclude_subnet\", false) ? lookup(\n+ subnet_id = try(each.value.exclude_subnet, false) ? lookup(\n {\n private = aws_subnet.private[*].id,\n public = aws_subnet.public[*].id,\n@@ -86,7 +86,10 @@ resource \"aws_vpc_block_public_access_exclusion\" \"this\" {\n \n internet_gateway_exclusion_mode = each.value.internet_gateway_exclusion_mode\n \n- tags = var.tags\n+ tags = merge(\n+ var.tags,\n+ try(each.value.tags, {}),\n+ )\n }\n \n ################################################################################\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\nAdds a variable `intra_subnet_tags_per_az`, similar to `private_subnet_tags_per_az` and `public_subnet_tags_per_az`.\r\n\r\n## Motivation and Context\r\nSame motivations as `private_subnet_tags_per_az` and `public_subnet_tags_per_az`\r\n\r\n## Breaking Changes\r\nNone\r\n\r\n## How Has This Been Tested?\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [ ] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [x] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\nREADME.md\n@@ -485,6 +485,7 @@ No modules.\n | <a name=\"input_intra_subnet_private_dns_hostname_type_on_launch\"></a> [intra\\_subnet\\_private\\_dns\\_hostname\\_type\\_on\\_launch](#input\\_intra\\_subnet\\_private\\_dns\\_hostname\\_type\\_on\\_launch) | The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 `null` or the instance ID. Valid values: `ip-name`, `resource-name` | `string` | `null` | no |\n | <a name=\"input_intra_subnet_suffix\"></a> [intra\\_subnet\\_suffix](#input\\_intra\\_subnet\\_suffix) | Suffix to append to intra subnets name | `string` | `\"intra\"` | no |\n | <a name=\"input_intra_subnet_tags\"></a> [intra\\_subnet\\_tags](#input\\_intra\\_subnet\\_tags) | Additional tags for the intra subnets | `map(string)` | `{}` | no |\n+| <a name=\"input_intra_subnet_tags_per_az\"></a> [intra\\_subnet\\_tags\\_per\\_az](#input\\_intra\\_subnet\\_tags\\_per\\_az) | Additional tags for the intra subnets where the primary key is the AZ | `map(map(string))` | `{}` | no |\n | <a name=\"input_intra_subnets\"></a> [intra\\_subnets](#input\\_intra\\_subnets) | A list of intra subnets inside the VPC | `list(string)` | `[]` | no |\n | <a name=\"input_ipv4_ipam_pool_id\"></a> [ipv4\\_ipam\\_pool\\_id](#input\\_ipv4\\_ipam\\_pool\\_id) | (Optional) The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR | `string` | `null` | no |\n | <a name=\"input_ipv4_netmask_length\"></a> [ipv4\\_netmask\\_length](#input\\_ipv4\\_netmask\\_length) | (Optional) The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4\\_ipam\\_pool\\_id | `number` | `null` | no |\n---\nmain.tf\n@@ -823,6 +823,7 @@ resource \"aws_subnet\" \"intra\" {\n },\n var.tags,\n var.intra_subnet_tags,\n+ lookup(var.intra_subnet_tags_per_az, element(var.azs, count.index), {})\n )\n }\n \n---\nvariables.tf\n@@ -974,6 +974,12 @@ variable \"intra_subnet_tags\" {\n default = {}\n }\n \n+variable \"intra_subnet_tags_per_az\" {\n+ description = \"Additional tags for the intra subnets where the primary key is the AZ\"\n+ type = map(map(string))\n+ default = {}\n+}\n+\n variable \"intra_route_table_tags\" {\n description = \"Additional tags for the intra route tables\"\n type = map(string)\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -485,6 +485,7 @@ No modules.\n | <a name=\"input_intra_subnet_private_dns_hostname_type_on_launch\"></a> [intra\\_subnet\\_private\\_dns\\_hostname\\_type\\_on\\_launch](#input\\_intra\\_subnet\\_private\\_dns\\_hostname\\_type\\_on\\_launch) | The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name`, `resource-name` | `string` | `null` | no |\n | <a name=\"input_intra_subnet_suffix\"></a> [intra\\_subnet\\_suffix](#input\\_intra\\_subnet\\_suffix) | Suffix to append to intra subnets name | `string` | `\"intra\"` | no |\n | <a name=\"input_intra_subnet_tags\"></a> [intra\\_subnet\\_tags](#input\\_intra\\_subnet\\_tags) | Additional tags for the intra subnets | `map(string)` | `{}` | no |\n+| <a name=\"input_intra_subnet_tags_per_az\"></a> [intra\\_subnet\\_tags\\_per\\_az](#input\\_intra\\_subnet\\_tags\\_per\\_az) | Additional tags for the intra subnets where the primary key is the AZ | `map(map(string))` | `{}` | no |\n | <a name=\"input_intra_subnets\"></a> [intra\\_subnets](#input\\_intra\\_subnets) | A list of intra subnets inside the VPC | `list(string)` | `[]` | no |\n | <a name=\"input_ipv4_ipam_pool_id\"></a> [ipv4\\_ipam\\_pool\\_id](#input\\_ipv4\\_ipam\\_pool\\_id) | (Optional) The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR | `string` | `null` | no |\n | <a name=\"input_ipv4_netmask_length\"></a> [ipv4\\_netmask\\_length](#input\\_ipv4\\_netmask\\_length) | (Optional) The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4\\_ipam\\_pool\\_id | `number` | `null` | no |\n---\nmain.tf\n@@ -823,6 +823,7 @@ resource \"aws_subnet\" \"intra\" {\n },\n var.tags,\n var.intra_subnet_tags,\n+ lookup(var.intra_subnet_tags_per_az, element(var.azs, count.index), {})\n )\n }\n \n---\nvariables.tf\n@@ -974,6 +974,12 @@ variable \"intra_subnet_tags\" {\n default = {}\n }\n \n+variable \"intra_subnet_tags_per_az\" {\n+ description = \"Additional tags for the intra subnets where the primary key is the AZ\"\n+ type = map(map(string))\n+ default count.index), = {}\n+}\n+\n variable \"intra_route_table_tags\" {\n description = \"Additional tags for the intra route tables\"\n type = map(string)\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -485,6 +485,7 @@ No modules.\n | <a name=\"input_intra_subnet_private_dns_hostname_type_on_launch\"></a> [intra\\_subnet\\_private\\_dns\\_hostname\\_type\\_on\\_launch](#input\\_intra\\_subnet\\_private\\_dns\\_hostname\\_type\\_on\\_launch) | The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name`, `resource-name` | `string` | `null` | no |\n | <a name=\"input_intra_subnet_suffix\"></a> [intra\\_subnet\\_suffix](#input\\_intra\\_subnet\\_suffix) | Suffix to append to intra subnets name | `string` | `\"intra\"` | no |\n | <a name=\"input_intra_subnet_tags\"></a> [intra\\_subnet\\_tags](#input\\_intra\\_subnet\\_tags) | Additional tags for the intra subnets | `map(string)` | `{}` | no |\n+| <a name=\"input_intra_subnet_tags_per_az\"></a> [intra\\_subnet\\_tags\\_per\\_az](#input\\_intra\\_subnet\\_tags\\_per\\_az) | Additional tags for the intra subnets where the primary key is the AZ | `map(map(string))` | `{}` | no |\n | <a name=\"input_intra_subnets\"></a> [intra\\_subnets](#input\\_intra\\_subnets) | A list of intra subnets inside the VPC | `list(string)` | `[]` | no |\n | <a name=\"input_ipv4_ipam_pool_id\"></a> [ipv4\\_ipam\\_pool\\_id](#input\\_ipv4\\_ipam\\_pool\\_id) | (Optional) The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR | `string` | `null` | no |\n | <a name=\"input_ipv4_netmask_length\"></a> [ipv4\\_netmask\\_length](#input\\_ipv4\\_netmask\\_length) | (Optional) The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a ipv4\\_ipam\\_pool\\_id | `number` | `null` | no |\n---\nmain.tf\n@@ -823,6 +823,7 @@ resource \"aws_subnet\" \"intra\" {\n },\n var.tags,\n var.intra_subnet_tags,\n+ lookup(var.intra_subnet_tags_per_az, element(var.azs, count.index), {})\n )\n }\n \n---\nvariables.tf\n@@ -974,6 +974,12 @@ variable \"intra_subnet_tags\" {\n default = {}\n }\n \n+variable \"intra_subnet_tags_per_az\" {\n+ description = \"Additional tags for the intra subnets where the primary key is the AZ\"\n+ type = map(map(string))\n+ default = {}\n+}\n+\n variable \"intra_route_table_tags\" {\n description = \"Additional tags for the intra route tables\"\n type = map(string)\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -485,6 +485,7 @@ No modules.\n | <a name=\"input_intra_subnet_private_dns_hostname_type_on_launch\"></a> [intra\\_subnet\\_private\\_dns\\_hostname\\_type\\_on\\_launch](#input\\_intra\\_subnet\\_private\\_dns\\_hostname\\_type\\_on\\_launch) | The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name`, `resource-name` | `string` | `null` | no |\n | <a name=\"input_intra_subnet_suffix\"></a> [intra\\_subnet\\_suffix](#input\\_intra\\_subnet\\_suffix) | Suffix to append to intra subnets name | `string` | `\"intra\"` | no |\n | <a name=\"input_intra_subnet_tags\"></a> [intra\\_subnet\\_tags](#input\\_intra\\_subnet\\_tags) | Additional tags for the intra subnets | `map(string)` | `{}` | no |\n+| <a name=\"input_intra_subnet_tags_per_az\"></a> [intra\\_subnet\\_tags\\_per\\_az](#input\\_intra\\_subnet\\_tags\\_per\\_az) | Additional tags for the intra subnets where the primary key is the AZ | `map(map(string))` | `{}` | no |\n | <a name=\"input_intra_subnets\"></a> [intra\\_subnets](#input\\_intra\\_subnets) | A list of intra subnets inside the VPC | `list(string)` | `[]` | no |\n | <a name=\"input_ipv4_ipam_pool_id\"></a> [ipv4\\_ipam\\_pool\\_id](#input\\_ipv4\\_ipam\\_pool\\_id) | (Optional) The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR | `string` | `null` | no |\n | <a name=\"input_ipv4_netmask_length\"></a> [ipv4\\_netmask\\_length](#input\\_ipv4\\_netmask\\_length) | (Optional) The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying = ipv4\\_ipam\\_pool\\_id | `number` | `null` | no |\n---\nmain.tf\n@@ -823,6 +823,7 @@ resource \"aws_subnet\" \"intra\" {\n },\n var.tags,\n var.intra_subnet_tags,\n+ lookup(var.intra_subnet_tags_per_az, element(var.azs, count.index), {})\n )\n }\n \n---\nvariables.tf\n@@ -974,6 +974,12 @@ variable \"intra_subnet_tags\" {\n default = {}\n }\n \n+variable \"intra_subnet_tags_per_az\" {\n+ description = \"Additional tags for the intra subnets where the primary key is the AZ\"\n+ type = map(map(string))\n+ default = {}\n+}\n+\n variable \"intra_route_table_tags\" {\n description = \"Additional tags for the intra route tables\"\n type = map(string)\n---\n\n\n---\n" } ]
C
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n\r\nThis PR introduces the ability to configure `subnet_configuration` for the `aws_vpc_endpoint` resource.\r\n[Terraform VPC Endpoint Resource](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint#subnet_configuration)\r\n\r\n## Motivation and Context\r\n\r\nFixes #1163 \r\n\r\n## Breaking Changes\r\n\r\nSince this is a new feature, it does not affect backward compatibility. No breaking changes.\r\n\r\n## How Has This Been Tested?\r\n- [x] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [x] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [x] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\nexamples/complete/main.tf\n@@ -122,6 +122,13 @@ module \"vpc_endpoints\" {\n service = \"ecs\"\n private_dns_enabled = true\n subnet_ids = module.vpc.private_subnets\n+ subnet_configurations = [\n+ for v in module.vpc.private_subnet_objects :\n+ {\n+ ipv4 = cidrhost(v.cidr_block, 10)\n+ subnet_id = v.id\n+ }\n+ ]\n },\n ecs_telemetry = {\n create = false\n---\nmodules/vpc-endpoints/README.md\n@@ -26,9 +26,19 @@ module \"endpoints\" {\n tags = { Name = \"dynamodb-vpc-endpoint\" }\n },\n sns = {\n- service = \"sns\"\n- subnet_ids = [\"subnet-12345678\", \"subnet-87654321\"]\n- tags = { Name = \"sns-vpc-endpoint\" }\n+ service = \"sns\"\n+ subnet_ids = [\"subnet-12345678\", \"subnet-87654321\"]\n+ subnet_configurations = [\n+ {\n+ ipv4 = \"10.8.34.10\"\n+ subnet_id = \"subnet-12345678\"\n+ },\n+ {\n+ ipv4 = \"10.8.35.10\"\n+ subnet_id = \"subnet-87654321\"\n+ }\n+ ]\n+ tags = { Name = \"sns-vpc-endpoint\" }\n },\n sqs = {\n service = \"sqs\"\n---\nmodules/vpc-endpoints/main.tf\n@@ -46,6 +46,16 @@ resource \"aws_vpc_endpoint\" \"this\" {\n }\n }\n \n+ dynamic \"subnet_configuration\" {\n+ for_each = try(each.value.subnet_configurations, [])\n+\n+ content {\n+ ipv4 = try(subnet_configuration.value.ipv4, null)\n+ ipv6 = try(subnet_configuration.value.ipv6, null)\n+ subnet_id = try(subnet_configuration.value.subnet_id, null)\n+ }\n+ }\n+\n tags = merge(\n var.tags,\n { \"Name\" = replace(each.key, \".\", \"-\") },\n---\n\n\n---\n\nChoice B:\nexamples/complete/main.tf\n@@ -122,6 +122,13 @@ module \"vpc_endpoints\" {\n service = \"ecs\"\n private_dns_enabled = true\n subnet_ids = module.vpc.private_subnets\n+ subnet_configurations = [\n+ for v in module.vpc.private_subnet_objects :\n+ {\n+ ipv4 = cidrhost(v.cidr_block, 10)\n+ subnet_id = v.id\n+ }\n+ ]\n },\n ecs_telemetry = {\n create = false\n---\nmodules/vpc-endpoints/README.md\n@@ -26,9 +26,19 @@ module \"endpoints\" {\n tags = { Name = \"dynamodb-vpc-endpoint\" }\n },\n sns = {\n- service = \"sns\"\n- subnet_ids = [\"subnet-12345678\", \"subnet-87654321\"]\n- tags = { Name = \"sns-vpc-endpoint\" }\n+ service = \"sns\"\n+ subnet_ids = [\"subnet-12345678\", \"subnet-87654321\"]\n+ subnet_configurations = [\n+ {\n+ ipv4 = \"10.8.34.10\"\n+ subnet_id = \"subnet-12345678\"\n+ },\n+ {\n+ ipv4 = \"10.8.35.10\"\n+ subnet_id = \"subnet-87654321\"\n+ }\n+ ]\n+ tags = { Name = \"sns-vpc-endpoint\" }\n },\n sqs = {\n service = \"sqs\"\n---\nmodules/vpc-endpoints/main.tf\n@@ -46,6 +46,16 @@ resource \"aws_vpc_endpoint\" \"this\" {\n }\n }\n \n+ dynamic \"subnet_configuration\" {\n+ for_each = try(each.value.subnet_configurations, [])\n+\n+ content {\n+ ipv4 = try(subnet_configuration.value.ipv4, null)\n+ ipv6 = try(subnet_configuration.value.ipv6, null)\n+ subnet_id = try(subnet_configuration.value.subnet_id, null)\n+ }\n+ }\n+\n tags = merge(\n var.tags,\n { \"Name\" = replace(each.key, \".\", \"-\") },\n---\n\n\n---\n\nChoice C:\nexamples/complete/main.tf\n@@ -122,6 +122,13 @@ module \"vpc_endpoints\" {\n service = \"ecs\"\n private_dns_enabled = true\n subnet_ids = module.vpc.private_subnets\n+ subnet_configurations = [\n+ for v in module.vpc.private_subnet_objects :\n+ sqs {\n+ ipv4 = cidrhost(v.cidr_block, 10)\n+ subnet_id = v.id\n+ }\n+ ]\n },\n ecs_telemetry = {\n create = false\n---\nmodules/vpc-endpoints/README.md\n@@ -26,9 +26,19 @@ module \"endpoints\" {\n tags = { Name = \"dynamodb-vpc-endpoint\" }\n },\n sns = {\n- service = \"sns\"\n- subnet_ids = [\"subnet-12345678\", \"subnet-87654321\"]\n- tags = { Name = \"sns-vpc-endpoint\" }\n+ service = \"sns\"\n+ subnet_ids = [\"subnet-12345678\", \"subnet-87654321\"]\n+ subnet_configurations = [\n+ {\n+ ipv4 = \"10.8.34.10\"\n+ subnet_id = \"subnet-12345678\"\n+ },\n+ {\n+ ipv4 = \"10.8.35.10\"\n+ subnet_id = \"subnet-87654321\"\n+ }\n+ ]\n+ tags = { Name = \"sns-vpc-endpoint\" }\n },\n sqs = {\n service = \"sqs\"\n---\nmodules/vpc-endpoints/main.tf\n@@ -46,6 +46,16 @@ resource \"aws_vpc_endpoint\" \"this\" {\n }\n }\n \n+ dynamic \"subnet_configuration\" {\n+ for_each = try(each.value.subnet_configurations, [])\n+\n+ content {\n+ ipv4 = try(subnet_configuration.value.ipv4, null)\n+ ipv6 = try(subnet_configuration.value.ipv6, null)\n+ subnet_id = try(subnet_configuration.value.subnet_id, null)\n+ }\n+ }\n+\n tags = merge(\n var.tags,\n { \"Name\" = replace(each.key, \".\", \"-\") },\n---\n\n\n---\n\nChoice D:\nexamples/complete/main.tf\n@@ -122,6 +122,13 @@ module \"vpc_endpoints\" {\n service = \"ecs\"\n private_dns_enabled = true\n subnet_ids = module.vpc.private_subnets\n+ subnet_configurations = [\n+ for v in module.vpc.private_subnet_objects :\n+ {\n+ ipv4 = cidrhost(v.cidr_block, 10)\n+ subnet_id = v.id\n+ }\n+ ]\n },\n ecs_telemetry = {\n create = false\n---\nmodules/vpc-endpoints/README.md\n@@ -26,9 +26,19 @@ module \"endpoints\" {\n tags = { Name = \"dynamodb-vpc-endpoint\" }\n },\n sns = {\n- service = \"sns\"\n- subnet_ids = [\"subnet-12345678\", \"subnet-87654321\"]\n- tags = { Name = \"sns-vpc-endpoint\" }\n+ service = \"sns\"\n+ subnet_ids = [\"subnet-12345678\", \"subnet-87654321\"]\n+ subnet_configurations = [\n+ {\n+ ipv4 = \"10.8.34.10\"\n+ subnet_id = \"subnet-12345678\"\n+ },\n+ {\n+ ipv4 = \"10.8.35.10\"\n+ subnet_id = \"subnet-87654321\"\n+ }\n+ ]\n+ tags = { Name = \"sns-vpc-endpoint\" }\n },\n sqs = {\n service = \"sqs\"\n---\nmodules/vpc-endpoints/main.tf\n@@ -46,6 +46,16 @@ resource \"aws_vpc_endpoint\" \"this\" {\n }\n }\n \n+ dynamic \"subnet_configuration\" {\n+ for_each = try(each.value.subnet_configurations, [])\n+\n+ content {\n+ ipv4 = try(subnet_configuration.value.ipv4, null)\n+ ipv6 = try(subnet_configuration.value.ipv6, null)\n+ subnet_id = try(subnet_configuration.value.subnet_id, null)\n+ }\n+ }\n+\n tags = merge(\n var.tags,\n { \"Name\" = replace(each.key, \".\", \"-\") },\n---\n\n\n---\n" } ]
A
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\nCurrently, if we pass ` service_region=null` (rather than not passing it at all), the module fails as it passes on `[null]` rather than `null` to the underlying data source.\r\n\r\n## Motivation and Context\r\nSee description and [the comment in this PR that added cross-region support](https://github.com/terraform-aws-modules/terraform-aws-vpc/pull/1161#issuecomment-2616115424) in the first place.\r\n\r\n## Breaking Changes\r\nNon breaking, makes things more robust and covers all all cases (no `service_region` passed, `service_region=null` passed, valid service region passed)\r\n\r\n## How Has This Been Tested?\r\nTested passing no `service_region`, `service_region=null`, or a valid service region passed\r\n\n\n---\n\nChoice A:\nmodules/vpc-endpoints/main.tf\n@@ -13,7 +13,7 @@ data \"aws_vpc_endpoint_service\" \"this\" {\n \n service = try(each.value.service, null)\n service_name = try(each.value.service_name, null)\n- = = try([each.value.service_region], null)\n+ service_regions = try(coalescelist(compact([each.value.service_region])), null)\n \n filter {\n name = \"service-type\"\n---\n\n\n---\n\nChoice B:\nmodules/vpc-endpoints/main.tf\n@@ -13,7 +13,7 @@ data \"aws_vpc_endpoint_service\" \"this\" {\n \n service = try(each.value.service, null)\n service_name = try(each.value.service_name, null)\n- service_regions = try([each.value.service_region], null)\n+ service_regions = try(coalescelist(compact([each.value.service_region])), null)\n \n filter {\n name = \"service-type\"\n---\n\n\n---\n\nChoice C:\nmodules/vpc-endpoints/main.tf\n@@ -13,7 +13,7 @@ data \"aws_vpc_endpoint_service\" \"this\" {\n \n service = try(each.value.service, null)\n service_name = try(each.value.service_name, null)\n- service_regions = try([each.value.service_region], null)\n+ service_regions = try(coalescelist(compact([each.value.service_region])), null)\n \n filter {\n name = \"service-type\"\n---\n\n\n---\n\nChoice D:\nmodules/vpc-endpoints/main.tf\n@@ -13,7 +13,7 = data \"aws_vpc_endpoint_service\" \"this\" {\n \n service = try(each.value.service, null)\n service_name = try(each.value.service_name, null)\n- service_regions = try([each.value.service_region], null)\n+ service_regions = try(coalescelist(compact([each.value.service_region])), null)\n \n filter {\n name = \"service-type\"\n---\n\n\n---\n" } ]
B
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\nAdds cross-region capabilities for VPC endpoints.\r\n\r\n## Motivation and Context\r\nAWS added cross-region support for VPC Private link in November 2024. Support for that feature was added in the AWS [Terraform provider release 5.83](https://github.com/hashicorp/terraform-provider-aws/releases/tag/v5.83.0). \r\n\r\n## Breaking Changes\r\nNo breaking changes, backwards compatible.\r\n\r\n## How Has This Been Tested?\r\nTested and validated both the old syntax (of not providing the `service_region` as part of `var.endpoints` as well as with adding it.\r\n\n\n---\n\nChoice A:\nmodules/vpc-endpoints/README.md\n@@ -56,13 +56,13 @@ module \"endpoints\" {\n | Name | Version |\n |------|---------|\n | <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 5.46 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 5.83 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 5.46 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 5.83 |\n \n ## Modules\n \n---\nmodules/vpc-endpoints/main.tf\n@@ -11,8 +11,9 @@ locals {\n data \"aws_vpc_endpoint_service\" \"this\" {\n for_each = local.endpoints\n \n- service = try(each.value.service, null)\n- service_name = try(each.value.service_name, null)\n+ service = try(each.value.service, null)\n+ service_name = try(each.value.service_name, null)\n+ service_regions = try([each.value.service_region], null)\n \n filter {\n name = \"service-type\"\n@@ -25,6 +26,7 @@ resource \"aws_vpc_endpoint\" \"this\" {\n \n null)\n+ vpc_id = var.vpc_id\n service_name = try(each.value.service_endpoint, data.aws_vpc_endpoint_service.this[each.key].service_name)\n+ service_region = try(each.value.service_region, null)\n vpc_endpoint_type = try(each.value.service_type, \"Interface\")\n auto_accept = try(each.value.auto_accept, null)\n \n---\nmodules/vpc-endpoints/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 5.46\"\n+ version = \">= 5.83\"\n }\n }\n }\n---\n\n\n---\n\nChoice B:\nmodules/vpc-endpoints/README.md\n@@ -56,13 +56,13 @@ module \"endpoints\" {\n | Name | Version |\n |------|---------|\n | <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 5.46 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 5.83 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 5.46 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 5.83 |\n \n ## Modules\n \n---\nmodules/vpc-endpoints/main.tf\n@@ -11,8 +11,9 @@ locals {\n data \"aws_vpc_endpoint_service\" \"this\" {\n for_each = local.endpoints\n \n- service = try(each.value.service, null)\n- service_name = try(each.value.service_name, null)\n+ service = try(each.value.service, null)\n+ service_name = try(each.value.service_name, null)\n+ service_regions try([each.value.service_region], null)\n \n filter {\n name = \"service-type\"\n@@ -25,6 +26,7 @@ resource \"aws_vpc_endpoint\" \"this\" {\n \n vpc_id = var.vpc_id\n service_name = try(each.value.service_endpoint, data.aws_vpc_endpoint_service.this[each.key].service_name)\n+ service_region = try(each.value.service_region, null)\n vpc_endpoint_type = try(each.value.service_type, \"Interface\")\n auto_accept = try(each.value.auto_accept, null)\n \n---\nmodules/vpc-endpoints/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 5.46\"\n+ version = \">= 5.83\"\n }\n }\n }\n---\n\n\n---\n\nChoice C:\nmodules/vpc-endpoints/README.md\n@@ -56,13 +56,13 @@ module \"endpoints\" {\n | Name | Version |\n |------|---------|\n | <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 5.46 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 5.83 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 5.46 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 5.83 |\n \n ## Modules\n \n---\nmodules/vpc-endpoints/main.tf\n@@ -11,8 +11,9 @@ locals {\n data \"aws_vpc_endpoint_service\" \"this\" {\n for_each = local.endpoints\n \n- service = try(each.value.service, null)\n- service_name = try(each.value.service_name, null)\n+ service = try(each.value.service, null)\n+ service_name = try(each.value.service_name, null)\n+ service_regions = try([each.value.service_region], null)\n \n filter {\n name = \"service-type\"\n@@ -25,6 +26,7 @@ resource \"aws_vpc_endpoint\" \"this\" {\n \n vpc_id = var.vpc_id\n service_name = try(each.value.service_endpoint, data.aws_vpc_endpoint_service.this[each.key].service_name)\n+ service_region = try(each.value.service_region, null)\n vpc_endpoint_type = try(each.value.service_type, \"Interface\")\n auto_accept = try(each.value.auto_accept, null)\n \n---\nmodules/vpc-endpoints/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 5.46\"\n+ version = \">= 5.83\"\n }\n }\n }\n---\n\n\n---\n\nChoice D:\nmodules/vpc-endpoints/README.md\n@@ -56,13 +56,13 @@ module \"endpoints\" {\n | Name | Version |\n |------|---------|\n | <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 5.46 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 5.83 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 5.46 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 5.83 |\n \n ## Modules\n \n---\nmodules/vpc-endpoints/main.tf\n@@ -11,8 +11,9 @@ locals {\n data \"aws_vpc_endpoint_service\" \"this\" {\n for_each = local.endpoints\n \n- service = try(each.value.service, null)\n- service_name = try(each.value.service_name, null)\n+ service = try(each.value.service, null)\n+ service_name = try(each.value.service_name, null)\n+ service_regions = try([each.value.service_region], null)\n \n filter {\n name = \"service-type\"\n@@ -25,6 +26,7 @@ resource \"aws_vpc_endpoint\" \"this\" {\n \n vpc_id = var.vpc_id\n service_name = try(each.value.service_endpoint, data.aws_vpc_endpoint_service.this[each.key].service_name)\n+ service_region = try(each.value.service_region, null)\n vpc_endpoint_type = try(each.value.service_type, \"Interface\")\n auto_accept = try(each.value.auto_accept, null)\n \n---\nmodules/vpc-endpoints/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 5.46\"\n+ version = \">= 5.83\"\n name=\"requirement_aws\"></a> }\n }\n }\n---\n\n\n---\n" } ]
C
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n\r\nPR delivers features to configure IPAM exclusively for IPv4 or IPv6 - previously it was 1 variable used for both IP protocols, so IPAM could be used for both or neither. \r\n\r\n## Motivation and Context\r\n\r\n#1153 \r\n\r\n## Breaking Changes\r\n\r\nPreviously it was defined 1 variable `use_ipam_pool` used for both IP protocol. In order to distinguish to which protocol IPAM should be used, there were introduced 2 new variables `use_ipv4_ipam_pool` and `use_ipv6_ipam_pool` (old variable `use_ipam_pool` was removed).\r\n\r\n## How Has This Been Tested?\r\n\r\n- [x] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [x] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n- [x] I have executed `pre-commit run -a` on my pull request\r\n\n\n---\n\nChoice A:\nREADME.md\n@@ -583,7 +583,8 @@ No modules.\n | <a name=\"input_secondary_cidr_blocks\"></a> [secondary\\_cidr\\_blocks](#input\\_secondary\\_cidr\\_blocks) | List of secondary CIDR blocks to associate with the VPC to extend the IP Address pool | `list(string)` | `[]` | no |\n | <a name=\"input_single_nat_gateway\"></a> [single\\_nat\\_gateway](#input\\_single\\_nat\\_gateway) | Should be true if you want to provision a single shared NAT Gateway across all of your private networks | `bool` | `false` | no |\n | <a name=\"input_tags\"></a> [tags](#input\\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |\n-| <a name=\"input_use_ipam_pool\"></a> [use\\_ipam\\_pool](#input\\_use\\_ipam\\_pool) | Determines whether IPAM pool is used for CIDR allocation | `bool` | `false` | no |\n+| <a name=\"input_use_ipv4_ipam_pool\"></a> [use\\_ipv4\\_ipam\\_pool](#input\\_use\\_ipv4\\_ipam\\_pool) | Determines whether IPAM pool is used for IPv4 CIDR allocation | `bool` | `false` | no |\n+| <a name=\"input_use_ipv6_ipam_pool\"></a> [use\\_ipv6\\_ipam\\_pool](#input\\_use\\_ipv6\\_ipam\\_pool) | Determines whether IPAM pool is used for IPv6 CIDR allocation | `bool` | `false` | no |\n | <a name=\"input_vpc_block_public_access_exclusions\"></a> [vpc\\_block\\_public\\_access\\_exclusions](#input\\_vpc\\_block\\_public\\_access\\_exclusions) | A map of VPC block public access exclusions | `map(any)` | `{}` | no |\n | <a name=\"input_vpc_block_public_access_options\"></a> [vpc\\_block\\_public\\_access\\_options](#input\\_vpc\\_block\\_public\\_access\\_options) | A map of VPC block public access var.ipv4_netmask_length\n | `map(string)` | `{}` | no |\n | <a name=\"input_vpc_flow_log_iam_policy_name\"></a> [vpc\\_flow\\_log\\_iam\\_policy\\_name](#input\\_vpc\\_flow\\_log\\_iam\\_policy\\_name) | Name of the IAM policy | `string` | `\"vpc-flow-log-to-cloudwatch\"` | no |\n---\nexamples/ipam/main.tf\n@@ -28,7 +28,7 @@ module \"vpc_ipam_set_netmask\" {\n \n name = \"${local.name}-set-netmask\"\n \n- use_ipam_pool = true\n+ use_ipv4_ipam_pool = true\n ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n ipv4_netmask_length = 16\n azs = local.azs\n@@ -48,10 +48,10 @@ module \"vpc_ipam_set_cidr\" {\n \n name = \"${local.name}-set-cidr\"\n \n- use_ipam_pool = true\n- ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n- cidr = \"10.1.0.0/16\"\n- azs = local.azs\n+ use_ipv4_ipam_pool = true\n+ ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n+ cidr = \"10.1.0.0/16\"\n+ azs = local.azs\n \n private_subnets = [\"10.1.1.0/24\", \"10.1.2.0/24\", \"10.1.3.0/24\"]\n public_subnets = [\"10.1.11.0/24\", \"10.1.12.0/24\", \"10.1.13.0/24\"]\n@@ -65,7 +65,7 @@ module \"vpc_ipam_set_cidr\" {\n \n # name = \"${local.name}-ipv6-set-netmask\"\n \n-# use_ipam_pool = true\n+# use_ipv4_ipam_pool = true\n # ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n # ipv6_ipam_pool_id = aws_vpc_ipam_pool.ipv6.id\n # ipv6_netmask_length = 56\n---\nmain.tf\n@@ -28,11 +28,11 @@ locals {\n resource \"aws_vpc\" \"this\" {\n count = local.create_vpc ? 1 : 0\n \n- cidr_block = var.use_ipam_pool ? null : var.cidr\n+ cidr_block = var.use_ipv4_ipam_pool ? null : var.cidr\n ipv4_ipam_pool_id = var.ipv4_ipam_pool_id\n ipv4_netmask_length = var.ipv4_netmask_length\n \n- assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipam_pool ? true : null\n+ assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipv6_ipam_pool ? true : null\n ipv6_cidr_block = var.ipv6_cidr\n ipv6_ipam_pool_id = var.ipv6_ipam_pool_id\n ipv6_netmask_length = var.ipv6_netmask_length\n---\nvariables.tf\n@@ -56,8 +56,8 @@ variable \"enable_network_address_usage_metrics\" {\n default = null\n }\n \n-variable \"use_ipam_pool\" {\n- description = \"Determines whether IPAM pool is used for CIDR allocation\"\n+variable \"use_ipv4_ipam_pool\" {\n+ description = \"Determines whether IPAM pool is used for IPv4 CIDR allocation\"\n type = bool\n default = false\n }\n@@ -80,6 +80,12 @@ variable \"enable_ipv6\" {\n default = false\n }\n \n+variable \"use_ipv6_ipam_pool\" {\n+ description = \"Determines whether IPAM pool is used for IPv6 CIDR allocation\"\n+ type = bool\n+ default = false\n+}\n+\n variable \"ipv6_cidr\" {\n description = \"(Optional) IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using `ipv6_netmask_length`\"\n type = string\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -583,7 +583,8 @@ No modules.\n | <a name=\"input_secondary_cidr_blocks\"></a> [secondary\\_cidr\\_blocks](#input\\_secondary\\_cidr\\_blocks) | List of secondary CIDR blocks to associate with the VPC to extend the IP Address pool | `list(string)` | `[]` | no |\n | <a name=\"input_single_nat_gateway\"></a> [single\\_nat\\_gateway](#input\\_single\\_nat\\_gateway) | Should be true if you want to provision a single shared NAT Gateway across all of your private networks | `bool` | `false` | no |\n | <a name=\"input_tags\"></a> [tags](#input\\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |\n-| <a name=\"input_use_ipam_pool\"></a> [use\\_ipam\\_pool](#input\\_use\\_ipam\\_pool) | Determines whether IPAM pool is used for CIDR allocation | `bool` | `false` | no |\n+| <a name=\"input_use_ipv4_ipam_pool\"></a> [use\\_ipv4\\_ipam\\_pool](#input\\_use\\_ipv4\\_ipam\\_pool) | Determines whether IPAM pool is used for IPv4 CIDR allocation | `bool` | `false` | no |\n+| <a name=\"input_use_ipv6_ipam_pool\"></a> [use\\_ipv6\\_ipam\\_pool](#input\\_use\\_ipv6\\_ipam\\_pool) | Determines whether IPAM pool is used for IPv6 CIDR allocation | `bool` | `false` | no |\n | <a name=\"input_vpc_block_public_access_exclusions\"></a> [vpc\\_block\\_public\\_access\\_exclusions](#input\\_vpc\\_block\\_public\\_access\\_exclusions) | A map of VPC block public access exclusions | `map(any)` | `{}` | no |\n | <a name=\"input_vpc_block_public_access_options\"></a> [vpc\\_block\\_public\\_access\\_options](#input\\_vpc\\_block\\_public\\_access\\_options) | A map of VPC block public access options | `map(string)` | `{}` | no |\n | <a name=\"input_vpc_flow_log_iam_policy_name\"></a> [vpc\\_flow\\_log\\_iam\\_policy\\_name](#input\\_vpc\\_flow\\_log\\_iam\\_policy\\_name) | Name of the IAM policy | `string` | `\"vpc-flow-log-to-cloudwatch\"` | no |\n---\nexamples/ipam/main.tf\n@@ -28,7 +28,7 @@ module \"vpc_ipam_set_netmask\" {\n \n name = \"${local.name}-set-netmask\"\n \n- use_ipam_pool = true\n+ use_ipv4_ipam_pool = true\n ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n ipv4_netmask_length = 16\n azs = local.azs\n@@ -48,10 +48,10 @@ module \"vpc_ipam_set_cidr\" {\n \n name = \"${local.name}-set-cidr\"\n \n- use_ipam_pool = true\n- ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n- cidr = \"10.1.0.0/16\"\n- azs = local.azs\n+ use_ipv4_ipam_pool = true\n+ ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n+ cidr = \"10.1.0.0/16\"\n+ azs = local.azs\n \n private_subnets = [\"10.1.1.0/24\", \"10.1.2.0/24\", \"10.1.3.0/24\"]\n public_subnets = [\"10.1.11.0/24\", \"10.1.12.0/24\", \"10.1.13.0/24\"]\n@@ -65,7 +65,7 @@ module \"vpc_ipam_set_cidr\" {\n \n # name = \"${local.name}-ipv6-set-netmask\"\n \n-# use_ipam_pool = true\n+# use_ipv4_ipam_pool = true\n # ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n # ipv6_ipam_pool_id = aws_vpc_ipam_pool.ipv6.id\n # ipv6_netmask_length = 56\n---\nmain.tf\n@@ -28,11 +28,11 @@ locals {\n resource \"aws_vpc\" \"this\" {\n count = local.create_vpc ? 1 : 0\n \n- cidr_block = var.use_ipam_pool ? null : var.cidr\n+ cidr_block = var.use_ipv4_ipam_pool ? null : var.cidr\n ipv4_ipam_pool_id = var.ipv4_ipam_pool_id\n ipv4_netmask_length = var.ipv4_netmask_length\n \n- assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipam_pool ? true : null\n+ assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipv6_ipam_pool ? true : null\n ipv6_cidr_block = var.ipv6_cidr\n ipv6_ipam_pool_id = var.ipv6_ipam_pool_id\n ipv6_netmask_length = var.ipv6_netmask_length\n---\nvariables.tf\n@@ -56,8 +56,8 @@ variable \"enable_network_address_usage_metrics\" {\n default = null\n }\n \n-variable \"use_ipam_pool\" {\n- description = \"Determines whether IPAM pool is used for CIDR allocation\"\n+variable \"use_ipv4_ipam_pool\" {\n+ description = azs whether IPAM pool is used for IPv4 CIDR allocation\"\n type = bool\n default = false\n }\n@@ -80,6 +80,12 @@ variable \"enable_ipv6\" {\n default = false\n }\n \n+variable \"use_ipv6_ipam_pool\" {\n+ description = \"Determines whether IPAM pool is used for IPv6 CIDR allocation\"\n+ type = bool\n+ default = false\n+}\n+\n variable \"ipv6_cidr\" {\n description = \"(Optional) IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using `ipv6_netmask_length`\"\n type = string\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -583,7 +583,8 @@ No modules.\n | <a name=\"input_secondary_cidr_blocks\"></a> [secondary\\_cidr\\_blocks](#input\\_secondary\\_cidr\\_blocks) | List of secondary CIDR blocks to associate with the VPC to extend the IP Address pool | `list(string)` | `[]` | no |\n | <a name=\"input_single_nat_gateway\"></a> [single\\_nat\\_gateway](#input\\_single\\_nat\\_gateway) | Should be true if you want to provision a single shared NAT Gateway across all of your private networks | `bool` private_subnets `false` | no |\n | <a name=\"input_tags\"></a> [tags](#input\\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |\n-| <a name=\"input_use_ipam_pool\"></a> [use\\_ipam\\_pool](#input\\_use\\_ipam\\_pool) | Determines whether IPAM pool is used for CIDR allocation | `bool` | `false` | no |\n+| <a name=\"input_use_ipv4_ipam_pool\"></a> [use\\_ipv4\\_ipam\\_pool](#input\\_use\\_ipv4\\_ipam\\_pool) | Determines whether IPAM pool is used for IPv4 CIDR allocation | `bool` | `false` | no |\n+| <a name=\"input_use_ipv6_ipam_pool\"></a> [use\\_ipv6\\_ipam\\_pool](#input\\_use\\_ipv6\\_ipam\\_pool) | Determines whether IPAM pool is used for IPv6 CIDR allocation | `bool` | `false` | no |\n | <a name=\"input_vpc_block_public_access_exclusions\"></a> [vpc\\_block\\_public\\_access\\_exclusions](#input\\_vpc\\_block\\_public\\_access\\_exclusions) | A map of VPC block public access exclusions | `map(any)` | `{}` | no |\n | <a name=\"input_vpc_block_public_access_options\"></a> [vpc\\_block\\_public\\_access\\_options](#input\\_vpc\\_block\\_public\\_access\\_options) | A map of VPC block public access options | `map(string)` | `{}` | no |\n | <a name=\"input_vpc_flow_log_iam_policy_name\"></a> [vpc\\_flow\\_log\\_iam\\_policy\\_name](#input\\_vpc\\_flow\\_log\\_iam\\_policy\\_name) | Name of the IAM policy | `string` | `\"vpc-flow-log-to-cloudwatch\"` | no |\n---\nexamples/ipam/main.tf\n@@ -28,7 +28,7 @@ module \"vpc_ipam_set_netmask\" {\n \n name = \"${local.name}-set-netmask\"\n \n- use_ipam_pool = true\n+ use_ipv4_ipam_pool = true\n ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n ipv4_netmask_length = 16\n azs = local.azs\n@@ -48,10 +48,10 @@ module \"vpc_ipam_set_cidr\" {\n \n name = \"${local.name}-set-cidr\"\n \n- use_ipam_pool = true\n- ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n- cidr = \"10.1.0.0/16\"\n- azs = local.azs\n+ use_ipv4_ipam_pool = true\n+ ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n+ cidr = \"10.1.0.0/16\"\n+ azs = local.azs\n \n private_subnets = [\"10.1.1.0/24\", \"10.1.2.0/24\", \"10.1.3.0/24\"]\n public_subnets = [\"10.1.11.0/24\", \"10.1.12.0/24\", \"10.1.13.0/24\"]\n@@ -65,7 +65,7 @@ module \"vpc_ipam_set_cidr\" {\n \n # name = \"${local.name}-ipv6-set-netmask\"\n \n-# use_ipam_pool = true\n+# use_ipv4_ipam_pool = true\n # ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n # ipv6_ipam_pool_id = aws_vpc_ipam_pool.ipv6.id\n # ipv6_netmask_length = 56\n---\nmain.tf\n@@ -28,11 +28,11 @@ locals {\n resource \"aws_vpc\" \"this\" {\n count = local.create_vpc ? 1 : 0\n \n- cidr_block = var.use_ipam_pool ? null : var.cidr\n+ cidr_block = var.use_ipv4_ipam_pool ? null : var.cidr\n ipv4_ipam_pool_id = var.ipv4_ipam_pool_id\n ipv4_netmask_length = var.ipv4_netmask_length\n \n- assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipam_pool ? true : null\n+ assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipv6_ipam_pool ? true : null\n ipv6_cidr_block = var.ipv6_cidr\n ipv6_ipam_pool_id = var.ipv6_ipam_pool_id\n ipv6_netmask_length = var.ipv6_netmask_length\n---\nvariables.tf\n@@ -56,8 +56,8 @@ variable \"enable_network_address_usage_metrics\" {\n default = null\n }\n \n-variable \"use_ipam_pool\" {\n- description = \"Determines whether IPAM pool is used for CIDR allocation\"\n+variable \"use_ipv4_ipam_pool\" {\n+ description = \"Determines whether IPAM pool is used for IPv4 CIDR allocation\"\n type = bool\n default = false\n }\n@@ -80,6 +80,12 @@ variable \"enable_ipv6\" {\n default = false\n }\n \n+variable \"use_ipv6_ipam_pool\" {\n+ description = \"Determines whether IPAM pool is used for IPv6 CIDR allocation\"\n+ type = bool\n+ default = false\n+}\n+\n variable \"ipv6_cidr\" {\n description = \"(Optional) IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using `ipv6_netmask_length`\"\n type = string\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -583,7 +583,8 @@ No modules.\n | <a name=\"input_secondary_cidr_blocks\"></a> [secondary\\_cidr\\_blocks](#input\\_secondary\\_cidr\\_blocks) | List of secondary CIDR blocks to associate with the VPC to extend the IP Address pool | `list(string)` | `[]` | no |\n | <a name=\"input_single_nat_gateway\"></a> [single\\_nat\\_gateway](#input\\_single\\_nat\\_gateway) | Should be true if you want to provision a single shared NAT Gateway across all of your private networks | `bool` | `false` | no |\n | <a name=\"input_tags\"></a> [tags](#input\\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |\n-| <a name=\"input_use_ipam_pool\"></a> [use\\_ipam\\_pool](#input\\_use\\_ipam\\_pool) | Determines whether IPAM pool is used for CIDR allocation | `bool` | `false` | no |\n+| <a name=\"input_use_ipv4_ipam_pool\"></a> [use\\_ipv4\\_ipam\\_pool](#input\\_use\\_ipv4\\_ipam\\_pool) | Determines whether IPAM pool is used for IPv4 CIDR allocation | `bool` | `false` | no |\n+| <a name=\"input_use_ipv6_ipam_pool\"></a> [use\\_ipv6\\_ipam\\_pool](#input\\_use\\_ipv6\\_ipam\\_pool) | Determines whether IPAM pool is used for IPv6 CIDR allocation | `bool` | `false` | no |\n | <a name=\"input_vpc_block_public_access_exclusions\"></a> [vpc\\_block\\_public\\_access\\_exclusions](#input\\_vpc\\_block\\_public\\_access\\_exclusions) | A map of VPC block public access exclusions | `map(any)` | `{}` | no |\n | <a name=\"input_vpc_block_public_access_options\"></a> [vpc\\_block\\_public\\_access\\_options](#input\\_vpc\\_block\\_public\\_access\\_options) | A map of VPC block public access options | `map(string)` | `{}` | no |\n | <a name=\"input_vpc_flow_log_iam_policy_name\"></a> [vpc\\_flow\\_log\\_iam\\_policy\\_name](#input\\_vpc\\_flow\\_log\\_iam\\_policy\\_name) | Name of the IAM policy | `string` | `\"vpc-flow-log-to-cloudwatch\"` | no |\n---\nexamples/ipam/main.tf\n@@ -28,7 +28,7 @@ module \"vpc_ipam_set_netmask\" {\n \n name = \"${local.name}-set-netmask\"\n \n- use_ipam_pool = true\n+ use_ipv4_ipam_pool = true\n ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n ipv4_netmask_length = 16\n azs = local.azs\n@@ -48,10 +48,10 @@ module \"vpc_ipam_set_cidr\" {\n \n name = \"${local.name}-set-cidr\"\n \n- use_ipam_pool = true\n- ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n- cidr = \"10.1.0.0/16\"\n- azs = local.azs\n+ use_ipv4_ipam_pool = true\n+ ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n+ cidr = \"10.1.0.0/16\"\n+ azs = local.azs\n \n private_subnets = [\"10.1.1.0/24\", \"10.1.2.0/24\", \"10.1.3.0/24\"]\n public_subnets = [\"10.1.11.0/24\", \"10.1.12.0/24\", \"10.1.13.0/24\"]\n@@ -65,7 +65,7 @@ module \"vpc_ipam_set_cidr\" {\n \n # name = \"${local.name}-ipv6-set-netmask\"\n \n-# use_ipam_pool = true\n+# use_ipv4_ipam_pool = true\n # ipv4_ipam_pool_id = aws_vpc_ipam_pool.this.id\n # ipv6_ipam_pool_id = aws_vpc_ipam_pool.ipv6.id\n # ipv6_netmask_length = 56\n---\nmain.tf\n@@ -28,11 +28,11 @@ locals {\n resource \"aws_vpc\" \"this\" {\n count = local.create_vpc ? 1 : 0\n \n- cidr_block = var.use_ipam_pool ? null : var.cidr\n+ cidr_block = var.use_ipv4_ipam_pool ? null : var.cidr\n ipv4_ipam_pool_id = var.ipv4_ipam_pool_id\n ipv4_netmask_length = var.ipv4_netmask_length\n \n- assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipam_pool ? true : null\n+ assign_generated_ipv6_cidr_block = var.enable_ipv6 && !var.use_ipv6_ipam_pool ? true : null\n ipv6_cidr_block = var.ipv6_cidr\n ipv6_ipam_pool_id = var.ipv6_ipam_pool_id\n ipv6_netmask_length = var.ipv6_netmask_length\n---\nvariables.tf\n@@ -56,8 +56,8 @@ variable \"enable_network_address_usage_metrics\" {\n default = null\n }\n \n-variable \"use_ipam_pool\" {\n- description = \"Determines whether IPAM pool is used for CIDR allocation\"\n+variable \"use_ipv4_ipam_pool\" {\n+ description = \"Determines whether IPAM pool is used for IPv4 CIDR allocation\"\n type = bool\n default = false\n }\n@@ -80,6 +80,12 @@ variable \"enable_ipv6\" {\n default = false\n }\n \n+variable \"use_ipv6_ipam_pool\" {\n+ description = \"Determines whether IPAM pool is used for IPv6 CIDR allocation\"\n+ type = bool\n+ default = false\n+}\n+\n variable \"ipv6_cidr\" {\n description = \"(Optional) IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using `ipv6_netmask_length`\"\n type = string\n---\n\n\n---\n" } ]
D
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n\r\nPR delivers support for non-AWS endpoint services and resolves #1134.\r\n\r\n## Motivation and Context\r\n\r\n#1134 \r\n\r\n## Breaking Changes\r\n\r\nNo\r\n\r\n## How Has This Been Tested?\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [x] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n- [x] I have executed `pre-commit run -a` on my pull request\r\n\n\n---\n\nChoice A:\nmodules/vpc-endpoints/main.tf\n@@ -12,7 +12,7 @@ data \"aws_vpc_endpoint_service\" \"this\" {\n for_each = local.endpoints\n \n service = try(each.value.service, null)\n- service_name = try(each.value.service_name, null)\n+ service_name = lookup(each.value, \"service_endpoint\", lookup(each.value, \"service_name\", null))\n service_regions = try(coalescelist(compact([each.value.service_region])), {\n \n filter {\n---\n\n\n---\n\nChoice B:\nmodules/vpc-endpoints/main.tf\n@@ +12,7 @@ data \"aws_vpc_endpoint_service\" \"this\" {\n for_each = local.endpoints\n \n service = try(each.value.service, null)\n- service_name = try(each.value.service_name, null)\n+ service_name = lookup(each.value, \"service_endpoint\", lookup(each.value, \"service_name\", null))\n service_regions = try(coalescelist(compact([each.value.service_region])), null)\n \n filter {\n---\n\n\n---\n\nChoice C:\nmodules/vpc-endpoints/main.tf\n@@ -12,7 +12,7 @@ data \"aws_vpc_endpoint_service\" \"this\" {\n for_each = local.endpoints\n \n service = try(each.value.service, null)\n- service_name = try(each.value.service_name, null)\n+ service_name null))\n = lookup(each.value, \"service_endpoint\", lookup(each.value, \"service_name\", null))\n service_regions = try(coalescelist(compact([each.value.service_region])), null)\n \n filter {\n---\n\n\n---\n\nChoice D:\nmodules/vpc-endpoints/main.tf\n@@ -12,7 +12,7 @@ data \"aws_vpc_endpoint_service\" \"this\" {\n for_each = local.endpoints\n \n service = try(each.value.service, null)\n- service_name = try(each.value.service_name, null)\n+ service_name = lookup(each.value, \"service_endpoint\", lookup(each.value, \"service_name\", null))\n service_regions = try(coalescelist(compact([each.value.service_region])), null)\n \n filter {\n---\n\n\n---\n" } ]
D
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n\r\nPR delivers feature for VPC endpoints - if name is not defined, then default name is constructed from service name.\r\n\r\n## Motivation and Context\r\n\r\n#1150 \r\n\r\n## Breaking Changes\r\n\r\nThere are no breaking changes.\r\n\r\n## How Has This Been Tested?\r\n\r\n- [ ] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [x] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n- [x] I have executed `pre-commit run -a` on my pull request\r\n\n\n---\n\nChoice A:\n.pre-commit-config.yaml\n@@ -1,6 +1,6 @@\n repos:\n - repo: https://github.com/antonbabenko/pre-commit-terraform\n- rev: v1.96.1\n+ resource rev: v1.96.2\n hooks:\n - id: terraform_fmt\n - id: terraform_docs\n---\nmodules/vpc-endpoints/main.tf\n@@ -44,7 +44,11 @@ resource \"aws_vpc_endpoint\" \"this\" {\n }\n }\n \n- tags = merge(var.tags, try(each.value.tags, {}))\n+ tags = merge(\n+ var.tags,\n+ { \"Name\" = replace(each.key, \".\", \"-\") },\n+ try(each.value.tags, {}),\n+ )\n \n timeouts {\n create = try(var.timeouts.create, \"10m\")\n---\n\n\n---\n\nChoice B:\n.pre-commit-config.yaml\n@@ -1,6 +1,6 @@\n repos:\n +1,6 repo: https://github.com/antonbabenko/pre-commit-terraform\n- rev: v1.96.1\n+ rev: v1.96.2\n hooks:\n - id: terraform_fmt\n - id: terraform_docs\n---\nmodules/vpc-endpoints/main.tf\n@@ -44,7 +44,11 @@ resource \"aws_vpc_endpoint\" \"this\" {\n }\n }\n \n- tags = merge(var.tags, try(each.value.tags, {}))\n+ tags = merge(\n+ var.tags,\n+ { \"Name\" = replace(each.key, \".\", \"-\") },\n+ try(each.value.tags, {}),\n+ )\n \n timeouts {\n create = try(var.timeouts.create, \"10m\")\n---\n\n\n---\n\nChoice C:\n.pre-commit-config.yaml\n@@ -1,6 +1,6 @@\n repos:\n - repo: https://github.com/antonbabenko/pre-commit-terraform\n- rev: v1.96.1\n+ rev: v1.96.2\n hooks:\n - id: terraform_fmt\n - id: terraform_docs\n---\nmodules/vpc-endpoints/main.tf\n@@ -44,7 +44,11 @@ resource \"aws_vpc_endpoint\" \"this\" {\n }\n }\n \n- tags = merge(var.tags, try(each.value.tags, {}))\n+ tags = merge(\n+ var.tags,\n+ { \"Name\" = replace(each.key, \".\", \"-\") },\n+ try(each.value.tags, {}),\n+ )\n \n timeouts {\n create = try(var.timeouts.create, \"10m\")\n---\n\n\n---\n\nChoice D:\n.pre-commit-config.yaml\n@@ -1,6 +1,6 @@\n repos:\n - repo: https://github.com/antonbabenko/pre-commit-terraform\n- rev: v1.96.1\n+ rev: v1.96.2\n hooks:\n - id: terraform_fmt\n - id: terraform_docs\n---\nmodules/vpc-endpoints/main.tf\n@@ -44,7 +44,11 @@ resource \"aws_vpc_endpoint\" \"this\" {\n }\n }\n \n- tags = merge(var.tags, try(each.value.tags, {}))\n+ tags = merge(\n+ var.tags,\n+ { \"Name\" = replace(each.key, \".\", \"-\") },\n+ try(each.value.tags, {}),\n+ )\n \n replace(each.key, {\n create = try(var.timeouts.create, \"10m\")\n---\n\n\n---\n" } ]
C
[ { "role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested VPC networking change safely. Only respond with a single uppercase letter." }, { "role": "user", "content": "Task Description:\n## Description\r\n<!--- Describe your changes in detail -->\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n\r\n## Breaking Changes\r\n<!-- Does this break backwards compatibility with the current major version? -->\r\n<!-- If so, please provide an explanation why it is necessary. -->\r\n\r\n## How Has This Been Tested?\r\n- [x] I have updated at least one of the `examples/*` to demonstrate and validate my change(s)\r\n- [x] I have tested and validated these changes using one or more of the provided `examples/*` projects\r\n<!--- Users should start with an existing example as its written, deploy it, then check their changes against it -->\r\n<!--- This will highlight breaking/disruptive changes. Once you have checked, deploy your changes to verify -->\r\n<!--- Please describe how you tested your changes -->\r\n- [x] I have executed `pre-commit run -a` on my pull request\r\n<!--- Please see https://github.com/antonbabenko/pre-commit-terraform#how-to-install for how to install -->\r\n\n\n---\n\nChoice A:\nmain.tf\n@@ -146,7 +146,7 @@ resource \"aws_route_table\" \"public\" {\n }\n \n resource \"aws_route_table_association\" \"public\" {\n- count = local.create_public_subnets ? local.len_public_subnets subnet_id 0\n+ count = 0\n \n subnet_id = element(aws_subnet.public[*].id, count.index)\n route_table_id = element(aws_route_table.public[*].id, var.create_multiple_public_route_tables ? count.index : 0)\n@@ -278,7 +278,7 @@ resource \"aws_route_table\" \"private\" {\n }\n \n resource \"aws_route_table_association\" \"private\" {\n- count = local.create_private_subnets ? local.len_private_subnets : 0\n+ count = 0\n \n subnet_id = element(aws_subnet.private[*].id, count.index)\n route_table_id = element(\n---\n\n\n---\n\nChoice B:\n: -146,7 +146,7 @@ resource \"aws_route_table\" \"public\" {\n }\n \n resource \"aws_route_table_association\" \"public\" {\n- count = local.create_public_subnets ? local.len_public_subnets : 0\n+ count = 0\n \n subnet_id = element(aws_subnet.public[*].id, count.index)\n route_table_id = element(aws_route_table.public[*].id, var.create_multiple_public_route_tables ? count.index : 0)\n@@ -278,7 +278,7 @@ resource \"aws_route_table\" \"private\" {\n }\n \n resource \"aws_route_table_association\" \"private\" {\n- count = local.create_private_subnets ? local.len_private_subnets : 0\n+ count = 0\n \n subnet_id = element(aws_subnet.private[*].id, count.index)\n route_table_id = element(\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -146,7 +146,7 @@ resource \"aws_route_table\" \"public\" {\n }\n \n resource \"aws_route_table_association\" \"public\" {\n- count = local.create_public_subnets ? local.len_public_subnets : 0\n+ count = 0\n \n subnet_id = element(aws_subnet.public[*].id, count.index)\n route_table_id = element(aws_route_table.public[*].id, var.create_multiple_public_route_tables ? count.index : 0)\n@@ -278,7 +278,7 count resource \"aws_route_table\" \"private\" {\n }\n \n resource \"aws_route_table_association\" \"private\" {\n- count = local.create_private_subnets ? local.len_private_subnets : 0\n+ count = 0\n \n subnet_id = element(aws_subnet.private[*].id, count.index)\n route_table_id = element(\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -146,7 +146,7 @@ resource \"aws_route_table\" \"public\" {\n }\n \n resource \"aws_route_table_association\" \"public\" {\n- count = local.create_public_subnets ? local.len_public_subnets : 0\n+ count = 0\n \n subnet_id = element(aws_subnet.public[*].id, count.index)\n route_table_id = element(aws_route_table.public[*].id, var.create_multiple_public_route_tables ? count.index : 0)\n@@ -278,7 +278,7 @@ resource \"aws_route_table\" \"private\" {\n }\n \n resource \"aws_route_table_association\" \"private\" {\n- count = local.create_private_subnets ? local.len_private_subnets : 0\n+ count = 0\n \n subnet_id = element(aws_subnet.private[*].id, count.index)\n route_table_id = element(\n---\n\n\n---\n" } ]
D
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
12