@@ -216,47 +216,34 @@ export class RenderingCDKStack extends CDKStack {
216216 certificateProps : { domainName } ,
217217 healthcheck : { path : '/_healthcheck' } ,
218218 monitoringConfiguration,
219+ additionalPolicies : [
220+ new GuAllowPolicy ( this , 'AllowPolicyCloudwatchLogs' , {
221+ actions : [ 'cloudwatch:*' , 'logs:*' ] ,
222+ resources : [ '*' ] ,
223+ } ) ,
224+ new GuAllowPolicy ( this , 'AllowPolicyDescribeDecryptKms' , {
225+ actions : [ 'kms:Decrypt' , 'kms:DescribeKey' ] ,
226+ resources : [
227+ `arn:aws:kms:${ region } :${ account } :FrontendConfigKey` ,
228+ ] ,
229+ } ) ,
230+ new GuAllowPolicy ( this , 'AllowPolicyGetSsmParamsByPath' , {
231+ actions : [ 'ssm:GetParametersByPath' , 'ssm:GetParameter' ] ,
232+ resources : [
233+ // This is for backwards compatibility reasons with frontend apps and an old SSM naming system
234+ // TODO - ideally we should convert these params to use the newer naming style for consistency
235+ `arn:aws:ssm:${ region } :${ this . account } :parameter/frontend/*` ,
236+ `arn:aws:ssm:${ region } :${ this . account } :parameter/dotcom/*` ,
237+ ] ,
238+ } ) ,
239+ ] ,
219240 ec2Props : {
220241 instanceMetricGranularity : '1Minute' ,
221242 applicationLogging : {
222243 enabled : true ,
223244 systemdUnitName : guApp ,
224245 } ,
225246 instanceType,
226- roleConfiguration : {
227- additionalPolicies : [
228- new GuAllowPolicy ( this , 'AllowPolicyCloudwatchLogs' , {
229- actions : [ 'cloudwatch:*' , 'logs:*' ] ,
230- resources : [ '*' ] ,
231- } ) ,
232- new GuAllowPolicy (
233- this ,
234- 'AllowPolicyDescribeDecryptKms' ,
235- {
236- actions : [ 'kms:Decrypt' , 'kms:DescribeKey' ] ,
237- resources : [
238- `arn:aws:kms:${ region } :${ account } :FrontendConfigKey` ,
239- ] ,
240- } ,
241- ) ,
242- new GuAllowPolicy (
243- this ,
244- 'AllowPolicyGetSsmParamsByPath' ,
245- {
246- actions : [
247- 'ssm:GetParametersByPath' ,
248- 'ssm:GetParameter' ,
249- ] ,
250- resources : [
251- // This is for backwards compatibility reasons with frontend apps and an old SSM naming system
252- // TODO - ideally we should convert these params to use the newer naming style for consistency
253- `arn:aws:ssm:${ region } :${ this . account } :parameter/frontend/*` ,
254- `arn:aws:ssm:${ region } :${ this . account } :parameter/dotcom/*` ,
255- ] ,
256- } ,
257- ) ,
258- ] ,
259- } ,
260247 scaling,
261248 userData : getUserData ( {
262249 guApp,
0 commit comments