Skip to content

Commit a71bb68

Browse files
committed
Simplify e2e roles
Signed-off-by: Katyanna Moura <[email protected]>
1 parent cc7336d commit a71bb68

File tree

1 file changed

+20
-63
lines changed

1 file changed

+20
-63
lines changed

cluster/cluster.yaml

Lines changed: 20 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -430,74 +430,31 @@ Resources:
430430
Type: "STANDARD"
431431
E2EEKSIAMTestCDP:
432432
Properties:
433-
AssumeRolePolicyDocument: !Sub
434-
- |
435-
{
436-
"Version": "2012-10-17",
437-
"Statement": [
438-
{
439-
"Effect": "Allow",
440-
"Principal": {
441-
"Federated": [
442-
"arn:aws:iam::${AWS::AccountId}:oidc-provider/${OIDC}"
443-
]
444-
},
445-
"Action": [
446-
"sts:AssumeRoleWithWebIdentity"
447-
],
448-
"Condition": {
449-
"StringEquals": {
450-
"${OIDC}:sub": "system:serviceaccount:default:cdp"
451-
}
452-
}
453-
}
454-
]
455-
}
456-
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
433+
AssumeRolePolicyDocument:
434+
Statement:
435+
- Action:
436+
- 'sts:AssumeRole'
437+
- 'sts:SetSourceIdentity'
438+
Effect: Allow
439+
Principal:
440+
AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root"
441+
Version: 2012-10-17
457442
Path: /
458-
Policies:
459-
- PolicyDocument:
460-
Statement:
461-
- Action: 'secretsmanager:GetSecretValue'
462-
Effect: Allow
463-
Resource: "arn:aws:secretsmanager:{{.Cluster.Region}}:{{.Cluster.InfrastructureAccountID}}:secret:*.*.*"
464-
RoleName: "{{.Cluster.LocalID}}-cdp"
443+
RoleName: "{{.Cluster.LocalID}}-e2e-cdp"
465444
Type: 'AWS::IAM::Role'
466445
E2EEKSIAMTestDeploymentService:
467446
Properties:
468-
AssumeRolePolicyDocument: !Sub
469-
- |
470-
{
471-
"Version": "2012-10-17",
472-
"Statement": [
473-
{
474-
"Effect": "Allow",
475-
"Principal": {
476-
"Federated": [
477-
"arn:aws:iam::${AWS::AccountId}:oidc-provider/${OIDC}"
478-
]
479-
},
480-
"Action": [
481-
"sts:AssumeRoleWithWebIdentity"
482-
],
483-
"Condition": {
484-
"StringEquals": {
485-
"${OIDC}:sub": "system:serviceaccount:kube-system:deployment-service-controller"
486-
}
487-
}
488-
}
489-
]
490-
}
491-
- OIDC: !Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]
447+
AssumeRolePolicyDocument:
448+
Statement:
449+
- Action:
450+
- 'sts:AssumeRole'
451+
- 'sts:SetSourceIdentity'
452+
Effect: Allow
453+
Principal:
454+
AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root"
455+
Version: 2012-10-17
492456
Path: /
493-
Policies:
494-
- PolicyDocument:
495-
Statement:
496-
- Action: 'secretsmanager:GetSecretValue'
497-
Effect: Allow
498-
Resource: "arn:aws:secretsmanager:{{.Cluster.Region}}:{{.Cluster.InfrastructureAccountID}}:secret:*.*.*"
499-
RoleName: "{{.Cluster.LocalID}}-deployment-service"
500-
Type: 'AWS::IAM::Role'
457+
RoleName: "{{.Cluster.LocalID}}-e2e-deployment-service"
501458
{{ end }}
502459
# TODO: IAM POLICY
503460
EKSCNIIPv6Policy:

0 commit comments

Comments
 (0)