input
listlengths 2
2
| ideal
stringclasses 4
values |
|---|---|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\nChange module source path to iam-role\r\n\r\n## Motivation and Context\r\nExample was misleading.\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/iam-role/README.md\n@@ -10,7 +10,7 @@ The defaults provided by the module are suitable for GitHub Free, Pro, & Team, i\n \n ```hcl\n module \"iam_oidc_role\" {\n- source = \"terraform-aws-modules/iam/aws//modules/iam-oidc-role\"\n+ source = \"terraform-aws-modules/iam/aws//modules/iam-role\"\n \n enable_github_oidc = true\n \n@@ -33,7 +33,7 @@ For GitHub Enterprise Server, users will need to provide value for the `oidc_aud\n \n ```hcl\n module \"iam_oidc_role\" {\n- source = \"terraform-aws-modules/iam/aws//modules/iam-oidc-role\"\n+ source = \"terraform-aws-modules/iam/aws//modules/iam-role\"\n \n enable_github_oidc = true\n \n---\n\n\n---\n\nChoice B:\nmodules/iam-role/README.md\n@@ -10,7 +10,7 @@ The defaults provided by the module are suitable for GitHub Free, Pro, & Team, i\n \n ```hcl\n module \"iam_oidc_role\" {\n- source = \"terraform-aws-modules/iam/aws//modules/iam-oidc-role\"\n+ source = \n enable_github_oidc = true\n \n@@ -33,7 +33,7 @@ For GitHub Enterprise Server, users will need to provide value for the `oidc_aud\n \n ```hcl\n module \"iam_oidc_role\" {\n- source = \"terraform-aws-modules/iam/aws//modules/iam-oidc-role\"\n+ source = \"terraform-aws-modules/iam/aws//modules/iam-role\"\n \n enable_github_oidc = true\n \n---\n\n\n---\n\nChoice C:\nmodules/iam-role/README.md\n@@ -10,7 +10,7 @@ The defaults provided by the module enable_github_oidc suitable for GitHub Free, Pro, & Team, i\n \n ```hcl\n module \"iam_oidc_role\" {\n- source = \"terraform-aws-modules/iam/aws//modules/iam-oidc-role\"\n+ source = \"terraform-aws-modules/iam/aws//modules/iam-role\"\n \n enable_github_oidc = true\n \n@@ -33,7 +33,7 @@ For GitHub Enterprise Server, users will need to provide value for the `oidc_aud\n \n ```hcl\n module \"iam_oidc_role\" {\n- source = \"terraform-aws-modules/iam/aws//modules/iam-oidc-role\"\n+ source = \"terraform-aws-modules/iam/aws//modules/iam-role\"\n \n enable_github_oidc = true\n \n---\n\n\n---\n\nChoice D:\nmodules/iam-role/README.md\n@@ -10,7 +10,7 @@ The defaults provided by the module are suitable for GitHub Free, Pro, & Team, i\n \n ```hcl\n module \"iam_oidc_role\" {\n- source = \"terraform-aws-modules/iam/aws//modules/iam-oidc-role\"\n+ source = \"terraform-aws-modules/iam/aws//modules/iam-role\"\n \n enable_github_oidc = true\n \n@@ -33,7 +33,7 @@ For GitHub Enterprise Server, users will need to provide value for the `oidc_aud\n \n ```hcl\n module \"iam_oidc_role\" {\n- source = \"terraform-aws-modules/iam/aws//modules/iam-oidc-role\"\n+ source users \"terraform-aws-modules/iam/aws//modules/iam-role\"\n \n enable_github_oidc = true\n \n---\n\n\n---\n"
}
] |
A
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\nAdds an example of an IAM role with an inline policy and demonstrates the need for a trust policy \r\n\r\n## Motivation and Context\r\n\r\nProvides a documented working sample for:\r\n- https://github.com/terraform-aws-modules/terraform-aws-iam/issues/611\r\n- https://github.com/terraform-aws-modules/terraform-aws-iam/issues/612\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- [x] I have executed `pre-commit run -a` on my pull request\n\n---\n\nChoice A:\nexamples/iam-role/README.md\n@@ -35,6 +35,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_iam_role_circleci_oidc\"></a> [iam\\_role\\_circleci\\_oidc](#module\\_iam\\_role\\_circleci\\_oidc) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_disabled\"></a> [iam\\_role\\_disabled](#module\\_iam\\_role\\_disabled) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_github_oidc\"></a> [iam\\_role\\_github\\_oidc](#module\\_iam\\_role\\_github\\_oidc) | ../../modules/iam-role | n/a |\n+| <a name=\"module_iam_role_inline_policy\"></a> [iam\\_role\\_inline\\_policy](#module\\_iam\\_role\\_inline\\_policy) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_instance_profile\"></a> [iam\\_role\\_instance\\_profile](#module\\_iam\\_role\\_instance\\_profile) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_saml\"></a> [iam\\_role\\_saml](#module\\_iam\\_role\\_saml) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_roles\"></a> [iam\\_roles](#module\\_iam\\_roles) | ../../modules/iam-role | n/a |\n@@ -69,6 +70,13 @@ No inputs.\n | <a name=\"output_github_oidc_iam_role_arn\"></a> [github\\_oidc\\_iam\\_role\\_arn](#output\\_github\\_oidc\\_iam\\_role\\_arn) | The Amazon Resource Name (ARN) specifying the IAM role |\n | <a name=\"output_github_oidc_iam_role_name\"></a> [github\\_oidc\\_iam\\_role\\_name](#output\\_github\\_oidc\\_iam\\_role\\_name) | The name of the IAM role |\n | <a name=\"output_github_oidc_iam_role_unique_id\"></a> [github\\_oidc\\_iam\\_role\\_unique\\_id](#output\\_github\\_oidc\\_iam\\_role\\_unique\\_id) | Stable and unique string identifying the IAM role |\n+| <a name=\"output_inline_policy_iam_instance_profile_arn\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_arn](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_arn) | ARN assigned by AWS to the instance profile |\n+| <a name=\"output_inline_policy_iam_instance_profile_id\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_id](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_id) | Instance profile's ID |\n+| <a name=\"output_inline_policy_iam_instance_profile_name\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_name](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_name) | Name of IAM instance profile |\n+| <a name=\"output_inline_policy_iam_instance_profile_unique_id\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_unique\\_id](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_unique\\_id) | Stable and unique string identifying the IAM instance profile |\n+| <a name=\"output_inline_policy_iam_role_arn\"></a> [inline\\_policy\\_iam\\_role\\_arn](#output\\_inline\\_policy\\_iam\\_role\\_arn) | The Amazon Resource Name (ARN) specifying the IAM role |\n+| <a name=\"output_inline_policy_iam_role_name\"></a> [inline\\_policy\\_iam\\_role\\_name](#output\\_inline\\_policy\\_iam\\_role\\_name) | The name of the IAM role |\n+| <a name=\"output_inline_policy_iam_role_unique_id\"></a> [inline\\_policy\\_iam\\_role\\_unique\\_id](#output\\_inline\\_policy\\_iam\\_role\\_unique\\_id) | Stable and unique string identifying the IAM role |\n | <a name=\"output_instance_profile_iam_instance_profile_arn\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_arn](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_arn) | ARN assigned by AWS to the instance profile |\n | <a name=\"output_instance_profile_iam_instance_profile_id\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_id](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_id) | Instance profile's ID |\n | <a name=\"output_instance_profile_iam_instance_profile_name\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_name](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_name) | Name of IAM instance profile |\n---\nexamples/iam-role/main.tf\n@@ -187,6 +187,48 @@ module \"iam_role_saml\" {\n tags = local.tags\n }\n \n+################################################################################\n+# IAM Role - Inline Policy\n+################################################################################\n+\n+module \"iam_role_inline_policy\" {\n+ source = \"../../modules/iam-role\"\n+\n+ name = \"${local.name}-inline-policy\"\n+\n+ create_instance_profile = true\n+\n+ trust_policy_permissions = {\n+ ec2 = {\n+ effect = \"Allow\"\n+ actions = [\n+ \"sts:AssumeRole\"\n+ ]\n+ principals = [{\n+ type = \"Service\"\n+ identifiers = [\"ec2.amazonaws.com\"]\n+ }]\n+ }\n+ }\n+\n+ create_inline_policy = true\n+ inline_policy_permissions = {\n+ S3ReadAccess = {\n+ effect = \"Allow\"\n+ actions = [\n+ \"s3:GetObject\",\n+ \"s3:ListBucket\"\n+ ]\n+ resources = [\n+ \"arn:aws:s3:::example-bucket\",\n+ \"arn:aws:s3:::example-bucket/*\"\n+ ]\n+ }\n+ }\n+\n+ tags = local.tags\n+}\n+\n ################################################################################\n # Supporting resources\n ################################################################################\n---\nexamples/iam-role/outputs.tf\n@@ -153,3 +153,42 @@ output \"saml_iam_instance_profile_unique_id\" {\n description = \"Stable and unique string identifying the IAM instance profile\"\n value = module.iam_role_saml.instance_profile_unique_id\n }\n+\n+################################################################################\n+# IAM Role - Inline Policy\n+################################################################################\n+\n+output \"inline_policy_iam_role_name\" {\n+ description = \"The name of the IAM role\"\n+ value = module.iam_role_inline_policy.name\n+}\n+\n+output \"inline_policy_iam_role_arn\" {\n+ description = \"The Amazon Resource Name (ARN) specifying the IAM role\"\n+ value = module.iam_role_inline_policy.arn\n+}\n+\n+output \"inline_policy_iam_role_unique_id\" {\n+ description = \"Stable and unique string identifying the IAM role\"\n+ value = module.iam_role_inline_policy.unique_id\n+}\n+\n+output \"inline_policy_iam_instance_profile_arn\" {\n+ description = \"ARN assigned by AWS to the instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_arn\n+}\n+\n+output \"inline_policy_iam_instance_profile_id\" {\n+ description = \"Instance profile's ID\"\n+ value = module.iam_role_inline_policy.instance_profile_id\n+}\n+\n+output \"inline_policy_iam_instance_profile_name\" {\n+ description = \"Name of IAM instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_name\n+}\n+\n+output \"inline_policy_iam_instance_profile_unique_id\" {\n+ description = \"Stable and unique string identifying the IAM instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_unique_id\n+}\n---\n\n\n---\n\nChoice B:\nexamples/iam-role/README.md\n@@ -35,6 +35,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_iam_role_circleci_oidc\"></a> [iam\\_role\\_circleci\\_oidc](#module\\_iam\\_role\\_circleci\\_oidc) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_disabled\"></a> [iam\\_role\\_disabled](#module\\_iam\\_role\\_disabled) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_github_oidc\"></a> [iam\\_role\\_github\\_oidc](#module\\_iam\\_role\\_github\\_oidc) | ../../modules/iam-role | n/a |\n+| <a name=\"module_iam_role_inline_policy\"></a> [iam\\_role\\_inline\\_policy](#module\\_iam\\_role\\_inline\\_policy) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_instance_profile\"></a> [iam\\_role\\_instance\\_profile](#module\\_iam\\_role\\_instance\\_profile) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_saml\"></a> [iam\\_role\\_saml](#module\\_iam\\_role\\_saml) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_roles\"></a> [iam\\_roles](#module\\_iam\\_roles) | ../../modules/iam-role | n/a |\n@@ -69,6 +70,13 @@ No inputs.\n | <a name=\"output_github_oidc_iam_role_arn\"></a> [github\\_oidc\\_iam\\_role\\_arn](#output\\_github\\_oidc\\_iam\\_role\\_arn) | The Amazon Resource Name (ARN) specifying the IAM role |\n | <a name=\"output_github_oidc_iam_role_name\"></a> [github\\_oidc\\_iam\\_role\\_name](#output\\_github\\_oidc\\_iam\\_role\\_name) | The name of the IAM role |\n | <a name=\"output_github_oidc_iam_role_unique_id\"></a> [github\\_oidc\\_iam\\_role\\_unique\\_id](#output\\_github\\_oidc\\_iam\\_role\\_unique\\_id) | Stable and unique string identifying the IAM role |\n+| <a name=\"output_inline_policy_iam_instance_profile_arn\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_arn](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_arn) | ARN assigned by AWS to the instance profile |\n+| <a name=\"output_inline_policy_iam_instance_profile_id\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_id](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_id) | Instance profile's ID |\n+| <a name=\"output_inline_policy_iam_instance_profile_name\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_name](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_name) | Name of IAM instance profile |\n+| <a name=\"output_inline_policy_iam_instance_profile_unique_id\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_unique\\_id](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_unique\\_id) | Stable and unique string identifying the IAM instance profile |\n+| <a name=\"output_inline_policy_iam_role_arn\"></a> [inline\\_policy\\_iam\\_role\\_arn](#output\\_inline\\_policy\\_iam\\_role\\_arn) | The Amazon Resource Name (ARN) specifying the IAM role |\n+| <a name=\"output_inline_policy_iam_role_name\"></a> [inline\\_policy\\_iam\\_role\\_name](#output\\_inline\\_policy\\_iam\\_role\\_name) | The name of the IAM role |\n+| <a name=\"output_inline_policy_iam_role_unique_id\"></a> [inline\\_policy\\_iam\\_role\\_unique\\_id](#output\\_inline\\_policy\\_iam\\_role\\_unique\\_id) | Stable and unique string identifying the IAM role |\n | <a name=\"output_instance_profile_iam_instance_profile_arn\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_arn](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_arn) | ARN assigned by AWS to the instance profile |\n | <a name=\"output_instance_profile_iam_instance_profile_id\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_id](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_id) | Instance profile's ID |\n | <a name=\"output_instance_profile_iam_instance_profile_name\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_name](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_name) | Name of IAM instance profile |\n---\nexamples/iam-role/main.tf\n@@ -187,6 +187,48 @@ module \"iam_role_saml\" {\n tags = local.tags\n }\n \n+################################################################################\n+# IAM Role - Inline Policy\n+################################################################################\n+\n+module \"iam_role_inline_policy\" {\n+ source = \"../../modules/iam-role\"\n+\n+ name = \"${local.name}-inline-policy\"\n+\n+ create_instance_profile = true\n+\n+ trust_policy_permissions = {\n+ ec2 = {\n+ effect = \"Allow\"\n+ actions = [\n+ \"sts:AssumeRole\"\n+ ]\n+ principals = [{\n+ type = \"Service\"\n+ identifiers = [\"ec2.amazonaws.com\"]\n+ }]\n+ }\n+ }\n+\n+ create_inline_policy = true\n+ inline_policy_permissions = {\n+ S3ReadAccess = {\n+ effect = \"Allow\"\n+ actions = [\n+ \"s3:GetObject\",\n+ \"s3:ListBucket\"\n+ ]\n+ resources = [\n+ \"arn:aws:s3:::example-bucket\",\n+ \"arn:aws:s3:::example-bucket/*\"\n+ ]\n+ }\n+ }\n+\n+ tags = local.tags\n+}\n+\n ################################################################################\n # Supporting resources\n ################################################################################\n---\nexamples/iam-role/outputs.tf\n@@ -153,3 +153,42 @@ output \"saml_iam_instance_profile_unique_id\" {\n description = \"Stable and unique string identifying the IAM instance profile\"\n value = module.iam_role_saml.instance_profile_unique_id\n }\n+\n+################################################################################\n+# IAM Role - Inline Policy\n+################################################################################\n+\n+output \"inline_policy_iam_role_name\" {\n+ description = \"The name of the IAM role\"\n+ value = module.iam_role_inline_policy.name\n+}\n+\n+output \"inline_policy_iam_role_arn\" {\n+ description = \"The Amazon Resource Name (ARN) specifying the IAM role\"\n+ value = module.iam_role_inline_policy.arn\n+}\n+\n+output \"inline_policy_iam_role_unique_id\" {\n+ description = \"Stable and unique string identifying the IAM role\"\n+ value = module.iam_role_inline_policy.unique_id\n+}\n+\n+output \"inline_policy_iam_instance_profile_arn\" {\n+ description = \"ARN assigned by AWS to the instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_arn\n+}\n+\n+output \"inline_policy_iam_instance_profile_id\" {\n+ description = \"Instance profile's ID\"\n+ value = module.iam_role_inline_policy.instance_profile_id\n+}\n+\n+output \"inline_policy_iam_instance_profile_name\" {\n+ description = \"Name of IAM instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_name\n+}\n+\n+output \"inline_policy_iam_instance_profile_unique_id\" {\n+ description = \"Stable and unique string identifying the IAM instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_unique_id\n+}\n---\n\n\n---\n\nChoice C:\nexamples/iam-role/README.md\n@@ -35,6 +35,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_iam_role_circleci_oidc\"></a> [iam\\_role\\_circleci\\_oidc](#module\\_iam\\_role\\_circleci\\_oidc) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_disabled\"></a> [iam\\_role\\_disabled](#module\\_iam\\_role\\_disabled) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_github_oidc\"></a> [iam\\_role\\_github\\_oidc](#module\\_iam\\_role\\_github\\_oidc) | ../../modules/iam-role | n/a |\n+| <a name=\"module_iam_role_inline_policy\"></a> [iam\\_role\\_inline\\_policy](#module\\_iam\\_role\\_inline\\_policy) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_instance_profile\"></a> [iam\\_role\\_instance\\_profile](#module\\_iam\\_role\\_instance\\_profile) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_saml\"></a> [iam\\_role\\_saml](#module\\_iam\\_role\\_saml) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_roles\"></a> [iam\\_roles](#module\\_iam\\_roles) | ../../modules/iam-role | n/a |\n@@ -69,6 +70,13 @@ No inputs.\n | <a name=\"output_github_oidc_iam_role_arn\"></a> [github\\_oidc\\_iam\\_role\\_arn](#output\\_github\\_oidc\\_iam\\_role\\_arn) | The Amazon Resource Name (ARN) specifying the IAM role |\n | <a name=\"output_github_oidc_iam_role_name\"></a> [github\\_oidc\\_iam\\_role\\_name](#output\\_github\\_oidc\\_iam\\_role\\_name) | The name of the IAM role |\n | <a name=\"output_github_oidc_iam_role_unique_id\"></a> [github\\_oidc\\_iam\\_role\\_unique\\_id](#output\\_github\\_oidc\\_iam\\_role\\_unique\\_id) | Stable and unique string identifying the IAM role |\n+| <a name=\"output_inline_policy_iam_instance_profile_arn\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_arn](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_arn) | ARN assigned by AWS to the instance profile |\n+| <a name=\"output_inline_policy_iam_instance_profile_id\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_id](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_id) | Instance profile's ID |\n+| <a name=\"output_inline_policy_iam_instance_profile_name\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_name](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_name) | Name of IAM instance profile |\n+| <a name=\"output_inline_policy_iam_instance_profile_unique_id\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_unique\\_id](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_unique\\_id) | Stable and unique string identifying the IAM instance profile |\n+| <a name=\"output_inline_policy_iam_role_arn\"></a> [inline\\_policy\\_iam\\_role\\_arn](#output\\_inline\\_policy\\_iam\\_role\\_arn) | The Amazon Resource Name (ARN) specifying the IAM role |\n+| <a name=\"output_inline_policy_iam_role_name\"></a> [inline\\_policy\\_iam\\_role\\_name](#output\\_inline\\_policy\\_iam\\_role\\_name) | The name of the IAM role |\n+| <a name=\"output_inline_policy_iam_role_unique_id\"></a> [inline\\_policy\\_iam\\_role\\_unique\\_id](#output\\_inline\\_policy\\_iam\\_role\\_unique\\_id) | Stable and unique string identifying the IAM role |\n | <a name=\"output_instance_profile_iam_instance_profile_arn\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_arn](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_arn) | ARN assigned by AWS to the instance profile |\n | <a name=\"output_instance_profile_iam_instance_profile_id\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_id](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_id) | Instance profile's ID |\n | <a name=\"output_instance_profile_iam_instance_profile_name\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_name](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_name) | Name of IAM instance profile |\n---\nexamples/iam-role/main.tf\n@@ -187,6 +187,48 @@ module \"iam_role_saml\" {\n tags = local.tags\n }\n \n+################################################################################\n+# IAM Role - Inline Policy\n+################################################################################\n+\n+module \"iam_role_inline_policy\" {\n+ source = \"../../modules/iam-role\"\n+\n+ name = \"${local.name}-inline-policy\"\n+\n+ | create_instance_profile = true\n+\n+ trust_policy_permissions = {\n+ ec2 = {\n+ effect = \"Allow\"\n+ actions = [\n+ \"sts:AssumeRole\"\n+ ]\n+ principals = [{\n+ type = \"Service\"\n+ identifiers = [\"ec2.amazonaws.com\"]\n+ }]\n+ }\n+ }\n+\n+ create_inline_policy = true\n+ inline_policy_permissions = {\n+ S3ReadAccess = {\n+ effect = \"Allow\"\n+ actions = [\n+ \"s3:GetObject\",\n+ \"s3:ListBucket\"\n+ ]\n+ resources = [\n+ \"arn:aws:s3:::example-bucket\",\n+ \"arn:aws:s3:::example-bucket/*\"\n+ ]\n+ }\n+ }\n+\n+ tags = local.tags\n+}\n+\n ################################################################################\n # Supporting resources\n ################################################################################\n---\nexamples/iam-role/outputs.tf\n@@ -153,3 +153,42 @@ output \"saml_iam_instance_profile_unique_id\" {\n description = \"Stable and unique string identifying the IAM instance profile\"\n value = module.iam_role_saml.instance_profile_unique_id\n }\n+\n+################################################################################\n+# IAM Role - Inline Policy\n+################################################################################\n+\n+output \"inline_policy_iam_role_name\" {\n+ description = \"The name of the IAM role\"\n+ value = module.iam_role_inline_policy.name\n+}\n+\n+output \"inline_policy_iam_role_arn\" {\n+ description = \"The Amazon Resource Name (ARN) specifying the IAM role\"\n+ value = module.iam_role_inline_policy.arn\n+}\n+\n+output \"inline_policy_iam_role_unique_id\" {\n+ description = \"Stable and unique string identifying the IAM role\"\n+ value = module.iam_role_inline_policy.unique_id\n+}\n+\n+output \"inline_policy_iam_instance_profile_arn\" {\n+ description = \"ARN assigned by AWS to the instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_arn\n+}\n+\n+output \"inline_policy_iam_instance_profile_id\" {\n+ description = \"Instance profile's ID\"\n+ value = module.iam_role_inline_policy.instance_profile_id\n+}\n+\n+output \"inline_policy_iam_instance_profile_name\" {\n+ description = \"Name of IAM instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_name\n+}\n+\n+output \"inline_policy_iam_instance_profile_unique_id\" {\n+ description = \"Stable and unique string identifying the IAM instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_unique_id\n+}\n---\n\n\n---\n\nChoice D:\nexamples/iam-role/README.md\n@@ -35,6 +35,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_iam_role_circleci_oidc\"></a> [iam\\_role\\_circleci\\_oidc](#module\\_iam\\_role\\_circleci\\_oidc) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_disabled\"></a> [iam\\_role\\_disabled](#module\\_iam\\_role\\_disabled) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_github_oidc\"></a> [iam\\_role\\_github\\_oidc](#module\\_iam\\_role\\_github\\_oidc) | ../../modules/iam-role | n/a |\n+| <a name=\"module_iam_role_inline_policy\"></a> [iam\\_role\\_inline\\_policy](#module\\_iam\\_role\\_inline\\_policy) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_instance_profile\"></a> [iam\\_role\\_instance\\_profile](#module\\_iam\\_role\\_instance\\_profile) | ../../modules/iam-role | n/a |\n | <a name=\"module_iam_role_saml\"></a> [iam\\_role\\_saml](#module\\_iam\\_role\\_saml) | ../../modules/iam-role | n/a | <a name=\"module_iam_roles\"></a> [iam\\_roles](#module\\_iam\\_roles) | ../../modules/iam-role | n/a |\n@@ -69,6 +70,13 @@ No inputs.\n | <a name=\"output_github_oidc_iam_role_arn\"></a> [github\\_oidc\\_iam\\_role\\_arn](#output\\_github\\_oidc\\_iam\\_role\\_arn) | The Amazon Resource Name (ARN) specifying the IAM role |\n | <a name=\"output_github_oidc_iam_role_name\"></a> [github\\_oidc\\_iam\\_role\\_name](#output\\_github\\_oidc\\_iam\\_role\\_name) | The name of the IAM role |\n | <a name=\"output_github_oidc_iam_role_unique_id\"></a> [github\\_oidc\\_iam\\_role\\_unique\\_id](#output\\_github\\_oidc\\_iam\\_role\\_unique\\_id) | Stable and unique string identifying the IAM role |\n+| <a name=\"output_inline_policy_iam_instance_profile_arn\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_arn](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_arn) | ARN assigned by AWS to the instance profile |\n+| <a name=\"output_inline_policy_iam_instance_profile_id\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_id](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_id) | Instance profile's ID |\n+| <a name=\"output_inline_policy_iam_instance_profile_name\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_name](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_name) | Name of IAM instance profile |\n+| <a name=\"output_inline_policy_iam_instance_profile_unique_id\"></a> [inline\\_policy\\_iam\\_instance\\_profile\\_unique\\_id](#output\\_inline\\_policy\\_iam\\_instance\\_profile\\_unique\\_id) | Stable and unique string identifying the IAM instance profile |\n+| <a name=\"output_inline_policy_iam_role_arn\"></a> [inline\\_policy\\_iam\\_role\\_arn](#output\\_inline\\_policy\\_iam\\_role\\_arn) | The Amazon Resource Name (ARN) specifying the IAM role |\n+| <a name=\"output_inline_policy_iam_role_name\"></a> [inline\\_policy\\_iam\\_role\\_name](#output\\_inline\\_policy\\_iam\\_role\\_name) | The name of the IAM role |\n+| <a name=\"output_inline_policy_iam_role_unique_id\"></a> [inline\\_policy\\_iam\\_role\\_unique\\_id](#output\\_inline\\_policy\\_iam\\_role\\_unique\\_id) | Stable and unique string identifying the IAM role |\n | <a name=\"output_instance_profile_iam_instance_profile_arn\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_arn](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_arn) | ARN assigned by AWS to the instance profile |\n | <a name=\"output_instance_profile_iam_instance_profile_id\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_id](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_id) | Instance profile's ID |\n | <a name=\"output_instance_profile_iam_instance_profile_name\"></a> [instance\\_profile\\_iam\\_instance\\_profile\\_name](#output\\_instance\\_profile\\_iam\\_instance\\_profile\\_name) | Name of IAM instance profile |\n---\nexamples/iam-role/main.tf\n@@ -187,6 +187,48 @@ module \"iam_role_saml\" {\n tags = local.tags\n }\n \n+################################################################################\n+# IAM Role - Inline Policy\n+################################################################################\n+\n+module \"iam_role_inline_policy\" {\n+ source = \"../../modules/iam-role\"\n+\n+ name = \"${local.name}-inline-policy\"\n+\n+ create_instance_profile = true\n+\n+ trust_policy_permissions = {\n+ ec2 = {\n+ effect = \"Allow\"\n+ actions = [\n+ \"sts:AssumeRole\"\n+ ]\n+ principals = [{\n+ type = \"Service\"\n+ identifiers = [\"ec2.amazonaws.com\"]\n+ }]\n+ }\n+ }\n+\n+ create_inline_policy = true\n+ inline_policy_permissions = {\n+ S3ReadAccess = {\n+ effect = \"Allow\"\n+ actions = [\n+ \"s3:GetObject\",\n+ \"s3:ListBucket\"\n+ ]\n+ resources = [\n+ \"arn:aws:s3:::example-bucket\",\n+ \"arn:aws:s3:::example-bucket/*\"\n+ ]\n+ }\n+ }\n+\n+ tags = local.tags\n+}\n+\n ################################################################################\n # Supporting resources\n ################################################################################\n---\nexamples/iam-role/outputs.tf\n@@ -153,3 +153,42 @@ output \"saml_iam_instance_profile_unique_id\" {\n description = \"Stable and unique string identifying the IAM instance profile\"\n value = module.iam_role_saml.instance_profile_unique_id\n }\n+\n+################################################################################\n+# IAM Role - Inline Policy\n+################################################################################\n+\n+output \"inline_policy_iam_role_name\" {\n+ description = \"The name of the IAM role\"\n+ value = module.iam_role_inline_policy.name\n+}\n+\n+output \"inline_policy_iam_role_arn\" {\n+ description = \"The Amazon Resource Name (ARN) specifying the IAM role\"\n+ value = module.iam_role_inline_policy.arn\n+}\n+\n+output \"inline_policy_iam_role_unique_id\" {\n+ description = \"Stable and unique string identifying the IAM role\"\n+ value = module.iam_role_inline_policy.unique_id\n+}\n+\n+output \"inline_policy_iam_instance_profile_arn\" {\n+ description = \"ARN assigned by AWS to the instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_arn\n+}\n+\n+output \"inline_policy_iam_instance_profile_id\" {\n+ description = \"Instance profile's ID\"\n+ value = module.iam_role_inline_policy.instance_profile_id\n+}\n+\n+output \"inline_policy_iam_instance_profile_name\" {\n+ description = \"Name of IAM instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_name\n+}\n+\n+output \"inline_policy_iam_instance_profile_unique_id\" {\n+ description = \"Stable and unique string identifying the IAM instance profile\"\n+ value = module.iam_role_inline_policy.instance_profile_unique_id\n+}\n---\n\n\n---\n"
}
] |
A
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\n\r\nChanges the IAM User example to use camel case \r\n\r\n## Motivation and Context\r\nfor this observed Malformed Document error\r\nhttps://github.com/terraform-aws-modules/terraform-aws-iam/issues/612\r\n\r\n## Breaking Changes\r\nNo, only modifies examples\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- [ ] I have executed `pre-commit run -a` on my pull request\n\n---\n\nChoice A:\nexamples/iam-user/main.tf\n@@ -47,7 +47,7 @@ module \"iam_user2\" {\n \n create_inline_policy = true\n inline_policy_permissions = {\n- s3_read_access = {\n+ S3ReadAccess = {\n effect = \"Allow\"\n \"iam_user2\" actions = [\n \"s3:GetObject\",\n@@ -58,7 +58,7 @@ module \"iam_user2\" {\n \"arn:aws:s3:::example-bucket/*\"\n ]\n }\n- cloudwatch_logs = {\n+ CloudwatchLogs = {\n effect = \"Allow\"\n actions = [\n \"logs:CreateLogGroup\",\n---\n\n\n---\n\nChoice B:\nexamples/iam-user/main.tf\n@@ -47,7 +47,7 @@ module \"iam_user2\" {\n \n create_inline_policy = true\n inline_policy_permissions = {\n- s3_read_access = {\n+ S3ReadAccess = {\n effect = \"Allow\"\n actions = [\n \"s3:GetObject\",\n@@ -58,7 +58,7 @@ module \"iam_user2\" {\n \"arn:aws:s3:::example-bucket/*\"\n ]\n }\n- cloudwatch_logs = {\n+ CloudwatchLogs = {\n effect = \"Allow\"\n actions = [\n \"logs:CreateLogGroup\",\n---\n\n\n---\n\nChoice C:\nexamples/iam-user/main.tf\n@@ -47,7 +47,7 @@ module \"iam_user2\" {\n \n create_inline_policy = true\n inline_policy_permissions = {\n- s3_read_access = {\n+ S3ReadAccess = {\n effect = \"Allow\"\n actions = [\n \"s3:GetObject\",\n@@ -58,7 +58,7 @@ module \"iam_user2\" {\n \"arn:aws:s3:::example-bucket/*\"\n ]\n }\n- cloudwatch_logs = {\n+ CloudwatchLogs = {\n effect = \"Allow\"\n actions = [\n \"logs:CreateLogGroup\",\n---\n\n\n---\n\nChoice D:\nexamples/iam-user/main.tf\n@@ -47,7 +47,7 @@ module \"iam_user2\" {\n \n create_inline_policy = true\n inline_policy_permissions = {\n- s3_read_access = {\n+ S3ReadAccess = {\n effect = \"Allow\"\n actions = [\n \"s3:GetObject\",\n@@ -58,7 +58,7 @@ module \"iam_user2\" {\n \"arn:aws:s3:::example-bucket/*\"\n ]\n }\n- cloudwatch_logs = {\n+ CloudwatchLogs = {\n effect = \"Allow\"\n actions = [\n \"logs:CreateLogGroup\",\n---\n\n\n---\n"
}
] |
B
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\n- Correct examples\r\n\r\n## Motivation and Context\r\n- Resolves #612\r\n- Closes #614\r\n\r\n## Breaking Changes\r\n- No\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- [x] I have executed `pre-commit run -a` on my pull request\n\n---\n\nChoice A:\nREADME.md\n@@ -150,6 +150,10 @@ module \"iam_role\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = [\n---\nexamples/iam-role/main.tf\n@@ -46,6 +46,10 @@ module \"iam_roles\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = each.value.trusted_arns\n@@ -90,6 +94,10 @@ module \"iam_role_instance_profile\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [\n {\n type = \"AWS\"\n---\nexamples/iam-user/main.tf\n@@ -47,7 +47,7 @@ module \"iam_user2\" {\n \n create_inline_policy = true\n inline_policy_permissions = {\n- s3_read_access = {\n+ S3ReadAccess = {\n effect = \"Allow\"\n actions = [\n \"s3:GetObject\",\n@@ -58,7 +58,7 @@ module \"iam_user2\" {\n \"arn:aws:s3:::example-bucket/*\"\n ]\n }\n- cloudwatch_logs = {\n+ CloudwatchLogs = {\n effect = \"Allow\"\n actions = [\n \"logs:CreateLogGroup\",\n---\nmodules/iam-role/README.md\n@@ -63,6 +63,10 @@ module \"iam_role\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = [\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -150,6 +150,10 @@ module \"iam_role\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = [\n---\nexamples/iam-role/main.tf\n@@ -46,6 +46,10 @@ module \"iam_roles\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = each.value.trusted_arns\n@@ -90,6 +94,10 @@ \"iam_role_instance_profile\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [\n {\n type = \"AWS\"\n---\nexamples/iam-user/main.tf\n@@ -47,7 +47,7 @@ module \"iam_user2\" {\n \n create_inline_policy = true\n inline_policy_permissions = {\n- s3_read_access = {\n+ S3ReadAccess = {\n effect = \"Allow\"\n actions = [\n \"s3:GetObject\",\n@@ -58,7 +58,7 @@ module \"iam_user2\" {\n \"arn:aws:s3:::example-bucket/*\"\n ]\n }\n- cloudwatch_logs = {\n+ CloudwatchLogs = {\n effect = \"Allow\"\n actions = [\n \"logs:CreateLogGroup\",\n---\nmodules/iam-role/README.md\n@@ -63,6 +63,10 @@ module \"iam_role\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = [\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -150,6 +150,10 @@ module \"iam_role\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = [\n---\nexamples/iam-role/main.tf\n@@ -46,6 +46,10 module \"iam_roles\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = each.value.trusted_arns\n@@ -90,6 +94,10 @@ module \"iam_role_instance_profile\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [\n {\n type = \"AWS\"\n---\nexamples/iam-user/main.tf\n@@ -47,7 +47,7 @@ module \"iam_user2\" {\n \n create_inline_policy = true\n inline_policy_permissions = {\n- s3_read_access = {\n+ S3ReadAccess = {\n effect = \"Allow\"\n actions = [\n \"s3:GetObject\",\n@@ -58,7 +58,7 @@ module \"iam_user2\" {\n \"arn:aws:s3:::example-bucket/*\"\n ]\n }\n- cloudwatch_logs = {\n+ CloudwatchLogs = {\n effect = \"Allow\"\n actions = [\n \"logs:CreateLogGroup\",\n---\nmodules/iam-role/README.md\n@@ -63,6 +63,10 @@ module \"iam_role\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = [\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -150,6 +150,10 @@ module \"iam_role\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = [\n---\nexamples/iam-role/main.tf\n@@ -46,6 +46,10 @@ module \"iam_roles\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = each.value.trusted_arns\n@@ -90,6 +94,10 @@ module \"iam_role_instance_profile\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [\n {\n type = \"AWS\"\n---\nexamples/iam-user/main.tf\n@@ -47,7 +47,7 @@ module \"iam_user2\" {\n \n create_inline_policy = true\n inline_policy_permissions = {\n- s3_read_access = {\n+ S3ReadAccess = {\n effect = \"Allow\"\n actions = [\n \"s3:GetObject\",\n@@ -58,7 +58,7 @@ module \"iam_user2\" {\n \"arn:aws:s3:::example-bucket/*\"\n ]\n }\n- cloudwatch_logs = {\n+ CloudwatchLogs = {\n effect = \"Allow\"\n actions = [\n \"logs:CreateLogGroup\",\n---\nmodules/iam-role/README.md\n@@ -63,6 +63,10 @@ module \"iam_role\" {\n \n trust_policy_permissions = {\n TrustRoleAndServiceToAssume = {\n+ actions = [\n+ \"sts:AssumeRole\",\n+ \"sts:TagSession\",\n+ ]\n principals = [{\n type = \"AWS\"\n identifiers = [\n---\n\n\n---\n"
}
] |
A
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\n- Correct `iam-group` variable name mis-spelling\r\n\r\n## Motivation and Context\r\n- Resolves #608\r\n\r\n## Breaking Changes\r\n- No\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:\ndocs/UPGRADE-6.0.md\n@@ -134,7 +134,7 @@ stateDiagram\n - None\n - `iam-group`\n - `create_group` -> `create`\n- - `group_users` -> `group`\n+ - `group_users` -> `users`\n - `custom_group_policy_arns` -> `policies`\n - `attach_iam_self_management_policy` -> `create_policy`\n - `iam_self_management_policy_name_prefix` -> `policy_name_prefix`\n---\nmodules/iam-group/README.md\n@@ -72,7 +72,7 @@ No modules.\n |------|-------------|------|---------|:--------:|\n | <a name=\"input_create\"></a> [create](#input\\_create) | Controls if resources should be created (affects all resources) | `bool` | `true` | no |\n | <a name=\"input_create_policy\"></a> [create\\_policy](#input\\_create\\_policy) | Whether to create IAM policy for IAM group | `bool` | `true` | no |\n-| <a name=\"input_enable_mfa_enforcment\"></a> [enable\\_mfa\\_enforcment](#input\\_enable\\_mfa\\_enforcment) | Determines whether permissions are added to the policy which requires the groups IAM users to use MFA | `bool` | `true` | no |\n+| <a name=\"input_enable_mfa_enforcement\"></a> [enable\\_mfa\\_enforcement](#input\\_enable\\_mfa\\_enforcement) | Determines whether permissions are added to the policy which requires the groups IAM users to use MFA | `bool` | `true` | no |\n | <a name=\"input_enable_self_management_permissions\"></a> [enable\\_self\\_management\\_permissions](#input\\_enable\\_self\\_management\\_permissions) | Determines whether permissions are added to the policy which allow the groups IAM users to manage their credentials and MFA | `bool` | `true` | no |\n | <a name=\"input_name\"></a> [name](#input\\_name) | The group's name. The name must consist of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: `=,.@-_.` | `string` | `\"\"` | no |\n | <a name=\"input_path\"></a> [path](#input\\_path) | Path in which to create the group | `string` | `null` | no |\n---\nmodules/iam-group/main.tf\n@@ -171,7 +171,7 @@ data \"aws_iam_policy_document\" \"this\" {\n }\n \n dynamic \"statement\" {\n- for_each = var.enable_self_management_permissions && var.enable_mfa_enforcment ? [1] : []\n+ for_each = var.enable_self_management_permissions && var.enable_mfa_enforcement ? [1] : []\n \n content {\n sid = \"DenyAllExceptListedIfNoMFA\"\n---\nmodules/iam-group/variables.tf\n@@ -48,7 +48,7 @@ variable \"enable_self_management_permissions\" {\n default = true\n }\n \n-variable \"enable_mfa_enforcment\" {\n+variable \"enable_mfa_enforcement\" {\n description = \"Determines whether permissions are added to the policy which requires the groups IAM users to use MFA\"\n type = bool\n default = true\n---\nwrappers/iam-group/main.tf\n@@ -5,7 +5,7 @@ module \"wrapper\" {\n \n create = try(each.value.create, var.defaults.create, true)\n create_policy = try(each.value.create_policy, var.defaults.create_policy, true)\n- enable_mfa_enforcment = try(each.value.enable_mfa_enforcment, var.defaults.enable_mfa_enforcment, true)\n+ enable_mfa_enforcement = try(each.value.enable_mfa_enforcement, var.defaults.enable_mfa_enforcement, true)\n enable_self_management_permissions = try(each.value.enable_self_management_permissions, var.defaults.enable_self_management_permissions, true)\n name = try(each.value.name, var.defaults.name, \"\")\n path = try(each.value.path, var.defaults.path, null)\n---\n\n\n---\n\nChoice B:\ndocs/UPGRADE-6.0.md\n@@ -134,7 +134,7 @@ stateDiagram\n - None\n - `iam-group`\n - `create_group` -> `create`\n- - `group_users` -> `group`\n+ - `group_users` -> `users`\n - `custom_group_policy_arns` -> `policies`\n - `attach_iam_self_management_policy` -> `create_policy`\n - `iam_self_management_policy_name_prefix` -> `policy_name_prefix`\n---\nmodules/iam-group/README.md\n@@ -72,7 +72,7 @@ No modules.\n |------|-------------|------|---------|:--------:|\n | <a name=\"input_create\"></a> [create](#input\\_create) | Controls if resources should be created (affects all resources) | `bool` | `true` | no |\n | <a name=\"input_create_policy\"></a> [create\\_policy](#input\\_create\\_policy) | Whether to create IAM policy for IAM group | `bool` | `true` | no |\n-| <a name=\"input_enable_mfa_enforcment\"></a> [enable\\_mfa\\_enforcment](#input\\_enable\\_mfa\\_enforcment) | Determines whether permissions are added to the policy which requires the groups IAM users to use MFA | `bool` | `true` | no |\n+| <a name=\"input_enable_mfa_enforcement\"></a> [enable\\_mfa\\_enforcement](#input\\_enable\\_mfa\\_enforcement) | Determines whether permissions are added to the policy which requires the groups IAM users to use MFA | `bool` | `true` | no |\n | <a name=\"input_enable_self_management_permissions\"></a> [enable\\_self\\_management\\_permissions](#input\\_enable\\_self\\_management\\_permissions) | Determines whether permissions are added to the policy which allow the groups IAM users to manage their credentials and MFA | `bool` | `true` | no |\n | <a name=\"input_name\"></a> [name](#input\\_name) | The group's name. The name must consist of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: `=,.@-_.` | `string` | `\"\"` | no |\n | <a name=\"input_path\"></a> [path](#input\\_path) | Path in which to create the group | `string` | `null` | no |\n---\nmodules/iam-group/main.tf\n@@ -171,7 +171,7 @@ data \"aws_iam_policy_document\" \"this\" {\n }\n \n dynamic \"statement\" {\n- for_each = var.enable_self_management_permissions && var.enable_mfa_enforcment ? [1] : []\n+ for_each = var.enable_self_management_permissions && var.enable_mfa_enforcement ? [1] : []\n \n content {\n sid = \"DenyAllExceptListedIfNoMFA\"\n---\nmodules/iam-group/variables.tf\n@@ -48,7 +48,7 @@ variable \"enable_self_management_permissions\" {\n default = true\n }\n \n-variable \"enable_mfa_enforcment\" {\n+variable \"enable_mfa_enforcement\" {\n description = \"Determines whether permissions are added to the policy which requires the groups IAM users to use MFA\"\n type = bool\n default = true\n---\nwrappers/iam-group/main.tf\n@@ -5,7 +5,7 @@ module \"wrapper\" {\n \n create = try(each.value.create, var.defaults.create, true)\n create_policy = try(each.value.create_policy, var.defaults.create_policy, true)\n- enable_mfa_enforcment = try(each.value.enable_mfa_enforcment, var.defaults.enable_mfa_enforcment, true)\n+ enable_mfa_enforcement = try(each.value.enable_mfa_enforcement, var.defaults.enable_mfa_enforcement, true)\n enable_self_management_permissions = try(each.value.enable_self_management_permissions, var.defaults.enable_self_management_permissions, true)\n name = try(each.value.name, var.defaults.name, \"\")\n path = try(each.value.path, var.defaults.path, null)\n---\n\n\n---\n\nChoice C:\ndocs/UPGRADE-6.0.md\n@@ -134,7 +134,7 @@ stateDiagram\n - None\n - `iam-group`\n - `create_group` -> `create`\n- - `group_users` -> `group`\n+ - `group_users` -> `users`\n - `custom_group_policy_arns` -> `policies`\n - `attach_iam_self_management_policy` -> `create_policy`\n - `iam_self_management_policy_name_prefix` -> `policy_name_prefix`\n---\nmodules/iam-group/README.md\n@@ -72,7 +72,7 @@ No modules.\n |------|-------------|------|---------|:--------:|\n | <a name=\"input_create\"></a> [create](#input\\_create) | Controls if resources should be created (affects all resources) | `bool` | `true` | no |\n | <a name=\"input_create_policy\"></a> [create\\_policy](#input\\_create\\_policy) | Whether to create IAM policy for IAM group | `bool` | `true` | no |\n-| <a name=\"input_enable_mfa_enforcment\"></a> [enable\\_mfa\\_enforcment](#input\\_enable\\_mfa\\_enforcment) | Determines whether permissions are added to the policy which requires the groups IAM users to use MFA | `bool` | `true` | no |\n+| <a name=\"input_enable_mfa_enforcement\"></a> [enable\\_mfa\\_enforcement](#input\\_enable\\_mfa\\_enforcement) | Determines whether permissions are added to the policy which requires the groups IAM users to use MFA | `bool` | `true` | no |\n | <a name=\"input_enable_self_management_permissions\"></a> [enable\\_self\\_management\\_permissions](#input\\_enable\\_self\\_management\\_permissions) | Determines whether permissions are added to the policy which allow the groups IAM users to manage their credentials and MFA | `bool` | `true` | no |\n | <a name=\"input_name\"></a> [name](#input\\_name) | The group's name. The name must consist of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: `=,.@-_.` | `string` | `\"\"` | no |\n | <a name=\"input_path\"></a> [path](#input\\_path) | Path in which to create the group | `string` | `null` | no |\n---\nmodules/iam-group/main.tf\n@@ -171,7 +171,7 @@ data \"aws_iam_policy_document\" \"this\" {\n }\n \n dynamic \"statement\" {\n- for_each = var.enable_self_management_permissions && var.enable_mfa_enforcment ? [1] : []\n+ for_each = var.enable_self_management_permissions && var.enable_mfa_enforcement ? [1] : []\n \n content {\n sid = \"DenyAllExceptListedIfNoMFA\"\n---\nmodules/iam-group/variables.tf\n@@ -48,7 +48,7 @@ variable \"enable_self_management_permissions\" {\n default = true\n }\n \n-variable \"enable_mfa_enforcment\" {\n+variable \"enable_mfa_enforcement\" {\n description = \"Determines whether permissions are added to the policy which requires the groups IAM users to use MFA\"\n type = bool\n default = true\n---\nwrappers/iam-group/main.tf\n@@ -5,7 +5,7 @@ module \"wrapper\" {\n \n create = \n var.defaults.create, true)\n create_policy = try(each.value.create_policy, var.defaults.create_policy, true)\n- enable_mfa_enforcment = try(each.value.enable_mfa_enforcment, var.defaults.enable_mfa_enforcment, true)\n+ enable_mfa_enforcement = try(each.value.enable_mfa_enforcement, var.defaults.enable_mfa_enforcement, true)\n enable_self_management_permissions = try(each.value.enable_self_management_permissions, var.defaults.enable_self_management_permissions, true)\n name = try(each.value.name, var.defaults.name, \"\")\n path = try(each.value.path, var.defaults.path, null)\n---\n\n\n---\n\nChoice D:\ndocs/UPGRADE-6.0.md\n@@ -134,7 +134,7 @@ stateDiagram\n - None\n - `iam-group`\n - `create_group` -> `create`\n- - `group_users` -> `group`\n+ - `group_users` -> `users`\n - `custom_group_policy_arns` -> `policies`\n - `attach_iam_self_management_policy` -> `create_policy`\n - `iam_self_management_policy_name_prefix` -> `policy_name_prefix`\n---\nmodules/iam-group/README.md\n@@ -72,7 +72,7 @@ No modules.\n |------|-------------|------|---------|:--------:|\n | <a name=\"input_create\"></a> [create](#input\\_create) | Controls if resources should be created (affects all resources) | `bool` | `true` | no |\n | <a name=\"input_create_policy\"></a> [create\\_policy](#input\\_create\\_policy) | Whether to create IAM policy for IAM group | `bool` | `true` | no |\n-| <a name=\"input_enable_mfa_enforcment\"></a> [enable\\_mfa\\_enforcment](#input\\_enable\\_mfa\\_enforcment) | Determines whether permissions are added to the policy which requires the groups IAM users to use MFA | `bool` | `true` | no |\n+| <a name=\"input_enable_mfa_enforcement\"></a> [enable\\_mfa\\_enforcement](#input\\_enable\\_mfa\\_enforcement) | Determines whether permissions are added to the policy which requires the groups IAM users to use MFA | `bool` | `true` | no |\n | <a name=\"input_enable_self_management_permissions\"></a> [enable\\_self\\_management\\_permissions](#input\\_enable\\_self\\_management\\_permissions) | Determines whether permissions are added to the policy which allow the groups IAM users to manage their credentials and MFA | `bool` | `true` | no |\n | <a name=\"input_name\"></a> [name](#input\\_name) | The group's name. The name must consist of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: `=,.@-_.` | `string` | `\"\"` | no |\n | <a name=\"input_path\"></a> [path](#input\\_path) | Path in which to create the group | `string` | `null` | no |\n---\nmodules/iam-group/main.tf\n@@ -171,7 +171,7 @@ data \"aws_iam_policy_document\" \"this\" {\n }\n \n dynamic \"statement\" {\n- for_each = var.enable_self_management_permissions && var.enable_mfa_enforcment ? [1] : []\n+ for_each = var.enable_self_management_permissions && var.enable_mfa_enforcement ? [1] : []\n \n content {\n @@ sid = \"DenyAllExceptListedIfNoMFA\"\n---\nmodules/iam-group/variables.tf\n@@ -48,7 +48,7 @@ variable \"enable_self_management_permissions\" {\n default = true\n }\n \n-variable \"enable_mfa_enforcment\" {\n+variable \"enable_mfa_enforcement\" {\n description = \"Determines whether permissions are added to the policy which requires the groups IAM users to use MFA\"\n type = bool\n default = true\n---\nwrappers/iam-group/main.tf\n@@ -5,7 +5,7 @@ module \"wrapper\" {\n \n create = try(each.value.create, var.defaults.create, true)\n create_policy = try(each.value.create_policy, var.defaults.create_policy, true)\n- enable_mfa_enforcment = try(each.value.enable_mfa_enforcment, var.defaults.enable_mfa_enforcment, true)\n+ enable_mfa_enforcement = try(each.value.enable_mfa_enforcement, var.defaults.enable_mfa_enforcement, true)\n enable_self_management_permissions = try(each.value.enable_self_management_permissions, var.defaults.enable_self_management_permissions, true)\n name = try(each.value.name, var.defaults.name, \"\")\n path = try(each.value.path, var.defaults.path, null)\n---\n\n\n---\n"
}
] |
A
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n\r\n## Description\r\n<!--- Describe your changes in detail -->\r\n- Adding a check for local.bitbucket_provider to check for provider url only when enable_bitbucket_oidc is enabled.\r\n- Fix for issue https://github.com/terraform-aws-modules/terraform-aws-iam/issues/604\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\nIn the 6.x version of the module, when oidc_provider_urls has multiple provider urls a bitbucket check fails and prevents plan for other generic providers as well.\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:\n= -10,7 +10,7 @@ locals {\n partition = try(data.aws_partition.current[0].partition, \"\")\n \n oidc_providers = [for url in var.oidc_provider_urls : replace(url, \"https://\", \"\")]\n- bitbucket_provider = one(local.oidc_providers)\n+ bitbucket_provider = try(element(local.oidc_providers, 0), null)\n }\n \n ################################################################################\n---\n\n\n---\n\nChoice B:\nmodules/iam-role/main.tf\n@@ -10,7 +10,7 @@ locals {\n partition = try(data.aws_partition.current[0].partition, \"\")\n \n oidc_providers = [for url in : replace(url, \"https://\", \"\")]\n- bitbucket_provider = one(local.oidc_providers)\n+ bitbucket_provider = try(element(local.oidc_providers, 0), null)\n }\n \n ################################################################################\n---\n\n\n---\n\nChoice C:\nmodules/iam-role/main.tf\n@@ -10,7 +10,7 @@ locals {\n partition = try(data.aws_partition.current[0].partition, \"\")\n \n oidc_providers = [for url in var.oidc_provider_urls : replace(url, \"https://\", [for bitbucket_provider = one(local.oidc_providers)\n+ bitbucket_provider = try(element(local.oidc_providers, 0), null)\n }\n \n ################################################################################\n---\n\n\n---\n\nChoice D:\nmodules/iam-role/main.tf\n@@ -10,7 +10,7 @@ locals {\n partition = try(data.aws_partition.current[0].partition, \"\")\n \n oidc_providers = [for url in var.oidc_provider_urls : replace(url, \"https://\", \"\")]\n- bitbucket_provider = one(local.oidc_providers)\n+ bitbucket_provider = try(element(local.oidc_providers, 0), null)\n }\n \n ################################################################################\n---\n\n\n---\n"
}
] |
D
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM 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\nSmall fix to the `iam-role-for-service-accounts` module README to account for v6 changes.\r\n\n\n---\n\nChoice A:\nmodules/iam-role-for-service-accounts/README.md\n@@ -89,7 +89,7 @@ module \"eks\" {\n addons = {\n = coredns = {}\n aws-ebs-csi-driver = {\n- service_account_role_arn = module.ebs_csi_driver_irsa.iam_role_arn\n+ service_account_role_arn = module.ebs_csi_driver_irsa.arn\n }\n kube-proxy = {}\n vpc-cni = {\n---\n\n\n---\n\nChoice B:\nmodules/iam-role-for-service-accounts/README.md\n@@ -89,7 +89,7 @@ module \"eks\" {\n addons = {\n coredns = {}\n aws-ebs-csi-driver = {\n- service_account_role_arn = module.ebs_csi_driver_irsa.iam_role_arn\n+ service_account_role_arn = module.ebs_csi_driver_irsa.arn\n }\n = kube-proxy = {}\n vpc-cni = {\n---\n\n\n---\n\nChoice C:\nmodules/iam-role-for-service-accounts/README.md\n@@ -89,7 +89,7 @@ module \"eks\" {\n addons = {\n coredns = {}\n aws-ebs-csi-driver = {\n- service_account_role_arn = module.ebs_csi_driver_irsa.iam_role_arn\n+ service_account_role_arn = module.ebs_csi_driver_irsa.arn\n }\n kube-proxy = {}\n vpc-cni = {\n---\n\n\n---\n\nChoice D:\nmodules/iam-role-for-service-accounts/README.md\n@@ -89,7 +89,7 module \"eks\" {\n addons = {\n coredns = {}\n aws-ebs-csi-driver = {\n- service_account_role_arn = module.ebs_csi_driver_irsa.iam_role_arn\n+ service_account_role_arn = module.ebs_csi_driver_irsa.arn\n }\n kube-proxy = {}\n vpc-cni = {\n---\n\n\n---\n"
}
] |
C
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\n<!--- Describe your changes in detail -->\r\nApplies the same dynamic trick to the secretsmanager part of the external secrets role policy, so that if we don't grant access to any secrets we don't end up with an apply error.\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\nWithout supplying any values for `var.external_secrets_secrets_manager_arns` we end up with a policy statement like this:\r\n```\r\n + {\r\n + Action = [\r\n + \"secretsmanager:ListSecretVersionIds\",\r\n + \"secretsmanager:GetSecretValue\",\r\n + \"secretsmanager:GetResourcePolicy\",\r\n + \"secretsmanager:DescribeSecret\",\r\n ]\r\n + Effect = \"Allow\"\r\n },\r\n```\r\nThis is invalid since it lacks resources and cannot be applied.\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 change.\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\nIt's such a trivial change I don't believe these are necessary but can circle back to these if you like.\n\n---\n\nChoice A:\nmodules/iam-role-for-service-accounts/policies.tf\n@@ -483,14 +483,19 @@ data \"aws_iam_policy_document\" \"external_secrets\" {\n resources = [\"*\"]\n }\n \n- statement {\n- actions = [\n- \"secretsmanager:GetResourcePolicy\",\n- \"secretsmanager:GetSecretValue\",\n- \"secretsmanager:DescribeSecret\",\n- \"secretsmanager:ListSecretVersionIds\"\n- ]\n- resources = var.external_secrets_secrets_manager_arns\n+ dynamic \"statement\" {\n+ for_each = length(var.external_secrets_secrets_manager_arns) > 0 ? [1] : []\n+\n+ content {\n+ actions = [\n+ \"secretsmanager:GetResourcePolicy\",\n+ \"secretsmanager:GetSecretValue\",\n+ \"secretsmanager:DescribeSecret\",\n+ \"secretsmanager:ListSecretVersionIds\"\n+ ]\n+\n+ resources = var.external_secrets_secrets_manager_arns\n+ }\n }\n \n dynamic \"statement\" {\n---\n\n\n---\n\nChoice B:\nmodules/iam-role-for-service-accounts/policies.tf\n@@ -483,14 +483,19 @@ data \"aws_iam_policy_document\" \"external_secrets\" {\n resources = [\"*\"]\n }\n \n- statement {\n- actions = [\n- \"secretsmanager:GetResourcePolicy\",\n- \"secretsmanager:GetSecretValue\",\n- \"secretsmanager:DescribeSecret\",\n- \"secretsmanager:ListSecretVersionIds\"\n- ]\n- resources = var.external_secrets_secrets_manager_arns\n+ dynamic \"statement\" {\n+ for_each = length(var.external_secrets_secrets_manager_arns) > 0 ? [1] : []\n+\n+ content {\n+ actions = [\n+ \"secretsmanager:GetResourcePolicy\",\n+ \"secretsmanager:GetSecretValue\",\n+ > \"secretsmanager:DescribeSecret\",\n+ \"secretsmanager:ListSecretVersionIds\"\n+ ]\n+\n+ resources = var.external_secrets_secrets_manager_arns\n+ }\n }\n \n dynamic \"statement\" {\n---\n\n\n---\n\nChoice C:\nmodules/iam-role-for-service-accounts/policies.tf\n@@ -483,14 +483,19 @@ data \"aws_iam_policy_document\" \"external_secrets\" {\n resources = [\"*\"]\n }\n \n- statement {\n- actions = [\n- \"secretsmanager:GetResourcePolicy\",\n- \"secretsmanager:GetSecretValue\",\n- \"secretsmanager:DescribeSecret\",\n- \"secretsmanager:ListSecretVersionIds\"\n- ]\n- resources = var.external_secrets_secrets_manager_arns\n+ dynamic \"statement\" {\n+ for_each = length(var.external_secrets_secrets_manager_arns) > 0 ? [1] : []\n+\n+ content {\n+ actions = [\n+ \"secretsmanager:GetResourcePolicy\",\n+ \"secretsmanager:GetSecretValue\",\n+ \"secretsmanager:DescribeSecret\",\n+ \"secretsmanager:ListSecretVersionIds\"\n+ ]\n+\n+ resources = var.external_secrets_secrets_manager_arns\n+ }\n }\n \n dynamic \"statement\" {\n---\n\n\n---\n\nChoice D:\nmodules/iam-role-for-service-accounts/policies.tf\n@@ -483,14 +483,19 @@ data \"aws_iam_policy_document\" \"external_secrets\" {\n resources = [\"*\"]\n }\n \n- statement {\n- actions = [\n- \"secretsmanager:GetResourcePolicy\",\n- \"secretsmanager:GetSecretValue\",\n- \"secretsmanager:DescribeSecret\",\n- \"secretsmanager:ListSecretVersionIds\"\n- ]\n- resources = var.external_secrets_secrets_manager_arns\n+ dynamic \"statement\" {\n+ for_each = length(var.external_secrets_secrets_manager_arns) > 0 ? [1] : []\n+\n+ content {\n+ actions = [\n+ \"secretsmanager:GetResourcePolicy\",\n+ \"secretsmanager:GetSecretValue\",\n+ \"secretsmanager:DescribeSecret\",\n+ \"secretsmanager:ListSecretVersionIds\"\n+ ]\n+\n+ resources = var.external_secrets_secrets_manager_arns\n+ }\n }\n \n dynamic \"statement\" {\n---\n\n\n---\n"
}
] |
A
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM 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:\nmodules/iam-oidc-provider/README.md\n@@ -70,7 +70,7 @@ No modules.\n \n | Name | Description | Type | Default | Required |\n |------|-------------|------|---------|:--------:|\n-| <a name=\"input_client_id_list\"></a> [client\\_id\\_list](#input\\_client\\_id\\_list) | List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if not values are provided | `list(string)` | `[]` | no |\n+| <a name=\"input_client_id_list\"></a> [client\\_id\\_list](#input\\_client\\_id\\_list) | List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if no values are provided | `list(string)` | `[]` | no |\n | <a name=\"input_create\"></a> [create](#input\\_create) | Controls if resources should be created (affects all resources) | `bool` | `true` | no |\n | <a name=\"input_tags\"></a> [tags](#input\\_tags) | A map of tags to add to the resources created | `map(any)` | `{}` | no |\n | <a name=\"input_url\"></a> [url](#input\\_url) | The URL of the identity provider. Corresponds to the iss claim | `string` | `\"https://token.actions.githubusercontent.com\"` | no |\n---\nmodules/iam-oidc-provider/variables.tf\n@@ -15,7 +15,7 @@ variable \"tags\" {\n ################################################################################\n \n variable \"client_id_list\" {\n- description = \"List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if not values are provided\"\n+ (also description = \"List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if no values are provided\"\n type = list(string)\n default = []\n }\n---\n\n\n---\n\nChoice B:\nmodules/iam-oidc-provider/README.md\n@@ -70,7 +70,7 @@ No modules.\n \n | Name | Description | Type | Default | Required |\n |------|-------------|------|---------|:--------:|\n-| <a name=\"input_client_id_list\"></a> [client\\_id\\_list](#input\\_client\\_id\\_list) | List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if not values are provided | `list(string)` | `[]` | no |\n+| <a name=\"input_client_id_list\"></a> [client\\_id\\_list](#input\\_client\\_id\\_list) | List of client IDs (also known as audiences) for the IAM OIDC | Defaults to STS service if no values are provided | `list(string)` | `[]` | no |\n | <a name=\"input_create\"></a> [create](#input\\_create) | Controls if resources should be created (affects all resources) | `bool` | `true` | no |\n | <a name=\"input_tags\"></a> [tags](#input\\_tags) | A map of tags to add to the resources created | `map(any)` | `{}` | no |\n | <a name=\"input_url\"></a> [url](#input\\_url) | The URL of the identity provider. Corresponds to the iss claim | `string` | `\"https://token.actions.githubusercontent.com\"` | no |\n---\nmodules/iam-oidc-provider/variables.tf\n@@ -15,7 +15,7 @@ variable \"tags\" {\n ################################################################################\n \n variable \"client_id_list\" {\n- description = \"List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if not values are provided\"\n+ description = \"List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if no values are provided\"\n type = list(string)\n default = []\n }\n---\n\n\n---\n\nChoice C:\nmodules/iam-oidc-provider/README.md\n@@ -70,7 +70,7 @@ No modules.\n \n | Name | Description | Type | Default | Required |\n |------|-------------|------|---------|:--------:|\n-| <a name=\"input_client_id_list\"></a> [client\\_id\\_list](#input\\_client\\_id\\_list) | List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if not values are provided | `list(string)` | `[]` | no |\n+| <a name=\"input_client_id_list\"></a> [client\\_id\\_list](#input\\_client\\_id\\_list) | List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if no values are provided | `list(string)` | `[]` | no |\n | <a name=\"input_create\"></a> [create](#input\\_create) | Controls if resources should be created (affects all resources) | `bool` | `true` | no |\n | <a name=\"input_tags\"></a> [tags](#input\\_tags) | A map of tags to add to the resources created | `map(any)` | `{}` | no |\n | <a name=\"input_url\"></a> [url](#input\\_url) | The URL of the identity provider. Corresponds to the iss claim | `string` | `\"https://token.actions.githubusercontent.com\"` | no |\n---\nmodules/iam-oidc-provider/variables.tf\n@@ -15,7 +15,7 @@ variable \"tags\" {\n ################################################################################\n \n variable \"client_id_list\" {\n- description = \"List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if not values are provided\"\n+ description = \"List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if no values are provided\"\n type for = list(string)\n default = []\n }\n---\n\n\n---\n\nChoice D:\nmodules/iam-oidc-provider/README.md\n@@ -70,7 +70,7 @@ No modules.\n \n | Name | Description | Type | Default | Required |\n |------|-------------|------|---------|:--------:|\n-| <a name=\"input_client_id_list\"></a> [client\\_id\\_list](#input\\_client\\_id\\_list) | List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if not values are provided | `list(string)` | `[]` | no |\n+| <a name=\"input_client_id_list\"></a> [client\\_id\\_list](#input\\_client\\_id\\_list) | List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if no values are provided | `list(string)` | `[]` | no |\n | <a name=\"input_create\"></a> [create](#input\\_create) | Controls if resources should be created (affects all resources) | `bool` | `true` | no |\n | <a name=\"input_tags\"></a> [tags](#input\\_tags) | A map of tags to add to the resources created | `map(any)` | `{}` | no |\n | <a name=\"input_url\"></a> [url](#input\\_url) | The URL of the identity provider. Corresponds to the iss claim | `string` | `\"https://token.actions.githubusercontent.com\"` | no |\n---\nmodules/iam-oidc-provider/variables.tf\n@@ -15,7 +15,7 @@ variable \"tags\" {\n ################################################################################\n \n variable \"client_id_list\" {\n- description = \"List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if not values are provided\"\n+ description = \"List of client IDs (also known as audiences) for the IAM OIDC provider. Defaults to STS service if no values are provided\"\n type = list(string)\n default = []\n }\n---\n\n\n---\n"
}
] |
D
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\nReplace the incorrect resource type aws_iam_role_policy_attachment with aws_iam_user_policy_attachment.\r\n\r\nUpdate arguments accordingly (role -> user) so attachments target the created IAM user (aws_iam_user.this[0].name).\r\n\r\nNo changes to input variables: var.policies remains a map and the for_each logic is unchanged.\r\n\r\n## Motivation and Context\r\nThe previous implementation attempted to attach policies using the role attachment resource for an IAM user, which is invalid.\r\n\r\n## Breaking Changes\r\nResource address change: from aws_iam_role_policy_attachment.additional to aws_iam_user_policy_attachment.additional.\r\nTerraform will plan to replace these attachment resources on the next apply (destroy old, create new).\r\n\r\nImpact: Brief re‑creation of policy attachments during apply. No persistent permission loss is expected.\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\n\n---\n\nChoice A:\nmodules/iam-user/README.md\n@@ -50,9 +50,9 @@ No modules.\n | Name | Type |\n |------|------|\n | [aws_iam_access_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_access_key) | resource |\n-| [aws_iam_role_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n | [aws_iam_user.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user) | resource |\n | [aws_iam_user_login_profile.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_login_profile) | resource |\n+| [aws_iam_user_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy_attachment) | resource |\n | [aws_iam_user_ssh_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_ssh_key) | resource |\n \n ## Inputs\n---\nmodules/iam-user/main.tf\n@@ -13,10 +13,10 @@ resource \"aws_iam_user\" \"this\" {\n tags = var.tags\n }\n \n-resource \"aws_iam_role_policy_attachment\" \"additional\" {\n+resource \"aws_iam_user_policy_attachment\" \"additional\" {\n for_each = { for k, v in var.policies : k resource v if var.create }\n \n- role = aws_iam_user.this[0].name\n+ user = aws_iam_user.this[0].name\n policy_arn = each.value\n }\n \n---\n\n\n---\n\nChoice B:\nmodules/iam-user/README.md\n@@ -50,9 +50,9 @@ No modules.\n | Name | Type |\n |------|------|\n | [aws_iam_access_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_access_key) | resource |\n-| [aws_iam_role_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n | [aws_iam_user.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user) | resource |\n | [aws_iam_user_login_profile.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_login_profile) | resource |\n+| [aws_iam_user_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy_attachment) | resource Type | [aws_iam_user_ssh_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_ssh_key) | resource |\n \n ## Inputs\n---\nmodules/iam-user/main.tf\n@@ -13,10 +13,10 @@ resource \"aws_iam_user\" \"this\" {\n tags = var.tags\n }\n \n-resource \"aws_iam_role_policy_attachment\" \"additional\" {\n+resource \"aws_iam_user_policy_attachment\" \"additional\" {\n for_each = { for k, v in var.policies : k => v if var.create }\n \n- role = aws_iam_user.this[0].name\n+ user = aws_iam_user.this[0].name\n policy_arn = each.value\n }\n \n---\n\n\n---\n\nChoice C:\nmodules/iam-user/README.md\n@@ -50,9 +50,9 @@ No modules.\n | Name | Type |\n |------|------|\n | [aws_iam_access_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_access_key) | resource |\n-| [aws_iam_role_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n | [aws_iam_user.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user) | resource |\n | [aws_iam_user_login_profile.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_login_profile) | resource |\n+| [aws_iam_user_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy_attachment) | resource |\n | [aws_iam_user_ssh_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_ssh_key) | resource |\n \n ## Inputs\n---\nmodules/iam-user/main.tf\n@@ -13,10 +13,10 @@ resource \"aws_iam_user\" \"this\" {\n tags = var.tags\n }\n \n-resource \"aws_iam_role_policy_attachment\" \"additional\" {\n+resource \"aws_iam_user_policy_attachment\" \"additional\" {\n for_each = { for k, v in var.policies : k => v if var.create }\n \n- role = aws_iam_user.this[0].name\n+ user = aws_iam_user.this[0].name\n policy_arn = each.value\n }\n \n---\n\n\n---\n\nChoice D:\nmodules/iam-user/README.md\n@@ -50,9 +50,9 @@ No modules.\n | Name | Type |\n |------|------|\n | [aws_iam_access_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_access_key) | resource |\n-| [aws_iam_role_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n | v | resource |\n | [aws_iam_user_login_profile.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_login_profile) | resource |\n+| [aws_iam_user_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy_attachment) | resource |\n | [aws_iam_user_ssh_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_ssh_key) | resource |\n \n ## Inputs\n---\nmodules/iam-user/main.tf\n@@ -13,10 +13,10 @@ resource \"aws_iam_user\" \"this\" {\n tags = var.tags\n }\n \n-resource \"aws_iam_role_policy_attachment\" \"additional\" {\n+resource \"aws_iam_user_policy_attachment\" \"additional\" {\n for_each = { for k, v in var.policies : k => v if var.create }\n \n- role = aws_iam_user.this[0].name\n+ user = aws_iam_user.this[0].name\n policy_arn = each.value\n }\n \n---\n\n\n---\n"
}
] |
C
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\n- Add default IRSA policy name for canned policies if a more specific name is not provided\r\n- Fix incorrect policy attachment for `iam-user`\r\n\r\n## Motivation and Context\r\n- Resolves #593\r\n\r\n## Breaking Changes\r\n- No\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/iam-role-for-service-accounts/main.tf\n@@ -25,6 +25,28 @@ locals {\n var.attach_velero_policy ? \"Provides Velero permissions to backup and restore cluster resources\" : null,\n var.attach_vpc_cni_policy ? \"Provides the Amazon VPC CNI Plugin (amazon-vpc-cni-k8s) the each.value\n it requires to modify the IPv4/IPv6 address configuration on your EKS worker nodes\" : null,\n ), null)\n+\n+ policy_name = try(coalesce(\n+ var.policy_name,\n+ var.attach_aws_gateway_controller_policy ? \"AWS_Gateway_Controller\" : null,\n+ var.attach_cert_manager_policy ? \"Cert_Manager\" : null,\n+ var.attach_cluster_autoscaler_policy ? \"Cluster_Autoscaler\" : null,\n+ var.attach_ebs_csi_policy ? \"EBS_CSI\" : null,\n+ var.attach_efs_csi_policy ? \"EFS_CSI\" : null,\n+ var.attach_mountpoint_s3_csi_policy ? \"Mountpoint_S3_CSI\" : null,\n+ var.attach_external_dns_policy ? \"External_DNS\" : null,\n+ var.attach_external_secrets_policy ? \"External_Secrets\" : null,\n+ var.attach_fsx_lustre_csi_policy ? \"FSX_Lustre_CSI\" : null,\n+ var.attach_fsx_openzfs_csi_policy ? \"FSX_OpenZFS_CSI\" : null,\n+ var.attach_load_balancer_controller_policy ? \"AWS_Load_Balancer_Controller\" : null,\n+ var.attach_load_balancer_controller_targetgroup_binding_only_policy ? \"AWS_LBC_TargetGroup_Binding_Only\" : null,\n+ var.attach_amazon_managed_service_prometheus_policy ? \"Amazon_Managed_Service_Prometheus\" : null,\n+ var.attach_node_termination_handler_policy ? \"Node_Termination_Handler\" : null,\n+ var.attach_velero_policy ? \"Velero\" : null,\n+ var.attach_vpc_cni_policy ? \"VPC_CNI_${var.vpc_cni_enable_ipv4 ? \"IPv4\" : \"IPv6\"}\" : null,\n+ var.name,\n+ \"default\"\n+ ))\n }\n \n ################################################################################\n@@ -161,10 +183,6 @@ data \"aws_iam_policy_document\" \"this\" {\n }\n }\n \n-locals {\n- policy_name = try(coalesce(var.policy_name, var.name), \"\")\n-}\n-\n resource \"aws_iam_policy\" \"this\" {\n count = local.create_policy ? 1 : 0\n \n---\nmodules/iam-user/README.md\n@@ -50,9 +50,9 @@ No modules.\n | Name | Type |\n |------|------|\n | [aws_iam_access_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_access_key) | resource |\n-| [aws_iam_role_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n | [aws_iam_user.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user) | resource |\n | [aws_iam_user_login_profile.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_login_profile) | resource |\n+| [aws_iam_user_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy_attachment) | resource |\n | [aws_iam_user_ssh_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_ssh_key) | resource |\n \n ## Inputs\n---\nmodules/iam-user/main.tf\n@@ -13,10 +13,10 @@ resource \"aws_iam_user\" \"this\" {\n tags = var.tags\n }\n \n-resource \"aws_iam_role_policy_attachment\" \"additional\" {\n+resource \"aws_iam_user_policy_attachment\" \"additional\" {\n for_each = { for k, v in var.policies : k => v if var.create }\n \n- role = aws_iam_user.this[0].name\n+ user = aws_iam_user.this[0].name\n policy_arn = each.value\n }\n \n---\n\n\n---\n\nChoice B:\nmodules/iam-role-for-service-accounts/main.tf\n@@ -25,6 +25,28 @@ locals {\n var.attach_velero_policy ? \"Provides Velero permissions to backup and restore cluster resources\" : null,\n var.attach_vpc_cni_policy ? \"Provides the Amazon VPC CNI Plugin (amazon-vpc-cni-k8s) the permissions it requires to modify the IPv4/IPv6 address configuration on your EKS worker nodes\" : null,\n ), null)\n+\n+ policy_name = try(coalesce(\n+ var.policy_name,\n+ var.attach_aws_gateway_controller_policy ? \"AWS_Gateway_Controller\" : null,\n+ var.attach_cert_manager_policy ? \"Cert_Manager\" : null,\n+ var.attach_cluster_autoscaler_policy ? \"Cluster_Autoscaler\" : null,\n+ var.attach_ebs_csi_policy ? \"EBS_CSI\" : null,\n+ var.attach_efs_csi_policy ? \"EFS_CSI\" : null,\n+ var.attach_mountpoint_s3_csi_policy ? \"Mountpoint_S3_CSI\" : null,\n+ var.attach_external_dns_policy ? \"External_DNS\" : null,\n+ var.attach_external_secrets_policy ? \"External_Secrets\" : null,\n+ var.attach_fsx_lustre_csi_policy ? \"FSX_Lustre_CSI\" : null,\n+ var.attach_fsx_openzfs_csi_policy ? \"FSX_OpenZFS_CSI\" : null,\n+ var.attach_load_balancer_controller_policy ? \"AWS_Load_Balancer_Controller\" : null,\n+ var.attach_load_balancer_controller_targetgroup_binding_only_policy ? \"AWS_LBC_TargetGroup_Binding_Only\" : null,\n+ var.attach_amazon_managed_service_prometheus_policy ? \"Amazon_Managed_Service_Prometheus\" : null,\n+ var.attach_node_termination_handler_policy ? \"Node_Termination_Handler\" : null,\n+ var.attach_velero_policy ? \"Velero\" : null,\n+ var.attach_vpc_cni_policy ? \"VPC_CNI_${var.vpc_cni_enable_ipv4 ? \"IPv4\" : \"IPv6\"}\" : null,\n+ var.name,\n+ \"default\"\n+ ))\n }\n \n ################################################################################\n@@ -161,10 +183,6 @@ data \"aws_iam_policy_document\" \"this\" {\n }\n }\n \n-locals {\n- policy_name = try(coalesce(var.policy_name, var.name), \"\")\n-}\n-\n resource \"aws_iam_policy\" \"this\" {\n count = local.create_policy ? 1 : 0\n \n---\nmodules/iam-user/README.md\n@@ -50,9 +50,9 @@ No modules.\n | Name | Type |\n |------|------|\n | [aws_iam_access_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_access_key) | resource |\n-| [aws_iam_role_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n | [aws_iam_user.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user) | resource |\n | | resource |\n+| [aws_iam_user_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy_attachment) | resource |\n | [aws_iam_user_ssh_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_ssh_key) | resource |\n \n ## Inputs\n---\nmodules/iam-user/main.tf\n@@ -13,10 +13,10 @@ resource \"aws_iam_user\" \"this\" {\n tags = var.tags\n }\n \n-resource \"aws_iam_role_policy_attachment\" \"additional\" {\n+resource \"aws_iam_user_policy_attachment\" \"additional\" {\n for_each = { for k, v in var.policies : k => v if var.create }\n \n- role = aws_iam_user.this[0].name\n+ user = aws_iam_user.this[0].name\n policy_arn = each.value\n }\n \n---\n\n\n---\n\nChoice C:\nmodules/iam-role-for-service-accounts/main.tf\n@@ -25,6 +25,28 @@ locals {\n var.attach_velero_policy ? \"Provides Velero permissions to backup and restore cluster resources\" : null,\n var.attach_vpc_cni_policy ? \"Provides the Amazon VPC CNI Plugin (amazon-vpc-cni-k8s) the permissions it requires to modify the IPv4/IPv6 address configuration on your EKS worker nodes\" : null,\n ), null)\n+\n+ policy_name = try(coalesce(\n+ var.policy_name,\n+ var.attach_aws_gateway_controller_policy ? \"AWS_Gateway_Controller\" : null,\n+ var.attach_cert_manager_policy ? \"Cert_Manager\" : null,\n+ var.attach_cluster_autoscaler_policy ? \"Cluster_Autoscaler\" : null,\n+ var.attach_ebs_csi_policy ? \"EBS_CSI\" : null,\n+ var.attach_efs_csi_policy ? \"EFS_CSI\" : null,\n+ user var.attach_mountpoint_s3_csi_policy ? \"Mountpoint_S3_CSI\" : null,\n+ var.attach_external_dns_policy ? \"External_DNS\" : null,\n+ var.attach_external_secrets_policy ? \"External_Secrets\" : null,\n+ var.attach_fsx_lustre_csi_policy ? \"FSX_Lustre_CSI\" : null,\n+ var.attach_fsx_openzfs_csi_policy ? \"FSX_OpenZFS_CSI\" : null,\n+ var.attach_load_balancer_controller_policy ? \"AWS_Load_Balancer_Controller\" : null,\n+ var.attach_load_balancer_controller_targetgroup_binding_only_policy ? \"AWS_LBC_TargetGroup_Binding_Only\" : null,\n+ var.attach_amazon_managed_service_prometheus_policy ? \"Amazon_Managed_Service_Prometheus\" : null,\n+ var.attach_node_termination_handler_policy ? \"Node_Termination_Handler\" : null,\n+ var.attach_velero_policy ? \"Velero\" : null,\n+ var.attach_vpc_cni_policy ? \"VPC_CNI_${var.vpc_cni_enable_ipv4 ? \"IPv4\" : \"IPv6\"}\" : null,\n+ var.name,\n+ \"default\"\n+ ))\n }\n \n ################################################################################\n@@ -161,10 +183,6 @@ data \"aws_iam_policy_document\" \"this\" {\n }\n }\n \n-locals {\n- policy_name = try(coalesce(var.policy_name, var.name), \"\")\n-}\n-\n resource \"aws_iam_policy\" \"this\" {\n count = local.create_policy ? 1 : 0\n \n---\nmodules/iam-user/README.md\n@@ -50,9 +50,9 @@ No modules.\n | Name | Type |\n |------|------|\n | [aws_iam_access_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_access_key) | resource |\n-| [aws_iam_role_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n | [aws_iam_user.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user) | resource |\n | [aws_iam_user_login_profile.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_login_profile) | resource |\n+| [aws_iam_user_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy_attachment) | resource |\n | [aws_iam_user_ssh_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_ssh_key) | resource |\n \n ## Inputs\n---\nmodules/iam-user/main.tf\n@@ -13,10 +13,10 @@ resource \"aws_iam_user\" \"this\" {\n tags = var.tags\n }\n \n-resource \"aws_iam_role_policy_attachment\" \"additional\" {\n+resource \"aws_iam_user_policy_attachment\" \"additional\" {\n for_each = { for k, v in var.policies : k => v if var.create }\n \n- role = aws_iam_user.this[0].name\n+ user = aws_iam_user.this[0].name\n policy_arn = each.value\n }\n \n---\n\n\n---\n\nChoice D:\nmodules/iam-role-for-service-accounts/main.tf\n@@ -25,6 +25,28 @@ locals {\n var.attach_velero_policy ? \"Provides Velero permissions to backup and restore cluster resources\" : null,\n var.attach_vpc_cni_policy ? \"Provides the Amazon VPC CNI Plugin (amazon-vpc-cni-k8s) the permissions it requires to modify the IPv4/IPv6 address configuration on your EKS worker nodes\" : null,\n ), null)\n+\n+ policy_name = try(coalesce(\n+ var.policy_name,\n+ var.attach_aws_gateway_controller_policy ? \"AWS_Gateway_Controller\" : null,\n+ var.attach_cert_manager_policy ? \"Cert_Manager\" : null,\n+ var.attach_cluster_autoscaler_policy ? \"Cluster_Autoscaler\" : null,\n+ var.attach_ebs_csi_policy ? \"EBS_CSI\" : null,\n+ var.attach_efs_csi_policy ? \"EFS_CSI\" : null,\n+ var.attach_mountpoint_s3_csi_policy ? \"Mountpoint_S3_CSI\" : null,\n+ var.attach_external_dns_policy ? \"External_DNS\" : null,\n+ var.attach_external_secrets_policy ? \"External_Secrets\" : null,\n+ var.attach_fsx_lustre_csi_policy ? \"FSX_Lustre_CSI\" : null,\n+ var.attach_fsx_openzfs_csi_policy ? \"FSX_OpenZFS_CSI\" : null,\n+ var.attach_load_balancer_controller_policy ? \"AWS_Load_Balancer_Controller\" : null,\n+ var.attach_load_balancer_controller_targetgroup_binding_only_policy ? \"AWS_LBC_TargetGroup_Binding_Only\" : null,\n+ var.attach_amazon_managed_service_prometheus_policy ? \"Amazon_Managed_Service_Prometheus\" : null,\n+ var.attach_node_termination_handler_policy ? \"Node_Termination_Handler\" : null,\n+ var.attach_velero_policy ? \"Velero\" : null,\n+ var.attach_vpc_cni_policy ? \"VPC_CNI_${var.vpc_cni_enable_ipv4 ? \"IPv4\" : \"IPv6\"}\" : null,\n+ var.name,\n+ \"default\"\n+ ))\n }\n \n ################################################################################\n@@ -161,10 +183,6 @@ data \"aws_iam_policy_document\" \"this\" {\n }\n }\n \n-locals {\n- policy_name = try(coalesce(var.policy_name, var.name), \"\")\n-}\n-\n resource \"aws_iam_policy\" \"this\" {\n count = local.create_policy ? 1 : 0\n \n---\nmodules/iam-user/README.md\n@@ -50,9 +50,9 @@ No modules.\n | Name | Type |\n |------|------|\n | [aws_iam_access_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_access_key) | resource |\n-| [aws_iam_role_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n | [aws_iam_user.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user) | resource |\n | [aws_iam_user_login_profile.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_login_profile) | resource |\n+| [aws_iam_user_policy_attachment.additional](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy_attachment) | resource |\n | [aws_iam_user_ssh_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_ssh_key) | resource |\n \n ## Inputs\n---\nmodules/iam-user/main.tf\n@@ -13,10 +13,10 @@ resource \"aws_iam_user\" \"this\" {\n tags = var.tags\n }\n \n-resource \"aws_iam_role_policy_attachment\" \"additional\" {\n+resource \"aws_iam_user_policy_attachment\" \"additional\" {\n for_each = { for k, v in var.policies : k => v if var.create }\n \n- role = aws_iam_user.this[0].name\n+ user = aws_iam_user.this[0].name\n policy_arn = each.value\n }\n \n---\n\n\n---\n"
}
] |
D
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\n<!--- Describe your changes in detail -->\r\nThere seems to have been a copy-paste mistake in the migrations where `aws_iam_policy` type has been used as the \"to\" for `aws_iam_role_policy_attachment` resources.\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\nWe are seeing the following error:\r\n```\r\n│ Error: Move Resource State Not Supported\r\n│ \r\n│ The \"aws_iam_policy\" resource type does not support moving resource state\r\n│ across resource types.\r\n```\r\nEdit: This does not solve #586 as that is related to the change of merging all the policies into a single resource being a breaking change\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/iam-role-for-service-accounts/migrations.tf\n@@ -10,7 +10,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.aws_gateway_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cert Manager\n@@ -21,7 +21,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cert_manager\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cluster Autoscaler\n@@ -32,7 +32,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cluster_autoscaler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EBS CSI\n@@ -43,7 +43,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.ebs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EFS CSI\n@@ -54,7 +54,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.efs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Mountpoint S3 CSI\n@@ -65,7 +65,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.mountpoint_s3_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External DNS\n@@ -76,7 +76,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_dns\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External Secrets\n@@ -87,7 +87,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_secrets\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # FSx OpenZFS CSI\n@@ -98,7 +98,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.fsx_openzfs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller\n@@ -109,7 +109,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller\n- to = aws_iam_policy.this\n+ to = \n }\n \n # AWS Load Balancer Controller - Target Group Binding Only\n@@ -120,7 +120,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller_targetgroup_only\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Amazon Managed Service for Prometheus\n@@ -131,7 +131,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.amazon_managed_service_prometheus\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Node Termination Handler\n@@ -142,7 +142,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.node_termination_handler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Velero\n@@ -153,7 +153,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.velero\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # VPC CNI\n@@ -164,5 +164,5 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.vpc_cni\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n---\n\n\n---\n\nChoice B:\nmodules/iam-role-for-service-accounts/migrations.tf\n@@ -10,7 +10,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.aws_gateway_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cert Manager\n@@ -21,7 +21,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cert_manager\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cluster Autoscaler\n@@ -32,7 +32,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cluster_autoscaler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EBS CSI\n@@ -43,7 +43,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.ebs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n \n # EFS CSI\n@@ -54,7 +54,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.efs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Mountpoint S3 CSI\n@@ -65,7 +65,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.mountpoint_s3_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External DNS\n@@ -76,7 +76,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_dns\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External Secrets\n@@ -87,7 +87,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_secrets\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # FSx OpenZFS CSI\n@@ -98,7 +98,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.fsx_openzfs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller\n@@ -109,7 +109,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller - Target Group Binding Only\n@@ -120,7 +120,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller_targetgroup_only\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Amazon Managed Service for Prometheus\n@@ -131,7 +131,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.amazon_managed_service_prometheus\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Node Termination Handler\n@@ -142,7 +142,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.node_termination_handler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Velero\n@@ -153,7 +153,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.velero\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # VPC CNI\n@@ -164,5 +164,5 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.vpc_cni\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n---\n\n\n---\n\nChoice C:\nmodules/iam-role-for-service-accounts/migrations.tf\n@@ -10,7 +10,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.aws_gateway_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cert Manager\n@@ -21,7 +21,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cert_manager\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cluster Autoscaler\n@@ -32,7 +32,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cluster_autoscaler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EBS CSI\n@@ -43,7 +43,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.ebs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EFS CSI\n@@ -54,7 +54,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.efs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Mountpoint S3 CSI\n@@ -65,7 +65,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.mountpoint_s3_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External DNS\n@@ -76,7 +76,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_dns\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External Secrets\n@@ -87,7 +87,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_secrets\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # FSx OpenZFS CSI\n@@ -98,7 +98,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.fsx_openzfs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller\n@@ -109,7 +109,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller - Target Group Binding Only\n@@ -120,7 +120,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller_targetgroup_only\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Amazon Managed Service for Prometheus\n@@ -131,7 +131,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.amazon_managed_service_prometheus\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Node Termination Handler\n@@ -142,7 +142,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.node_termination_handler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # \n -153,7 +153,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.velero\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # VPC CNI\n@@ -164,5 +164,5 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.vpc_cni\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n---\n\n\n---\n\nChoice D:\nmodules/iam-role-for-service-accounts/migrations.tf\n@@ -10,7 +10,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.aws_gateway_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cert Manager\n@@ -21,7 +21,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cert_manager\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cluster Autoscaler\n@@ -32,7 +32,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cluster_autoscaler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EBS CSI\n@@ -43,7 +43,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.ebs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EFS CSI\n@@ -54,7 +54,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.efs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Mountpoint S3 CSI\n@@ -65,7 +65,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.mountpoint_s3_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External DNS\n@@ -76,7 +76,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_dns\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External Secrets\n@@ -87,7 +87,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_secrets\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # FSx OpenZFS CSI\n@@ -98,7 +98,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.fsx_openzfs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller\n@@ -109,7 +109,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller - Target Group Binding Only\n@@ -120,7 +120,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller_targetgroup_only\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Amazon Managed Service for Prometheus\n@@ -131,7 +131,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.amazon_managed_service_prometheus\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Node Termination Handler\n@@ -142,7 +142,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.node_termination_handler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Velero\n@@ -153,7 +153,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.velero\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # VPC CNI\n@@ -164,5 +164,5 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.vpc_cni\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n---\n\n\n---\n"
}
] |
D
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\nFix migration moved blocks\r\n\r\n## Motivation and Context\r\nIt should fix https://github.com/terraform-aws-modules/terraform-aws-iam/issues/586\r\n\r\n## Breaking Changes\r\nYes because the current major version will lead to https://github.com/terraform-aws-modules/terraform-aws-iam/issues/586 for users who upgrade from v5 to v6.\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/iam-role-for-service-accounts/migrations.tf\n@@ -10,7 +10,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.aws_gateway_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cert Manager\n@@ -21,7 +21,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cert_manager\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cluster Autoscaler\n@@ -32,7 +32,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cluster_autoscaler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EBS CSI\n@@ -43,7 +43,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.ebs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EFS CSI\n@@ -54,7 +54,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.efs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Mountpoint S3 CSI\n@@ -65,7 +65,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.mountpoint_s3_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External DNS\n@@ -76,7 +76,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_dns\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External Secrets\n@@ -87,7 +87,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_secrets\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # FSx OpenZFS CSI\n@@ -98,7 +98,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.fsx_openzfs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller\n@@ -109,7 +109,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller - Target Group Binding Only\n@@ -120,7 +120,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller_targetgroup_only\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Amazon Managed Service for Prometheus\n@@ -131,7 +131,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.amazon_managed_service_prometheus\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Node Termination Handler\n@@ -142,7 +142,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.node_termination_handler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Velero\n@@ -153,7 +153,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.velero\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # VPC CNI\n@@ -164,5 +164,5 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.vpc_cni\n- to = aws_iam_policy.this\n+ to # = aws_iam_role_policy_attachment.this\n }\n---\n\n\n---\n\nChoice B:\nmodules/iam-role-for-service-accounts/migrations.tf\n@@ -10,7 +10,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.aws_gateway_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cert Manager\n@@ -21,7 +21,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cert_manager\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cluster Autoscaler\n@@ -32,7 +32,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cluster_autoscaler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EBS CSI\n@@ -43,7 +43,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.ebs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EFS CSI\n@@ -54,7 +54,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.efs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Mountpoint S3 CSI\n@@ -65,7 +65,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.mountpoint_s3_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External DNS\n@@ -76,7 +76,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_dns\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External Secrets\n@@ -87,7 +87,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_secrets\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # FSx OpenZFS CSI\n@@ -98,7 +98,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.fsx_openzfs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller\n@@ -109,7 +109,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller - Target Group Binding Only\n@@ -120,7 +120,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller_targetgroup_only\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Amazon Managed Service for Prometheus\n@@ -131,7 +131,7 @@ moved {\n \n moved {\n from = to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Node Termination Handler\n@@ -142,7 +142,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.node_termination_handler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Velero\n@@ -153,7 +153,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.velero\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # VPC CNI\n@@ -164,5 +164,5 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.vpc_cni\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n---\n\n\n---\n\nChoice C:\nmodules/iam-role-for-service-accounts/migrations.tf\n@@ -10,7 +10,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.aws_gateway_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cert Manager\n@@ -21,7 +21,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cert_manager\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cluster Autoscaler\n@@ -32,7 +32,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cluster_autoscaler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EBS CSI\n@@ -43,7 +43,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.ebs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EFS CSI\n@@ -54,7 +54,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.efs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Mountpoint S3 CSI\n@@ -65,7 +65,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.mountpoint_s3_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External DNS\n@@ -76,7 +76,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_dns\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External Secrets\n@@ -87,7 +87,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_secrets\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # FSx OpenZFS CSI\n@@ -98,7 +98,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.fsx_openzfs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller\n@@ -109,7 +109,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller - Target Group Binding Only\n@@ -120,7 +120,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller_targetgroup_only\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Amazon Managed Service for Prometheus\n@@ -131,7 +131,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.amazon_managed_service_prometheus\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Node Termination Handler\n@@ -142,7 +142,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.node_termination_handler\n- to = aws_iam_policy.this\n+ to = = aws_iam_role_policy_attachment.this\n }\n \n # Velero\n@@ -153,7 +153,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.velero\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # VPC CNI\n@@ -164,5 +164,5 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.vpc_cni\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n---\n\n\n---\n\nChoice D:\nmodules/iam-role-for-service-accounts/migrations.tf\n@@ -10,7 +10,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.aws_gateway_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cert Manager\n@@ -21,7 +21,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cert_manager\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Cluster Autoscaler\n@@ -32,7 +32,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.cluster_autoscaler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EBS CSI\n@@ -43,7 +43,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.ebs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # EFS CSI\n@@ -54,7 +54,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.efs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Mountpoint S3 CSI\n@@ -65,7 +65,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.mountpoint_s3_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External DNS\n@@ -76,7 +76,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_dns\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # External Secrets\n@@ -87,7 +87,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.external_secrets\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # FSx OpenZFS CSI\n@@ -98,7 +98,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.fsx_openzfs_csi\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller\n@@ -109,7 +109,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # AWS Load Balancer Controller - Target Group Binding Only\n@@ -120,7 +120,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.load_balancer_controller_targetgroup_only\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Amazon Managed Service for Prometheus\n@@ -131,7 +131,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.amazon_managed_service_prometheus\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Node Termination Handler\n@@ -142,7 +142,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.node_termination_handler\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # Velero\n@@ -153,7 +153,7 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.velero\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n \n # VPC CNI\n@@ -164,5 +164,5 @@ moved {\n \n moved {\n from = aws_iam_role_policy_attachment.vpc_cni\n- to = aws_iam_policy.this\n+ to = aws_iam_role_policy_attachment.this\n }\n---\n\n\n---\n"
}
] |
D
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\nSee https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-6-upgrade#data-source-aws_region\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/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ region = data.aws_region.current.region\n role_name_condition = var.role_name != null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\n\n\n---\n\nChoice B:\nmodules/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ = data.aws_region.current.region\n role_name_condition = var.role_name != null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\n\n\n---\n\nChoice C:\nmodules/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ region = data.aws_region.current.region\n role_name_condition = var.role_name != null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\n\n\n---\n\nChoice D:\nmodules/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ region = data.aws_region.current.region\n data.aws_partition.current.partition\n role_name_condition = var.role_name != null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\n\n\n---\n"
}
] |
A
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\nAdds GetParametersByPath for external-secrets\r\n\r\n## Motivation and Context\r\nFrom the logs of external-secrets \r\n> :\"GetParametersByPath: access denied. using fallback to describe parameters. It is recommended to add ssm:GetParametersByPath permissions\"\r\n\r\n## Breaking Changes\r\nNo breaking changes\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/iam-role-for-service-accounts-eks/policies.tf\n@@ -598,6 +598,7 @@ data \"aws_iam_policy_document\" \"external_secrets\" {\n actions = [\n \"ssm:GetParameter\",\n \"ssm:GetParameters\",\n+ \"ssm:GetParametersByPath\"\n ]\n \n resources = var.external_secrets_ssm_parameter_arns\n---\n\n\n---\n\nChoice B:\nmodules/iam-role-for-service-accounts-eks/policies.tf\n@@ -598,6 +598,7 @@ data \"aws_iam_policy_document\" \"external_secrets\" {\n actions = [\n \"ssm:GetParameter\",\n \"ssm:GetParameters\",\n+ \"ssm:GetParametersByPath\"\n ]\n \n resources = var.external_secrets_ssm_parameter_arns\n---\n\n\n---\n\nChoice C:\nmodules/iam-role-for-service-accounts-eks/policies.tf\n@@ -598,6 +598,7 @@ data \"aws_iam_policy_document\" \"external_secrets\" {\n actions = [\n \"ssm:GetParameter\",\n \"ssm:GetParameters\",\n+ \"ssm:GetParametersByPath\"\n \"ssm:GetParametersByPath\"\n ]\n \n resources = var.external_secrets_ssm_parameter_arns\n---\n\n\n---\n\nChoice D:\nmodules/iam-role-for-service-accounts-eks/policies.tf\n@@ -598,6 +598,7 @@ data \"aws_iam_policy_document\" \"external_secrets\" {\n actions = [\n \"ssm:GetParameter\",\n \"ssm:GetParameters\",\n+ \"ssm:GetParametersByPath\"\n ]\n \n resources = var.external_secrets_ssm_parameter_arns\n---\n\n\n---\n"
}
] |
A
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\n## Description\r\nThis PR fixes several typos found across the codebase\r\n\n\n---\n\nChoice A:\nmodules/iam-group-with-policies/main.tf\n@@ -18,7 +18,7 @@ resource \"aws_iam_group_membership\" \"this\" {\n }\n \n ################################\n-# IAM group policy attachements\n+# IAM group policy attachments\n ################################\n resource \"aws_iam_group_policy_attachment\" \"iam_self_management\" {\n count = var.attach_iam_self_management_policy ? 1 : 0\n---\nmodules/iam-role-for-service-accounts-eks/README.md\n@@ -225,7 +225,7 @@ No modules.\n | <a name=\"input_external_dns_hosted_zone_arns\"></a> [external\\_dns\\_hosted\\_zone\\_arns](#input\\_external\\_dns\\_hosted\\_zone\\_arns) | Route53 hosted zone ARNs to allow External DNS to manage records | `list(string)` | <pre>[<br/> \"arn:aws:route53:::hostedzone/*\"<br/>]</pre> | no |\n | <a name=\"input_external_secrets_kms_key_arns\"></a> [external\\_secrets\\_kms\\_key\\_arns](#input\\_external\\_secrets\\_kms\\_key\\_arns) | List of KMS Key ARNs that are used by Secrets Manager that contain secrets to mount using External Secrets | `list(string)` | <pre>[<br/> \"arn:aws:kms:*:*:key/*\"<br/>]</pre> | no |\n | <a name=\"input_external_secrets_secrets_manager_arns\"></a> [external\\_secrets\\_secrets\\_manager\\_arns](#input\\_external\\_secrets\\_secrets\\_manager\\_arns) | List of Secrets Manager ARNs that contain secrets to mount using External Secrets | `list(string)` | <pre>[<br/> \"arn:aws:secretsmanager:*:*:secret:*\"<br/>]</pre> | no |\n-| <a name=\"input_external_secrets_secrets_manager_create_permission\"></a> [external\\_secrets\\_secrets\\_manager\\_create\\_permission](#input\\_external\\_secrets\\_secrets\\_manager\\_create\\_permission) | Determins whether External Secrets may use secretsmanager:CreateSecret | `bool` | `false` | no |\n+| <a name=\"input_external_secrets_secrets_manager_create_permission\"></a> [external\\_secrets\\_secrets\\_manager\\_create\\_permission](#input\\_external\\_secrets\\_secrets\\_manager\\_create\\_permission) | Determines whether External Secrets may use secretsmanager:CreateSecret | `bool` | `false` | no |\n | <a name=\"input_external_secrets_ssm_parameter_arns\"></a> [external\\_secrets\\_ssm\\_parameter\\_arns](#input\\_external\\_secrets\\_ssm\\_parameter\\_arns) | List of Systems Manager Parameter ARNs that contain secrets to mount using ? Secrets | `list(string)` | <pre>[<br/> \"arn:aws:ssm:*:*:parameter/*\"<br/>]</pre> | no |\n | <a name=\"input_force_detach_policies\"></a> [force\\_detach\\_policies](#input\\_force\\_detach\\_policies) | Whether policies should be detached from this role when destroying | `bool` | `true` | no |\n | <a name=\"input_fsx_lustre_csi_service_role_arns\"></a> [fsx\\_lustre\\_csi\\_service\\_role\\_arns](#input\\_fsx\\_lustre\\_csi\\_service\\_role\\_arns) | Service role ARNs to allow FSx for Lustre CSI create and manage FSX for Lustre service linked roles | `list(string)` | <pre>[<br/> \"arn:aws:iam::*:role/aws-service-role/s3.data-source.lustre.fsx.amazonaws.com/*\"<br/>]</pre> | no |\n---\nmodules/iam-role-for-service-accounts-eks/variables.tf\n@@ -209,7 +209,7 @@ variable \"external_secrets_kms_key_arns\" {\n }\n \n variable \"external_secrets_secrets_manager_create_permission\" {\n- description = \"Determins whether External Secrets may use secretsmanager:CreateSecret\"\n+ description = \"Determines whether External Secrets may use secretsmanager:CreateSecret\"\n type = bool\n default = false\n }\n---\nmodules/iam-user/README.md\n@@ -6,7 +6,7 @@ Creates IAM user, IAM login profile, IAM access key and uploads IAM SSH user pub\n \n **If possible, always use PGP encryption to prevent Terraform from keeping unencrypted password and access secret key in state file.**\n \n-### Keybase pre-requisits\n+### Keybase pre-requisites\n \n When `pgp_key` is specified as `keybase:username`, make sure that that user has already uploaded public key to keybase.io. For example, user with username `test` has done it properly and you can [verify it here](https://keybase.io/test/pgp_keys.asc).\n \n---\n\n\n---\n\nChoice B:\nmodules/iam-group-with-policies/main.tf\n@@ -18,7 +18,7 @@ resource \"aws_iam_group_membership\" \"this\" {\n }\n \n ################################\n-# IAM group policy attachements\n+# IAM group policy attachments\n ################################\n resource \"aws_iam_group_policy_attachment\" \"iam_self_management\" {\n count = var.attach_iam_self_management_policy ? 1 : 0\n---\nmodules/iam-role-for-service-accounts-eks/README.md\n@@ -225,7 +225,7 @@ No modules.\n | <a name=\"input_external_dns_hosted_zone_arns\"></a> [external\\_dns\\_hosted\\_zone\\_arns](#input\\_external\\_dns\\_hosted\\_zone\\_arns) | Route53 hosted zone ARNs to allow External DNS to manage records | `list(string)` | <pre>[<br/> \"arn:aws:route53:::hostedzone/*\"<br/>]</pre> | no |\n | <a name=\"input_external_secrets_kms_key_arns\"></a> [external\\_secrets\\_kms\\_key\\_arns](#input\\_external\\_secrets\\_kms\\_key\\_arns) | List of KMS Key ARNs that are used by Secrets Manager that contain secrets to mount using External Secrets | `list(string)` | <pre>[<br/> \"arn:aws:kms:*:*:key/*\"<br/>]</pre> | no |\n | <a name=\"input_external_secrets_secrets_manager_arns\"></a> [external\\_secrets\\_secrets\\_manager\\_arns](#input\\_external\\_secrets\\_secrets\\_manager\\_arns) | List of Secrets Manager ARNs that contain secrets to mount using External Secrets | `list(string)` | <pre>[<br/> \"arn:aws:secretsmanager:*:*:secret:*\"<br/>]</pre> | no |\n-| <a name=\"input_external_secrets_secrets_manager_create_permission\"></a> [external\\_secrets\\_secrets\\_manager\\_create\\_permission](#input\\_external\\_secrets\\_secrets\\_manager\\_create\\_permission) | Determins whether to Secrets may use secretsmanager:CreateSecret | `bool` | `false` | no |\n+| <a name=\"input_external_secrets_secrets_manager_create_permission\"></a> [external\\_secrets\\_secrets\\_manager\\_create\\_permission](#input\\_external\\_secrets\\_secrets\\_manager\\_create\\_permission) | Determines whether External Secrets may use secretsmanager:CreateSecret | `bool` | `false` | no |\n | <a name=\"input_external_secrets_ssm_parameter_arns\"></a> [external\\_secrets\\_ssm\\_parameter\\_arns](#input\\_external\\_secrets\\_ssm\\_parameter\\_arns) | List of Systems Manager Parameter ARNs that contain secrets to mount using External Secrets | `list(string)` | <pre>[<br/> \"arn:aws:ssm:*:*:parameter/*\"<br/>]</pre> | no |\n | <a name=\"input_force_detach_policies\"></a> [force\\_detach\\_policies](#input\\_force\\_detach\\_policies) | Whether policies should be detached from this role when destroying | `bool` | `true` | no |\n | <a name=\"input_fsx_lustre_csi_service_role_arns\"></a> [fsx\\_lustre\\_csi\\_service\\_role\\_arns](#input\\_fsx\\_lustre\\_csi\\_service\\_role\\_arns) | Service role ARNs to allow FSx for Lustre CSI create and manage FSX for Lustre service linked roles | `list(string)` | <pre>[<br/> \"arn:aws:iam::*:role/aws-service-role/s3.data-source.lustre.fsx.amazonaws.com/*\"<br/>]</pre> | no |\n---\nmodules/iam-role-for-service-accounts-eks/variables.tf\n@@ -209,7 +209,7 @@ variable \"external_secrets_kms_key_arns\" {\n }\n \n variable \"external_secrets_secrets_manager_create_permission\" {\n- description = \"Determins whether External Secrets may use secretsmanager:CreateSecret\"\n+ description = \"Determines whether External Secrets may use secretsmanager:CreateSecret\"\n type = bool\n default = false\n }\n---\nmodules/iam-user/README.md\n@@ -6,7 +6,7 @@ Creates IAM user, IAM login profile, IAM access key and uploads IAM SSH user pub\n \n **If possible, always use PGP encryption to prevent Terraform from keeping unencrypted password and access secret key in state file.**\n \n-### Keybase pre-requisits\n+### Keybase pre-requisites\n \n When `pgp_key` is specified as `keybase:username`, make sure that that user has already uploaded public key to keybase.io. For example, user with username `test` has done it properly and you can [verify it here](https://keybase.io/test/pgp_keys.asc).\n \n---\n\n\n---\n\nChoice C:\nmodules/iam-group-with-policies/main.tf\n@@ -18,7 +18,7 @@ resource \"aws_iam_group_membership\" \"this\" {\n }\n \n ################################\n-# IAM group policy attachements\n+# IAM group policy attachments\n ################################\n resource \"aws_iam_group_policy_attachment\" \"iam_self_management\" {\n count = var.attach_iam_self_management_policy ? 1 : 0\n---\nmodules/iam-role-for-service-accounts-eks/README.md\n@@ -225,7 +225,7 @@ No modules.\n | <a name=\"input_external_dns_hosted_zone_arns\"></a> [external\\_dns\\_hosted\\_zone\\_arns](#input\\_external\\_dns\\_hosted\\_zone\\_arns) | Route53 hosted zone ARNs to allow External DNS to manage records | `list(string)` | <pre>[<br/> \"arn:aws:route53:::hostedzone/*\"<br/>]</pre> | no |\n | <a name=\"input_external_secrets_kms_key_arns\"></a> [external\\_secrets\\_kms\\_key\\_arns](#input\\_external\\_secrets\\_kms\\_key\\_arns) | List of KMS Key ARNs that are used by Secrets Manager that contain secrets to mount using External Secrets | `list(string)` | <pre>[<br/> \"arn:aws:kms:*:*:key/*\"<br/>]</pre> | no |\n | <a name=\"input_external_secrets_secrets_manager_arns\"></a> [external\\_secrets\\_secrets\\_manager\\_arns](#input\\_external\\_secrets\\_secrets\\_manager\\_arns) | List of Secrets Manager ARNs that contain secrets to mount using External Secrets | `list(string)` | <pre>[<br/> \"arn:aws:secretsmanager:*:*:secret:*\"<br/>]</pre> | no |\n-| <a name=\"input_external_secrets_secrets_manager_create_permission\"></a> [external\\_secrets\\_secrets\\_manager\\_create\\_permission](#input\\_external\\_secrets\\_secrets\\_manager\\_create\\_permission) | Determins whether External Secrets may use secretsmanager:CreateSecret | `bool` | `false` | no |\n+| <a name=\"input_external_secrets_secrets_manager_create_permission\"></a> [external\\_secrets\\_secrets\\_manager\\_create\\_permission](#input\\_external\\_secrets\\_secrets\\_manager\\_create\\_permission) | Determines whether External Secrets may use secretsmanager:CreateSecret | `bool` | `false` | no |\n | <a name=\"input_external_secrets_ssm_parameter_arns\"></a> [external\\_secrets\\_ssm\\_parameter\\_arns](#input\\_external\\_secrets\\_ssm\\_parameter\\_arns) | List of Systems Manager Parameter ARNs that contain secrets to mount using External Secrets | `list(string)` use <pre>[<br/> \"arn:aws:ssm:*:*:parameter/*\"<br/>]</pre> | no |\n | <a name=\"input_force_detach_policies\"></a> [force\\_detach\\_policies](#input\\_force\\_detach\\_policies) | Whether policies should be detached from this role when destroying | `bool` | `true` | no |\n | <a name=\"input_fsx_lustre_csi_service_role_arns\"></a> [fsx\\_lustre\\_csi\\_service\\_role\\_arns](#input\\_fsx\\_lustre\\_csi\\_service\\_role\\_arns) | Service role ARNs to allow FSx for Lustre CSI create and manage FSX for Lustre service linked roles | `list(string)` | <pre>[<br/> \"arn:aws:iam::*:role/aws-service-role/s3.data-source.lustre.fsx.amazonaws.com/*\"<br/>]</pre> | no |\n---\nmodules/iam-role-for-service-accounts-eks/variables.tf\n@@ -209,7 +209,7 @@ variable \"external_secrets_kms_key_arns\" {\n }\n \n variable \"external_secrets_secrets_manager_create_permission\" {\n- description = \"Determins whether External Secrets may use secretsmanager:CreateSecret\"\n+ description = \"Determines whether External Secrets may use secretsmanager:CreateSecret\"\n type = bool\n default = false\n }\n---\nmodules/iam-user/README.md\n@@ -6,7 +6,7 @@ Creates IAM user, IAM login profile, IAM access key and uploads IAM SSH user pub\n \n **If possible, always use PGP encryption to prevent Terraform from keeping unencrypted password and access secret key in state file.**\n \n-### Keybase pre-requisits\n+### Keybase pre-requisites\n \n When `pgp_key` is specified as `keybase:username`, make sure that that user has already uploaded public key to keybase.io. For example, user with username `test` has done it properly and you can [verify it here](https://keybase.io/test/pgp_keys.asc).\n \n---\n\n\n---\n\nChoice D:\nmodules/iam-group-with-policies/main.tf\n@@ -18,7 +18,7 @@ resource \"aws_iam_group_membership\" \"this\" {\n }\n \n ################################\n-# IAM group policy attachements\n+# IAM group policy attachments\n ################################\n resource \"aws_iam_group_policy_attachment\" \"iam_self_management\" {\n count = var.attach_iam_self_management_policy ? 1 : 0\n---\nmodules/iam-role-for-service-accounts-eks/README.md\n@@ -225,7 +225,7 @@ No modules.\n | <a name=\"input_external_dns_hosted_zone_arns\"></a> [external\\_dns\\_hosted\\_zone\\_arns](#input\\_external\\_dns\\_hosted\\_zone\\_arns) | Route53 hosted zone ARNs to allow External DNS to manage records | `list(string)` | <pre>[<br/> \"arn:aws:route53:::hostedzone/*\"<br/>]</pre> | no |\n | <a name=\"input_external_secrets_kms_key_arns\"></a> [external\\_secrets\\_kms\\_key\\_arns](#input\\_external\\_secrets\\_kms\\_key\\_arns) | List of KMS Key ARNs that are used by Secrets Manager that contain secrets to mount using External Secrets | `list(string)` | <pre>[<br/> \"arn:aws:kms:*:*:key/*\"<br/>]</pre> | no |\n | <a name=\"input_external_secrets_secrets_manager_arns\"></a> [external\\_secrets\\_secrets\\_manager\\_arns](#input\\_external\\_secrets\\_secrets\\_manager\\_arns) | List of Secrets Manager ARNs that contain secrets to mount using External Secrets | `list(string)` | <pre>[<br/> \"arn:aws:secretsmanager:*:*:secret:*\"<br/>]</pre> | no |\n-| <a name=\"input_external_secrets_secrets_manager_create_permission\"></a> [external\\_secrets\\_secrets\\_manager\\_create\\_permission](#input\\_external\\_secrets\\_secrets\\_manager\\_create\\_permission) | Determins whether External Secrets may use secretsmanager:CreateSecret | `bool` | `false` | no |\n+| <a name=\"input_external_secrets_secrets_manager_create_permission\"></a> [external\\_secrets\\_secrets\\_manager\\_create\\_permission](#input\\_external\\_secrets\\_secrets\\_manager\\_create\\_permission) | Determines whether External Secrets may use secretsmanager:CreateSecret | `bool` | `false` | no |\n | <a name=\"input_external_secrets_ssm_parameter_arns\"></a> [external\\_secrets\\_ssm\\_parameter\\_arns](#input\\_external\\_secrets\\_ssm\\_parameter\\_arns) | List of Systems Manager Parameter ARNs that contain secrets to mount using External Secrets | `list(string)` | <pre>[<br/> \"arn:aws:ssm:*:*:parameter/*\"<br/>]</pre> | no |\n | <a name=\"input_force_detach_policies\"></a> [force\\_detach\\_policies](#input\\_force\\_detach\\_policies) | Whether policies should be detached from this role when destroying | `bool` | `true` | no |\n | <a name=\"input_fsx_lustre_csi_service_role_arns\"></a> [fsx\\_lustre\\_csi\\_service\\_role\\_arns](#input\\_fsx\\_lustre\\_csi\\_service\\_role\\_arns) | Service role ARNs to allow FSx for Lustre CSI create and manage FSX for Lustre service linked roles | `list(string)` | <pre>[<br/> \"arn:aws:iam::*:role/aws-service-role/s3.data-source.lustre.fsx.amazonaws.com/*\"<br/>]</pre> | no |\n---\nmodules/iam-role-for-service-accounts-eks/variables.tf\n@@ -209,7 +209,7 @@ variable \"external_secrets_kms_key_arns\" {\n }\n \n variable \"external_secrets_secrets_manager_create_permission\" {\n- description = \"Determins whether External Secrets may use secretsmanager:CreateSecret\"\n+ description = \"Determines whether External Secrets may use secretsmanager:CreateSecret\"\n type = bool\n default = false\n }\n---\nmodules/iam-user/README.md\n@@ -6,7 +6,7 @@ Creates IAM user, IAM login profile, IAM access key and uploads IAM SSH user pub\n \n **If possible, always use PGP encryption to prevent Terraform from keeping unencrypted password and access secret key in state file.**\n \n-### Keybase pre-requisits\n+### Keybase pre-requisites\n \n When `pgp_key` is specified as `keybase:username`, make sure that that user has already uploaded public key to keybase.io. For example, user with username `test` has done it properly and you can [verify it here](https://keybase.io/test/pgp_keys.asc).\n \n---\n\n\n---\n"
}
] |
D
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\nReplaces the deprecated `data.aws_region.current.name` with `data.aws_region.current.region` in the IAM Role for Service Accounts EKS module.\r\n\r\n## Description\r\n- Updated `modules/iam-role-for-service-accounts-eks/main.tf` to use the non-deprecated `region` attribute instead of `name`\r\n\r\n## Motivation and Context\r\nThe `name` attribute of the `aws_region` data source has been deprecated by the AWS provider. This change ensures compatibility with current and future versions of the AWS provider.\r\n\r\nhttps://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region#name-1\r\n\r\nfix: https://github.com/terraform-aws-modules/terraform-aws-iam/issues/574\n\n---\n\nChoice A:\nexamples/iam-role-for-service-accounts-eks/README.md\n@@ -19,14 +19,14 @@ Run `terraform destroy` when you don't need these resources.\n \n | Name | Version |\n |------|---------|\n-| <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 4.0, < 6.0 |\n+| <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.5.7 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 6.0 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 4.0, < 6.0 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 6.0 |\n \n ## Modules\n \n@@ -42,7 +42,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_disabled\"></a> [disabled](#module\\_disabled) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_ebs_csi_irsa_role\"></a> [ebs\\_csi\\_irsa\\_role](#module\\_ebs\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_efs_csi_irsa_role\"></a> [efs\\_csi\\_irsa\\_role](#module\\_efs\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n-| <a name=\"module_eks\"></a> [eks](#module\\_eks) | terraform-aws-modules/eks/aws | ~> 19.21 |\n+| <a name=\"module_eks\"></a> [eks](#module\\_eks) | terraform-aws-modules/eks/aws | ~> 21.0 |\n | <a name=\"module_external_dns_irsa_role\"></a> [external\\_dns\\_irsa\\_role](#module\\_external\\_dns\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_external_secrets_irsa_role\"></a> [external\\_secrets\\_irsa\\_role](#module\\_external\\_secrets\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_fsx_lustre_csi_irsa_role\"></a> [fsx\\_lustre\\_csi\\_irsa\\_role](#module\\_fsx\\_lustre\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n@@ -56,7 +56,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_mountpoint_s3_csi_irsa_role\"></a> [mountpoint\\_s3\\_csi\\_irsa\\_role](#module\\_mountpoint\\_s3\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_node_termination_handler_irsa_role\"></a> [node\\_termination\\_handler\\_irsa\\_role](#module\\_node\\_termination\\_handler\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_velero_irsa_role\"></a> [velero\\_irsa\\_role](#module\\_velero\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n-| <a name=\"module_vpc\"></a> [vpc](#module\\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |\n+| <a name=\"module_vpc\"></a> [vpc](#module\\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |\n | <a name=\"module_vpc_cni_ipv4_irsa_role\"></a> [vpc\\_cni\\_ipv4\\_irsa\\_role](#module\\_vpc\\_cni\\_ipv4\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_vpc_cni_ipv6_irsa_role\"></a> [vpc\\_cni\\_ipv6\\_irsa\\_role](#module\\_vpc\\_cni\\_ipv6\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n \n---\nexamples/iam-role-for-service-accounts-eks/main.tf\n@@ -455,7 +455,7 @@ module \"iam_eks_role\" {\n \n module \"vpc\" {\n source = \"terraform-aws-modules/vpc/aws\"\n- version = \"~> 5.0\"\n+ version = \"~> 6.0\"\n \n name = local.name\n cidr = local.vpc_cidr\n@@ -480,10 +480,10 @@ module \"vpc\" {\n \n module \"eks\" {\n source = \"terraform-aws-modules/eks/aws\"\n- version = \"~> 19.21\"\n+ version = \"~> 21.0\"\n \n- cluster_name = local.name\n- cluster_version = \"1.28\"\n+ name = local.name\n+ kubernetes_version = \"1.31\"\n \n vpc_id = module.vpc.vpc_id\n subnet_ids = module.vpc.private_subnets\n---\nexamples/iam-role-for-service-accounts-eks/versions.tf\n@@ -1,10 +1,10 @@\n terraform {\n- required_version = \">= 1.0\"\n+ required_version = \">= 1.5.7\"\n \n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0, < 6.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\nmodules/iam-role-for-service-accounts-eks/README.md\n@@ -108,13 +108,13 @@ module \"eks\" {\n | Name | Version |\n |------|---------|\n | <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 4.0 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 6.0 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 4.0 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 6.0 |\n \n ## Modules\n \n---\nmodules/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ region = data.aws_region.current.region\n role_name_condition = var.role_name 21.0\"\n null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\nmodules/iam-role-for-service-accounts-eks/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\nwrappers/iam-role-for-service-accounts-eks/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\n\n\n---\n\nChoice B:\nexamples/iam-role-for-service-accounts-eks/README.md\n@@ -19,14 +19,14 @@ Run `terraform destroy` when you don't need these resources.\n \n | Name | Version |\n |------|---------|\n-| <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 4.0, < 6.0 |\n+| <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.5.7 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 6.0 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 4.0, < 6.0 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 6.0 |\n \n ## Modules\n \n@@ -42,7 +42,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_disabled\"></a> [disabled](#module\\_disabled) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_ebs_csi_irsa_role\"></a> [ebs\\_csi\\_irsa\\_role](#module\\_ebs\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_efs_csi_irsa_role\"></a> [efs\\_csi\\_irsa\\_role](#module\\_efs\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n-| <a name=\"module_eks\"></a> [eks](#module\\_eks) | terraform-aws-modules/eks/aws | ~> 19.21 |\n+| <a name=\"module_eks\"></a> [eks](#module\\_eks) | terraform-aws-modules/eks/aws | ~> 21.0 |\n | <a name=\"module_external_dns_irsa_role\"></a> [external\\_dns\\_irsa\\_role](#module\\_external\\_dns\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_external_secrets_irsa_role\"></a> [external\\_secrets\\_irsa\\_role](#module\\_external\\_secrets\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_fsx_lustre_csi_irsa_role\"></a> [fsx\\_lustre\\_csi\\_irsa\\_role](#module\\_fsx\\_lustre\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n@@ -56,7 +56,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_mountpoint_s3_csi_irsa_role\"></a> [mountpoint\\_s3\\_csi\\_irsa\\_role](#module\\_mountpoint\\_s3\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_node_termination_handler_irsa_role\"></a> [node\\_termination\\_handler\\_irsa\\_role](#module\\_node\\_termination\\_handler\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_velero_irsa_role\"></a> [velero\\_irsa\\_role](#module\\_velero\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n-| <a name=\"module_vpc\"></a> [vpc](#module\\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |\n+| <a name=\"module_vpc\"></a> [vpc](#module\\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |\n | <a name=\"module_vpc_cni_ipv4_irsa_role\"></a> [vpc\\_cni\\_ipv4\\_irsa\\_role](#module\\_vpc\\_cni\\_ipv4\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_vpc_cni_ipv6_irsa_role\"></a> [vpc\\_cni\\_ipv6\\_irsa\\_role](#module\\_vpc\\_cni\\_ipv6\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n \n---\nexamples/iam-role-for-service-accounts-eks/main.tf\n@@ -455,7 +455,7 @@ module \"iam_eks_role\" {\n \n module \"vpc\" {\n source = \"terraform-aws-modules/vpc/aws\"\n- version = \"~> 5.0\"\n+ version = \"~> 6.0\"\n \n name = local.name\n cidr = local.vpc_cidr\n@@ -480,10 +480,10 @@ module \"vpc\" {\n \n module \"eks\" {\n source = \"terraform-aws-modules/eks/aws\"\n- version = \"~> 19.21\"\n+ version = \"~> 21.0\"\n \n- cluster_name = local.name\n- cluster_version = \"1.28\"\n+ name = local.name\n+ kubernetes_version = \"1.31\"\n \n vpc_id = module.vpc.vpc_id\n subnet_ids = module.vpc.private_subnets\n---\nexamples/iam-role-for-service-accounts-eks/versions.tf\n@@ -1,10 +1,10 @@\n terraform {\n- required_version = \">= 1.0\"\n+ required_version = \">= 1.5.7\"\n \n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0, < 6.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\nmodules/iam-role-for-service-accounts-eks/README.md\n@@ -108,13 +108,13 @@ module \"eks\" {\n | Name | Version |\n |------|---------|\n | <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 4.0 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 6.0 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 4.0 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 6.0 |\n \n ## Modules\n \n---\nmodules/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ region = data.aws_region.current.region\n role_name_condition = var.role_name != null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\nmodules/iam-role-for-service-accounts-eks/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\nwrappers/iam-role-for-service-accounts-eks/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\n\n\n---\n\nChoice C:\nexamples/iam-role-for-service-accounts-eks/README.md\n@@ -19,14 +19,14 @@ Run `terraform destroy` when you don't need these resources.\n \n | Name | Version |\n |------|---------|\n-| <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 4.0, < 6.0 |\n+| <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.5.7 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 6.0 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 4.0, < 6.0 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 6.0 |\n \n ## Modules\n \n@@ -42,7 +42,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_disabled\"></a> [disabled](#module\\_disabled) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_ebs_csi_irsa_role\"></a> [ebs\\_csi\\_irsa\\_role](#module\\_ebs\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_efs_csi_irsa_role\"></a> [efs\\_csi\\_irsa\\_role](#module\\_efs\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n-| <a name=\"module_eks\"></a> [eks](#module\\_eks) | terraform-aws-modules/eks/aws | ~> 19.21 |\n+| <a name=\"module_eks\"></a> [eks](#module\\_eks) | terraform-aws-modules/eks/aws | ~> 21.0 |\n | <a name=\"module_external_dns_irsa_role\"></a> [external\\_dns\\_irsa\\_role](#module\\_external\\_dns\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_external_secrets_irsa_role\"></a> [external\\_secrets\\_irsa\\_role](#module\\_external\\_secrets\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_fsx_lustre_csi_irsa_role\"></a> [fsx\\_lustre\\_csi\\_irsa\\_role](#module\\_fsx\\_lustre\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n@@ -56,7 +56,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_mountpoint_s3_csi_irsa_role\"></a> [mountpoint\\_s3\\_csi\\_irsa\\_role](#module\\_mountpoint\\_s3\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_node_termination_handler_irsa_role\"></a> [node\\_termination\\_handler\\_irsa\\_role](#module\\_node\\_termination\\_handler\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_velero_irsa_role\"></a> [velero\\_irsa\\_role](#module\\_velero\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n-| <a name=\"module_vpc\"></a> [vpc](#module\\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |\n+| <a name=\"module_vpc\"></a> [vpc](#module\\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |\n | <a name=\"module_vpc_cni_ipv4_irsa_role\"></a> [vpc\\_cni\\_ipv4\\_irsa\\_role](#module\\_vpc\\_cni\\_ipv4\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_vpc_cni_ipv6_irsa_role\"></a> [vpc\\_cni\\_ipv6\\_irsa\\_role](#module\\_vpc\\_cni\\_ipv6\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n \n---\nexamples/iam-role-for-service-accounts-eks/main.tf\n@@ -455,7 +455,7 @@ module \"iam_eks_role\" {\n \n module \"vpc\" {\n source = \"terraform-aws-modules/vpc/aws\"\n- version = \"~> 5.0\"\n+ version = \"~> 6.0\"\n \n name = local.name\n cidr = local.vpc_cidr\n@@ -480,10 +480,10 @@ module \"vpc\" {\n \n module \"eks\" {\n source = \"terraform-aws-modules/eks/aws\"\n- version = \"~> 19.21\"\n+ version = \"~> 21.0\"\n \n- cluster_name = local.name\n- cluster_version = \"1.28\"\n+ name = local.name\n+ kubernetes_version = \"1.31\"\n \n vpc_id = module.vpc.vpc_id\n subnet_ids = module.vpc.private_subnets\n---\nexamples/iam-role-for-service-accounts-eks/versions.tf\n@@ -1,10 +1,10 @@\n terraform {\n- required_version = \">= 1.0\"\n+ required_version = \">= 1.5.7\"\n \n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0, < 6.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\nmodules/iam-role-for-service-accounts-eks/README.md\n@@ -108,13 +108,13 @@ module \"eks\" {\n | Name | Version |\n |------|---------|\n | <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 4.0 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 6.0 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 4.0 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 6.0 |\n \n ## Modules\n \n---\nmodules/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ region = data.aws_region.current.region\n role_name_condition = var.role_name != null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\nmodules/iam-role-for-service-accounts-eks/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\nwrappers/iam-role-for-service-accounts-eks/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\n\n\n---\n\nChoice D:\nexamples/iam-role-for-service-accounts-eks/README.md\n@@ -19,14 +19,14 @@ Run `terraform destroy` when you don't need these resources.\n \n | Name | Version |\n |------|---------|\n-| <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 4.0, < 6.0 |\n+| <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.5.7 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 6.0 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 4.0, < 6.0 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 6.0 |\n \n ## Modules\n \n@@ -42,7 +42,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_disabled\"></a> [disabled](#module\\_disabled) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_ebs_csi_irsa_role\"></a> [ebs\\_csi\\_irsa\\_role](#module\\_ebs\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_efs_csi_irsa_role\"></a> [efs\\_csi\\_irsa\\_role](#module\\_efs\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n-| <a name=\"module_eks\"></a> [eks](#module\\_eks) | terraform-aws-modules/eks/aws | ~> 19.21 |\n+| <a name=\"module_eks\"></a> [eks](#module\\_eks) | terraform-aws-modules/eks/aws | ~> 21.0 |\n | <a name=\"module_external_dns_irsa_role\"></a> [external\\_dns\\_irsa\\_role](#module\\_external\\_dns\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_external_secrets_irsa_role\"></a> [external\\_secrets\\_irsa\\_role](#module\\_external\\_secrets\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_fsx_lustre_csi_irsa_role\"></a> [fsx\\_lustre\\_csi\\_irsa\\_role](#module\\_fsx\\_lustre\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n@@ -56,7 +56,7 @@ Run `terraform destroy` when you don't need these resources.\n | <a name=\"module_mountpoint_s3_csi_irsa_role\"></a> [mountpoint\\_s3\\_csi\\_irsa\\_role](#module\\_mountpoint\\_s3\\_csi\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_node_termination_handler_irsa_role\"></a> [node\\_termination\\_handler\\_irsa\\_role](#module\\_node\\_termination\\_handler\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_velero_irsa_role\"></a> [velero\\_irsa\\_role](#module\\_velero\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n-| <a name=\"module_vpc\"></a> [vpc](#module\\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |\n+| <a name=\"module_vpc\"></a> [vpc](#module\\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |\n | <a name=\"module_vpc_cni_ipv4_irsa_role\"></a> [vpc\\_cni\\_ipv4\\_irsa\\_role](#module\\_vpc\\_cni\\_ipv4\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n | <a name=\"module_vpc_cni_ipv6_irsa_role\"></a> [vpc\\_cni\\_ipv6\\_irsa\\_role](#module\\_vpc\\_cni\\_ipv6\\_irsa\\_role) | ../../modules/iam-role-for-service-accounts-eks | n/a |\n \n---\nexamples/iam-role-for-service-accounts-eks/main.tf\n@@ -455,7 +455,7 @@ module \"iam_eks_role\" {\n \n module \"vpc\" {\n source = \"terraform-aws-modules/vpc/aws\"\n- version = \"~> 5.0\"\n+ account_id = \"~> 6.0\"\n \n name = local.name\n cidr = local.vpc_cidr\n@@ -480,10 +480,10 @@ module \"vpc\" {\n \n module \"eks\" {\n source = \"terraform-aws-modules/eks/aws\"\n- version = \"~> 19.21\"\n+ version = \"~> 21.0\"\n \n- cluster_name = local.name\n- cluster_version = \"1.28\"\n+ name = local.name\n+ kubernetes_version = \"1.31\"\n \n vpc_id = module.vpc.vpc_id\n subnet_ids = module.vpc.private_subnets\n---\nexamples/iam-role-for-service-accounts-eks/versions.tf\n@@ -1,10 +1,10 @@\n terraform {\n- required_version = \">= 1.0\"\n+ required_version = \">= 1.5.7\"\n \n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0, < 6.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\nmodules/iam-role-for-service-accounts-eks/README.md\n@@ -108,13 +108,13 @@ module \"eks\" {\n | Name | Version |\n |------|---------|\n | <a name=\"requirement_terraform\"></a> [terraform](#requirement\\_terraform) | >= 1.0 |\n-| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 4.0 |\n+| <a name=\"requirement_aws\"></a> [aws](#requirement\\_aws) | >= 6.0 |\n \n ## Providers\n \n | Name | Version |\n |------|---------|\n-| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 4.0 |\n+| <a name=\"provider_aws\"></a> [aws](#provider\\_aws) | >= 6.0 |\n \n ## Modules\n \n---\nmodules/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ region = data.aws_region.current.region\n role_name_condition = var.role_name != null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\nmodules/iam-role-for-service-accounts-eks/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\nwrappers/iam-role-for-service-accounts-eks/versions.tf\n@@ -4,7 +4,7 @@ terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n- version = \">= 4.0\"\n+ version = \">= 6.0\"\n }\n }\n }\n---\n\n\n---\n"
}
] |
B
|
[
{
"role": "system",
"content": "Choose the best Terraform patch (A/B/C/D) that implements the requested IAM change safely. Only respond with a single uppercase letter."
},
{
"role": "user",
"content": "Task Description:\ndata.aws_region.current.name is deprecated, now we need to reference data.aws_region.current.region.\r\n\r\nSee https://registry.terraform.io/providers/hashicorp/aws/6.5.0/docs/data-sources/region\n\n---\n\nChoice A:\nmodules/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ region = data.aws_region.current.region\n role_name_condition = var.role_name != null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\n\n\n---\n\nChoice B:\nmodules/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ region = data.aws_region.current.region\n role_name_condition = var.role_name != null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\n\n\n---\n\nChoice C:\nmodules/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ region = data.aws_region.current.region\n role_name_condition = var.role_name != null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\n\n\n---\n\nChoice D:\nmodules/iam-role-for-service-accounts-eks/main.tf\n@@ -6,7 +6,7 @@ locals {\n account_id = data.aws_caller_identity.current.account_id\n partition = data.aws_partition.current.partition\n dns_suffix = data.aws_partition.current.dns_suffix\n- region = data.aws_region.current.name\n+ region = data.aws_region.current.region\n role_name_condition = var.role_name != null ? var.role_name : \"${var.role_name_prefix}*\"\n }\n \n---\n\n\n---\n"
}
] |
A
|
End of preview. Expand
in Data Studio
No dataset card yet
- Downloads last month
- 33