forked from rancherfederal/rke2-aws-tf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.tf
44 lines (41 loc) · 1.28 KB
/
data.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
# Required IAM Policy for AWS CCM
data "aws_iam_policy_document" "aws_ccm" {
count = var.iam_instance_profile == "" && var.enable_ccm ? 1 : 0
statement {
effect = "Allow"
resources = ["*"]
actions = [
"ec2:DescribeInstances",
"ec2:DescribeRegions",
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:GetRepositoryPolicy",
"ecr:DescribeRepositories",
"ecr:ListImages",
"ecr:BatchGetImage",
"autoscaling:DescribeTags",
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
]
}
}
# Required IAM Policy for AWS Cluster Autoscaler
data "aws_iam_policy_document" "aws_autoscaler" {
count = var.iam_instance_profile == "" && var.enable_autoscaler ? 1 : 0
statement {
effect = "Allow"
resources = ["*"]
actions = [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup",
"ec2:DescribeLaunchTemplateVersions",
"ec2:DescribeInstanceTypes"
]
}
}