docs: Add use case examples to the 18.x upgrade guide (#1783)

This commit is contained in:
Nick Janetakis
2022-01-17 12:17:33 -05:00
committed by GitHub
parent 9c6c36c5c8
commit fcd4abb570

View File

@@ -551,3 +551,36 @@ module "cluster_after" {
}
}
```
### Attaching an IAM role policy to a Fargate profile
#### Before 17.x
```hcl
resource "aws_iam_role_policy_attachment" "default" {
role = module.eks.fargate_iam_role_name
policy_arn = aws_iam_policy.default.arn
}
```
#### After 18.x
```hcl
# Attach the policy to an "example" Fargate profile
resource "aws_iam_role_policy_attachment" "default" {
role = module.eks.fargate_profiles["example"].iam_role_name
policy_arn = aws_iam_policy.default.arn
}
```
Or:
```hcl
# Attach the policy to all Fargate profiles
resource "aws_iam_role_policy_attachment" "default" {
for_each = module.eks.fargate_profiles
role = each.value.iam_role_name
policy_arn = aws_iam_policy.default.arn
}
```