@@ -71,7 +71,7 @@ Resources:
7171 Type : AWS::CodeBuild::Project
7272 Properties :
7373 Name : !Sub ${ServiceName}-dev
74- ServiceRole : !GetAtt CodebuildDevRole .Arn
74+ ServiceRole : !GetAtt CodebuildRole .Arn
7575 Artifacts :
7676 Type : no_artifacts
7777 Environment :
@@ -94,7 +94,7 @@ Resources:
9494 Type : AWS::CodeBuild::Project
9595 Properties :
9696 Name : !Sub ${ServiceName}-stg
97- ServiceRole : !GetAtt CodebuildStgRole .Arn
97+ ServiceRole : !GetAtt CodebuildRole .Arn
9898 Artifacts :
9999 Type : no_artifacts
100100 Environment :
@@ -134,7 +134,7 @@ Resources:
134134 - s3:GetObject
135135 - s3:List*
136136 - s3:DeleteObject
137- Resource : !Sub arn:aws:s3:::${ServiceName}-output/*
137+ Resource : " * "
138138 - Effect : Allow
139139 Action :
140140 - iam:GetRole
@@ -176,6 +176,7 @@ Resources:
176176 - cloudformation:DescribeStacks
177177 - cloudformation:ExecuteChangeSet
178178 - cloudformation:DescribeChangeSet
179+ - cloudformation:DeleteStack
179180 Resource : !Sub arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${ServiceName}-*
180181 - Effect : Allow
181182 Action :
@@ -186,22 +187,8 @@ Resources:
186187 - logs:DeleteLogGroup
187188 Resource : " *"
188189 Roles :
189- - !Ref CodebuildDevRole
190- - !Ref CodebuildStgRole
191- CodebuildStgPolicy :
192- Type : AWS::IAM::Policy
193- Properties :
194- PolicyName : !Sub ${ServiceName}-codebuild-stg-service-policy
195- PolicyDocument :
196- Version : 2012-10-17
197- Statement :
198- - Effect : Allow
199- Action :
200- - cloudformation:DeleteStack
201- Resource : !Sub arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${ServiceName}-*
202- Roles :
203- - !Ref CodebuildStgRole
204- CodebuildDevRole :
190+ - !Ref CodebuildRole
191+ CodebuildRole :
205192 Type : AWS::IAM::Role
206193 Properties :
207194 RoleName : !Sub ${ServiceName}-codebuild-dev-service-role
@@ -214,19 +201,6 @@ Resources:
214201 - codebuild.amazonaws.com
215202 Action :
216203 - sts:AssumeRole
217- CodebuildStgRole :
218- Type : AWS::IAM::Role
219- Properties :
220- RoleName : !Sub ${ServiceName}-codebuild-stg-service-role
221- AssumeRolePolicyDocument :
222- Version : 2012-10-17
223- Statement :
224- - Effect : Allow
225- Principal :
226- Service :
227- - codebuild.amazonaws.com
228- Action :
229- - sts:AssumeRole
230204 CodebuildDevLogGroup :
231205 Type : AWS::Logs::LogGroup
232206 Properties :
0 commit comments