File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
packages/aws-cdk/lib/api/cxapp Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -193,15 +193,17 @@ export class AppStacks {
193
193
}
194
194
const resourcePresent = stack . environment . region === 'default-region'
195
195
|| regionInfo . Fact . find ( stack . environment . region , regionInfo . FactName . cdkMetadataResourceAvailable ) === 'YES' ;
196
- if ( ! stack . template . Resources . CDKMetadata && resourcePresent ) {
197
- stack . template . Resources . CDKMetadata = {
198
- Type : 'AWS::CDK::Metadata' ,
199
- Properties : {
200
- Modules : modules
201
- }
202
- } ;
203
- } else {
204
- warning ( `The stack ${ stack . name } already includes a CDKMetadata resource` ) ;
196
+ if ( resourcePresent ) {
197
+ if ( ! stack . template . Resources . CDKMetadata ) {
198
+ stack . template . Resources . CDKMetadata = {
199
+ Type : 'AWS::CDK::Metadata' ,
200
+ Properties : {
201
+ Modules : modules
202
+ }
203
+ } ;
204
+ } else {
205
+ warning ( `The stack ${ stack . name } already includes a CDKMetadata resource` ) ;
206
+ }
205
207
}
206
208
}
207
209
}
You can’t perform that action at this time.
0 commit comments