-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test for cluster names beginning with a digit
This will fail until we address each resource type generating terraform resource names that are purely the cluster name
- Loading branch information
Showing
35 changed files
with
3,461 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
..._cluster/digit/data/aws_iam_role_dns-controller.kube-system.sa.minimal.example.com_policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRoleWithWebIdentity", | ||
"Condition": { | ||
"StringEquals": { | ||
"api.internal.123.example.com:sub": "system:serviceaccount:kube-system:dns-controller" | ||
} | ||
}, | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Federated": "arn:aws:iam::123456789012:oidc-provider/api.internal.123.example.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/integration/update_cluster/digit/data/aws_iam_role_masters.minimal.example.com_policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { "Service": "ec2.amazonaws.com"}, | ||
"Action": "sts:AssumeRole" | ||
} | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
...cluster/digit/data/aws_iam_role_myotherserviceaccount.myapp.sa.minimal.example.com_policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRoleWithWebIdentity", | ||
"Condition": { | ||
"StringEquals": { | ||
"discovery.example.com/123.example.com:sub": "system:serviceaccount:myapp:myotherserviceaccount" | ||
} | ||
}, | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Federated": "arn:aws:iam::123456789012:oidc-provider/discovery.example.com/123.example.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} |
17 changes: 17 additions & 0 deletions
17
...te_cluster/digit/data/aws_iam_role_myserviceaccount.default.sa.minimal.example.com_policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRoleWithWebIdentity", | ||
"Condition": { | ||
"StringEquals": { | ||
"discovery.example.com/123.example.com:sub": "system:serviceaccount:default:myserviceaccount" | ||
} | ||
}, | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Federated": "arn:aws:iam::123456789012:oidc-provider/discovery.example.com/123.example.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/integration/update_cluster/digit/data/aws_iam_role_nodes.minimal.example.com_policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { "Service": "ec2.amazonaws.com"}, | ||
"Action": "sts:AssumeRole" | ||
} | ||
] | ||
} |
34 changes: 34 additions & 0 deletions
34
...r/digit/data/aws_iam_role_policy_dns-controller.kube-system.sa.minimal.example.com_policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"route53:ChangeResourceRecordSets", | ||
"route53:ListResourceRecordSets", | ||
"route53:GetHostedZone" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:aws:route53:::hostedzone/Z1AFAKE1ZON3YO" | ||
] | ||
}, | ||
{ | ||
"Action": [ | ||
"route53:GetChange" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:aws:route53:::change/*" | ||
] | ||
}, | ||
{ | ||
"Action": [ | ||
"route53:ListHostedZones" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"*" | ||
] | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} |
233 changes: 233 additions & 0 deletions
233
...egration/update_cluster/digit/data/aws_iam_role_policy_masters.minimal.example.com_policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
{ | ||
"Statement": [ | ||
{ | ||
"Action": "ec2:AttachVolume", | ||
"Condition": { | ||
"StringEquals": { | ||
"aws:ResourceTag/KubernetesCluster": "123.example.com", | ||
"aws:ResourceTag/k8s.io/role/master": "1" | ||
} | ||
}, | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"*" | ||
] | ||
}, | ||
{ | ||
"Action": [ | ||
"s3:Get*" | ||
], | ||
"Effect": "Allow", | ||
"Resource": "arn:aws:s3:::placeholder-read-bucket/clusters.example.com/123.example.com/*" | ||
}, | ||
{ | ||
"Action": [ | ||
"s3:GetObject", | ||
"s3:DeleteObject", | ||
"s3:DeleteObjectVersion", | ||
"s3:PutObject" | ||
], | ||
"Effect": "Allow", | ||
"Resource": "arn:aws:s3:::placeholder-write-bucket/clusters.example.com/123.example.com/backups/etcd/main/*" | ||
}, | ||
{ | ||
"Action": [ | ||
"s3:GetObject", | ||
"s3:DeleteObject", | ||
"s3:DeleteObjectVersion", | ||
"s3:PutObject" | ||
], | ||
"Effect": "Allow", | ||
"Resource": "arn:aws:s3:::placeholder-write-bucket/clusters.example.com/123.example.com/backups/etcd/events/*" | ||
}, | ||
{ | ||
"Action": [ | ||
"s3:GetBucketLocation", | ||
"s3:GetEncryptionConfiguration", | ||
"s3:ListBucket", | ||
"s3:ListBucketVersions" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:aws:s3:::placeholder-read-bucket" | ||
] | ||
}, | ||
{ | ||
"Action": [ | ||
"s3:GetBucketLocation", | ||
"s3:GetEncryptionConfiguration", | ||
"s3:ListBucket", | ||
"s3:ListBucketVersions" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:aws:s3:::placeholder-write-bucket" | ||
] | ||
}, | ||
{ | ||
"Action": [ | ||
"route53:ChangeResourceRecordSets", | ||
"route53:ListResourceRecordSets", | ||
"route53:GetHostedZone" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:aws:route53:::hostedzone/Z1AFAKE1ZON3YO" | ||
] | ||
}, | ||
{ | ||
"Action": [ | ||
"route53:GetChange" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:aws:route53:::change/*" | ||
] | ||
}, | ||
{ | ||
"Action": [ | ||
"route53:ListHostedZones" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"*" | ||
] | ||
}, | ||
{ | ||
"Action": "ec2:CreateTags", | ||
"Condition": { | ||
"StringEquals": { | ||
"ec2:CreateAction": [ | ||
"CreateVolume", | ||
"CreateSnapshot" | ||
] | ||
} | ||
}, | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:aws:ec2:*:*:volume/*", | ||
"arn:aws:ec2:*:*:snapshot/*" | ||
] | ||
}, | ||
{ | ||
"Action": "ec2:CreateTags", | ||
"Condition": { | ||
"StringEquals": { | ||
"ec2:CreateAction": [ | ||
"CreateVolume", | ||
"CreateSnapshot" | ||
] | ||
} | ||
}, | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:aws:ec2:*:*:volume/*", | ||
"arn:aws:ec2:*:*:snapshot/*" | ||
] | ||
}, | ||
{ | ||
"Action": "ec2:DeleteTags", | ||
"Condition": { | ||
"StringEquals": { | ||
"aws:ResourceTag/KubernetesCluster": "123.example.com" | ||
} | ||
}, | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"arn:aws:ec2:*:*:volume/*", | ||
"arn:aws:ec2:*:*:snapshot/*" | ||
] | ||
}, | ||
{ | ||
"Action": [ | ||
"autoscaling:DescribeAutoScalingGroups", | ||
"autoscaling:DescribeAutoScalingInstances", | ||
"autoscaling:DescribeLaunchConfigurations", | ||
"autoscaling:DescribeTags", | ||
"ec2:CreateSecurityGroup", | ||
"ec2:CreateTags", | ||
"ec2:DescribeAccountAttributes", | ||
"ec2:DescribeInstances", | ||
"ec2:DescribeRegions", | ||
"ec2:DescribeRouteTables", | ||
"ec2:DescribeSecurityGroups", | ||
"ec2:DescribeSubnets", | ||
"ec2:DescribeTags", | ||
"ec2:DescribeVolumes", | ||
"ec2:DescribeVolumesModifications", | ||
"ec2:DescribeVpcs", | ||
"elasticloadbalancing:DescribeListeners", | ||
"elasticloadbalancing:DescribeLoadBalancerAttributes", | ||
"elasticloadbalancing:DescribeLoadBalancerPolicies", | ||
"elasticloadbalancing:DescribeLoadBalancers", | ||
"elasticloadbalancing:DescribeTargetGroups", | ||
"elasticloadbalancing:DescribeTargetHealth", | ||
"iam:GetServerCertificate", | ||
"iam:ListServerCertificates", | ||
"kms:DescribeKey", | ||
"kms:GenerateRandom" | ||
], | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
}, | ||
{ | ||
"Action": [ | ||
"autoscaling:SetDesiredCapacity", | ||
"autoscaling:TerminateInstanceInAutoScalingGroup", | ||
"ec2:AttachVolume", | ||
"ec2:AuthorizeSecurityGroupIngress", | ||
"ec2:DeleteRoute", | ||
"ec2:DeleteSecurityGroup", | ||
"ec2:DeleteVolume", | ||
"ec2:DetachVolume", | ||
"ec2:ModifyInstanceAttribute", | ||
"ec2:ModifyVolume", | ||
"ec2:RevokeSecurityGroupIngress", | ||
"elasticloadbalancing:AddTags", | ||
"elasticloadbalancing:ApplySecurityGroupsToLoadBalancer", | ||
"elasticloadbalancing:AttachLoadBalancerToSubnets", | ||
"elasticloadbalancing:ConfigureHealthCheck", | ||
"elasticloadbalancing:DeleteListener", | ||
"elasticloadbalancing:DeleteLoadBalancer", | ||
"elasticloadbalancing:DeleteLoadBalancerListeners", | ||
"elasticloadbalancing:DeleteTargetGroup", | ||
"elasticloadbalancing:DeregisterInstancesFromLoadBalancer", | ||
"elasticloadbalancing:DeregisterTargets", | ||
"elasticloadbalancing:DetachLoadBalancerFromSubnets", | ||
"elasticloadbalancing:ModifyListener", | ||
"elasticloadbalancing:ModifyLoadBalancerAttributes", | ||
"elasticloadbalancing:ModifyTargetGroup", | ||
"elasticloadbalancing:RegisterInstancesWithLoadBalancer", | ||
"elasticloadbalancing:RegisterTargets", | ||
"elasticloadbalancing:SetLoadBalancerPoliciesForBackendServer", | ||
"elasticloadbalancing:SetLoadBalancerPoliciesOfListener" | ||
], | ||
"Condition": { | ||
"StringEquals": { | ||
"aws:ResourceTag/KubernetesCluster": "123.example.com" | ||
} | ||
}, | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
}, | ||
{ | ||
"Action": [ | ||
"ec2:CreateSecurityGroup", | ||
"ec2:CreateVolume", | ||
"elasticloadbalancing:CreateListener", | ||
"elasticloadbalancing:CreateLoadBalancer", | ||
"elasticloadbalancing:CreateLoadBalancerListeners", | ||
"elasticloadbalancing:CreateLoadBalancerPolicy", | ||
"elasticloadbalancing:CreateTargetGroup" | ||
], | ||
"Condition": { | ||
"StringEquals": { | ||
"aws:RequestTag/KubernetesCluster": "123.example.com" | ||
} | ||
}, | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} |
23 changes: 23 additions & 0 deletions
23
.../digit/data/aws_iam_role_policy_myotherserviceaccount.myapp.sa.minimal.example.com_policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"dynamodb:*" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"*" | ||
] | ||
}, | ||
{ | ||
"Action": [ | ||
"es:*" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
"*" | ||
] | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} |
Oops, something went wrong.