@@ -138,15 +138,32 @@ jobs:
138138 cf_create_changeset_role : ${{ secrets.cf_create_changeset_role }}
139139 cf_deploy_role : ${{ secrets.cf_deploy_role }}
140140
141- cdk_diff_monitoring :
141+ cdk_diff_iam :
142142 uses : ./.github/workflows/cdk_diff_code.yml
143143 permissions :
144144 id-token : write
145145 contents : write
146146 with :
147- CDK_RESOURCE_STACK_NAME : Monitoring
148- DEPLOYED_STACK_NAME : monitoring
149- TARGET_ENVIRONMENT : ${{inputs.target_environment}}-account
147+ CDK_RESOURCE_STACK_NAME : IAM
148+ DEPLOYED_STACK_NAME : iam-cdk
149+ TARGET_ENVIRONMENT : ${{inputs.target_environment}}
150+ VERSION : ${{ inputs.version }}
151+ COMMIT_ID : ${{ inputs.commit_id }}
152+ CDK_APP_NAME : AccountResources
153+ IS_PULL_REQUEST : ${{ inputs.is_pull_request }}
154+ pinned_image : ${{ inputs.pinned_image }}
155+ secrets :
156+ CLOUD_FORMATION_DIFF_ROLE : ${{ secrets.cf_create_changeset_role }} # use create changeset role as we are just doing a diff
157+
158+ cdk_diff_secrets :
159+ uses : ./.github/workflows/cdk_diff_code.yml
160+ permissions :
161+ id-token : write
162+ contents : write
163+ with :
164+ CDK_RESOURCE_STACK_NAME : Secrets
165+ DEPLOYED_STACK_NAME : secrets-cdk
166+ TARGET_ENVIRONMENT : ${{inputs.target_environment}}
150167 VERSION : ${{ inputs.version }}
151168 COMMIT_ID : ${{ inputs.commit_id }}
152169 CDK_APP_NAME : AccountResources
@@ -163,7 +180,7 @@ jobs:
163180 with :
164181 CDK_RESOURCE_STACK_NAME : AccountResources_US
165182 DEPLOYED_STACK_NAME : account-resources-cdk-us
166- TARGET_ENVIRONMENT : ${{inputs.target_environment}}-account
183+ TARGET_ENVIRONMENT : ${{inputs.target_environment}}
167184 VERSION : ${{ inputs.version }}
168185 COMMIT_ID : ${{ inputs.commit_id }}
169186 CDK_APP_NAME : AccountResources
@@ -182,7 +199,7 @@ jobs:
182199 with :
183200 CDK_RESOURCE_STACK_NAME : AccountResources_UK
184201 DEPLOYED_STACK_NAME : account-resources-cdk-uk
185- TARGET_ENVIRONMENT : ${{inputs.target_environment}}-account
202+ TARGET_ENVIRONMENT : ${{inputs.target_environment}}
186203 VERSION : ${{ inputs.version }}
187204 COMMIT_ID : ${{ inputs.commit_id }}
188205 CDK_APP_NAME : AccountResources
@@ -192,21 +209,39 @@ jobs:
192209 secrets :
193210 CLOUD_FORMATION_DIFF_ROLE : ${{ secrets.cf_create_changeset_role }} # use create changeset role as we are just doing a diff
194211
195- cdk_deploy_monitoring :
212+ cdk_deploy_iam :
213+ uses : ./.github/workflows/cdk_release_code.yml
214+ if : ${{ inputs.execute_change_set == true }}
215+ needs : [cdk_diff_iam, cdk_diff_secrets, cdk_diff_account_resources_US, cdk_diff_account_resources_UK]
216+ permissions :
217+ id-token : write
218+ contents : write
219+ with :
220+ CDK_RESOURCE_STACK_NAME : IAM
221+ DEPLOYED_STACK_NAME : iam-cdk
222+ TARGET_ENVIRONMENT : ${{inputs.target_environment}}
223+ VERSION : ${{ inputs.version }}
224+ COMMIT_ID : ${{ inputs.commit_id }}
225+ CDK_APP_NAME : AccountResources
226+ AWS_REGION : eu-west-2
227+ pinned_image : ${{ inputs.pinned_image }}
228+ secrets :
229+ CLOUD_FORMATION_DEPLOY_ROLE : ${{ secrets.cf_deploy_role }}
230+
231+ cdk_deploy_secrets :
196232 uses : ./.github/workflows/cdk_release_code.yml
197233 if : ${{ inputs.execute_change_set == true }}
198- needs : cdk_diff_monitoring
234+ needs : cdk_deploy_iam
199235 permissions :
200236 id-token : write
201237 contents : write
202238 with :
203- CDK_RESOURCE_STACK_NAME : Monitoring
204- DEPLOYED_STACK_NAME : monitoring
205- TARGET_ENVIRONMENT : ${{inputs.target_environment}}-account
239+ CDK_RESOURCE_STACK_NAME : Secrets
240+ DEPLOYED_STACK_NAME : secrets-cdk
241+ TARGET_ENVIRONMENT : ${{inputs.target_environment}}
206242 VERSION : ${{ inputs.version }}
207243 COMMIT_ID : ${{ inputs.commit_id }}
208244 CDK_APP_NAME : AccountResources
209- DEPLOYMENT_ENVIRONMENT : ${{ inputs.target_environment }}-account
210245 AWS_REGION : eu-west-2
211246 pinned_image : ${{ inputs.pinned_image }}
212247 secrets :
@@ -215,18 +250,17 @@ jobs:
215250 cdk_deploy_account_resources_US :
216251 uses : ./.github/workflows/cdk_release_code.yml
217252 if : ${{ inputs.execute_change_set == true }}
218- needs : cdk_diff_account_resources_US
253+ needs : cdk_deploy_secrets
219254 permissions :
220255 id-token : write
221256 contents : write
222257 with :
223258 CDK_RESOURCE_STACK_NAME : AccountResources_US
224259 DEPLOYED_STACK_NAME : account-resources-cdk-us
225- TARGET_ENVIRONMENT : ${{inputs.target_environment}}-account
260+ TARGET_ENVIRONMENT : ${{inputs.target_environment}}
226261 VERSION : ${{ inputs.version }}
227262 COMMIT_ID : ${{ inputs.commit_id }}
228263 CDK_APP_NAME : AccountResources
229- DEPLOYMENT_ENVIRONMENT : ${{ inputs.target_environment }}-account
230264 AWS_REGION : us-east-1
231265 pinned_image : ${{ inputs.pinned_image }}
232266 secrets :
@@ -235,18 +269,17 @@ jobs:
235269 cdk_deploy_account_resources_UK :
236270 uses : ./.github/workflows/cdk_release_code.yml
237271 if : ${{ inputs.execute_change_set == true }}
238- needs : cdk_diff_account_resources_UK
272+ needs : cdk_deploy_secrets
239273 permissions :
240274 id-token : write
241275 contents : write
242276 with :
243277 CDK_RESOURCE_STACK_NAME : AccountResources_UK
244278 DEPLOYED_STACK_NAME : account-resources-cdk-uk
245- TARGET_ENVIRONMENT : ${{inputs.target_environment}}-account
279+ TARGET_ENVIRONMENT : ${{inputs.target_environment}}
246280 VERSION : ${{ inputs.version }}
247281 COMMIT_ID : ${{ inputs.commit_id }}
248282 CDK_APP_NAME : AccountResources
249- DEPLOYMENT_ENVIRONMENT : ${{ inputs.target_environment }}-account
250283 AWS_REGION : eu-west-2
251284 pinned_image : ${{ inputs.pinned_image }}
252285 secrets :
0 commit comments