Skip to content

Commit 343e5fe

Browse files
ph-lPeng Hiang LOWbryantbiggs
authored
feat: Update IAM policy for AWS Gateway Controller (#563)
Co-authored-by: Peng Hiang LOW <[email protected]> Co-authored-by: Bryant Biggs <[email protected]>
1 parent df4106c commit 343e5fe

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

modules/iam-role-for-service-accounts-eks/policies.tf

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,49 @@
55
data "aws_iam_policy_document" "aws_gateway_controller" {
66
count = var.create_role && var.attach_aws_gateway_controller_policy ? 1 : 0
77

8-
# https://github.com/aws/aws-application-networking-k8s/blob/v0.0.11/examples/recommended-inline-policy.json
8+
# https://github.com/aws/aws-application-networking-k8s/blob/v1.1.0/files/controller-installation/recommended-inline-policy.json
99
statement {
1010
actions = [
1111
"vpc-lattice:*",
12-
"iam:CreateServiceLinkedRole",
1312
"ec2:DescribeVpcs",
1413
"ec2:DescribeSubnets",
14+
"ec2:DescribeTags",
15+
"ec2:DescribeSecurityGroups",
16+
"logs:CreateLogDelivery",
17+
"logs:GetLogDelivery",
18+
"logs:DescribeLogGroups",
19+
"logs:PutResourcePolicy",
20+
"logs:DescribeResourcePolicies",
21+
"logs:UpdateLogDelivery",
22+
"logs:DeleteLogDelivery",
23+
"logs:ListLogDeliveries",
24+
"tag:GetResources",
25+
"firehose:TagDeliveryStream",
26+
"s3:GetBucketPolicy",
27+
"s3:PutBucketPolicy",
1528
]
1629
resources = ["*"]
1730
}
31+
32+
statement {
33+
actions = ["iam:CreateServiceLinkedRole"]
34+
resources = ["arn:${local.partition}:iam::*:role/aws-service-role/vpc-lattice.${local.dns_suffix}/AWSServiceRoleForVpcLattice"]
35+
condition {
36+
test = "StringLike"
37+
variable = "iam:AWSServiceName"
38+
values = ["vpc-lattice.${local.dns_suffix}"]
39+
}
40+
}
41+
42+
statement {
43+
actions = ["iam:CreateServiceLinkedRole"]
44+
resources = ["arn:${local.partition}:iam::*:role/aws-service-role/delivery.logs.${local.dns_suffix}/AWSServiceRoleForLogDelivery"]
45+
condition {
46+
test = "StringLike"
47+
variable = "iam:AWSServiceName"
48+
values = ["delivery.logs.${local.dns_suffix}"]
49+
}
50+
}
1851
}
1952

2053
resource "aws_iam_policy" "aws_gateway_controller" {

0 commit comments

Comments
 (0)