Skip to content

Commit

Permalink
Add patch of #526 to other important roles too
Browse files Browse the repository at this point in the history
  • Loading branch information
sbkok committed Jul 24, 2023
1 parent 95a0731 commit b6330a1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,13 @@ Resources:
Statement:
- Effect: Allow
Sid: "AssumeRole"
Condition:
ArnEquals:
"aws:PrincipalArn":
- !GetAtt PipelineManagementApplication.Outputs.CreateRepositoryLambdaRoleArn
- !GetAtt PipelineManagementApplication.Outputs.CreateOrUpdateRuleLambdaRoleArn
Principal:
AWS:
- !GetAtt PipelineManagementApplication.Outputs.CreateRepositoryLambdaRoleArn
- !GetAtt PipelineManagementApplication.Outputs.CreateOrUpdateRuleLambdaRoleArn
AWS: !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:root

Check failure

Code scanning / cfn-lint (MegaLinter CLOUDFORMATION_CFN_LINT)

Sub validation of parameters Error

Parameter DeploymentAccountId for Fn::Sub not found at Resources/AdfAutomationRole/Properties/AssumeRolePolicyDocument/Statement/0/Principal/AWS/Fn::Sub
Action:
- sts:AssumeRole
Path: /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ Resources:
# Statement:
# - Effect: Allow
# Sid: "AssumeRole"
# Condition:
# ArnEquals:
# 'aws:PrincipalArn':
# # This would allow all CodeBuild projects to be able to assume this role
# - !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:role/adf-codebuild-role
# Principal:
# AWS:
# - !Sub arn:aws:iam::${DeploymentAccountId}:role/adf-codebuild-role
# AWS: !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:root
# Action:
# - sts:AssumeRole
# Path: /
Expand Down Expand Up @@ -106,10 +110,11 @@ Resources:
# Condition:
# ArnEquals:
# 'aws:PrincipalArn':
# # This would allow all codebuild projects to be able to assume this role
# # - !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:role/adf-codebuild-role
# # This would allow all CodeBuild projects to be able to assume this role
# # - !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:role/adf-codebuild-role
# - !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:role/my-custom-codebuild-role
# # The above role would be created on the deployment account for the purpose deploying this custom resource via codebuild
# # The above role would be created on the deployment account
# # for the purpose deploying this custom resource via CodeBuild
# Principal:
# AWS: !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:root
# Action:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,12 @@ Resources:
Statement:
- Effect: Allow
Principal:
AWS:
- !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:role/adf-codepipeline-role
- !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:role/adf-cloudformation-role
AWS: !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:root
Condition:
ArnEquals:
"aws:PrincipalArn":
- !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:role/adf-codepipeline-role
- !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:role/adf-cloudformation-role
Action:
- sts:AssumeRole
Path: /
Expand Down Expand Up @@ -224,9 +227,11 @@ Resources:
Statement:
- Effect: Allow
Sid: "AssumeRoleByEnableCrossAccountLambda"
Condition:
ArnEquals:
"aws:PrincipalArn": !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:role/adf-enable-cross-account-access-lambda-role
Principal:
AWS:
- !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:role/adf-enable-cross-account-access-lambda-role
AWS: !Sub arn:${AWS::Partition}:iam::${DeploymentAccountId}:root
Action:
- sts:AssumeRole
Path: /
Expand Down

0 comments on commit b6330a1

Please sign in to comment.