-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwf_network_manager.tf
83 lines (77 loc) · 2.61 KB
/
wf_network_manager.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
module "iam_role_network_manager" {
count = var.create_network_manager_role ? 1 : 0
source = "terraform-aws-modules/iam/aws//modules/iam-assumable-role"
version = "5.17.0"
create_role = true
role_name = "wf-NetworkManager${local.resource_suffix}"
role_description = "Create and manage VPCs for EKS clusters"
role_requires_mfa = false
custom_role_policy_arns = [module.iam_policy_network_manager[0].arn]
trusted_role_arns = [var.wayfinder_iam_role_arn]
}
module "iam_policy_network_manager" {
count = var.create_network_manager_role ? 1 : 0
source = "terraform-aws-modules/iam/aws//modules/iam-policy"
version = "5.17.0"
name = "wf-NetworkManager${local.resource_suffix}"
description = "Create and manage VPCs for EKS clusters"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:AcceptTransitGatewayVpcAttachment",
"ec2:AcceptVpcPeeringConnection",
"ec2:AllocateAddress",
"ec2:AssociateRouteTable",
"ec2:AttachInternetGateway",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CreateInternetGateway",
"ec2:CreateNatGateway",
"ec2:CreateRoute",
"ec2:CreateRouteTable",
"ec2:CreateSecurityGroup",
"ec2:CreateSubnet",
"ec2:CreateTags",
"ec2:CreateTransitGatewayVpcAttachment",
"ec2:CreateVpc",
"ec2:CreateVpcPeeringConnection",
"ec2:DeleteInternetGateway",
"ec2:DeleteNatGateway",
"ec2:DeleteNetworkInterface",
"ec2:DeleteRoute",
"ec2:DeleteRouteTable",
"ec2:DeleteSecurityGroup",
"ec2:DeleteSubnet",
"ec2:DeleteTransitGatewayVpcAttachment",
"ec2:DeleteVpc",
"ec2:DeleteVpcPeeringConnection",
"ec2:DescribeAddresses",
"ec2:DescribeAvailabilityZones",
"ec2:DescribeInternetGateways",
"ec2:DescribeNatGateWays",
"ec2:DescribeNetworkInterfaces",
"ec2:DescribeRouteTables",
"ec2:DescribeSecurityGroups",
"ec2:DescribeSubnets",
"ec2:DescribeTransitGateways",
"ec2:DescribeTransitGatewayVpcAttachments",
"ec2:DescribeVpcPeeringConnections",
"ec2:DescribeVpcs",
"ec2:DetachInternetGateway",
"ec2:ModifyVpcAttribute",
"ec2:ReleaseAddress",
"ec2:RevokeSecurityGroupIngress",
"eks:DescribeCluster",
"elasticloadbalancing:DeleteLoadBalancer",
"elasticloadbalancing:DescribeLoadBalancers",
"elasticloadbalancing:DescribeTags"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
EOF
}