aws-fis: CfnExperimentTemplate does not generate a valid AWS::FIS::ExperimentTemplate
See original GitHub issueCFN Yaml synthesized from CfnExperimentTemplate
does not create a correct CFN AWS::FIS::ExperimentTemplate
.
All keys in the synth are lower case, however in CFN they are expected as uppercase. This ends in errors during deploy like
Properties validation failed for resource fistemplate with message:
#: required key [Description] not found
#: required key [StopConditions] not found
#: required key [Targets] not found
#: required key [RoleArn] not found
#: required key [Tags] not found
#: extraneous key [stopConditions] is not permitted
#: extraneous key [description] is not permitted
#: extraneous key [targets] is not permitted
#: extraneous key [actions] is not permitted
#: extraneous key [roleArn] is not permitted
#: extraneous key [tags] is not permitted
Environment
-
CDK CLI Version: ❯ cdk --version 1.100.0 (build d996c6d)
-
Module Version: 1.100.0
-
Node.js Version: ❯ node -v v14.15.4
-
OS: OSX Big Sur
-
Language: TypeScript
Other information
I’m using the following CDK snippet:
new fis.CfnExperimentTemplate(this,'fis-template', {
description: 'My first Template',
roleArn: role.roleArn,
stopConditions: [
{ source: 'none' }
],
tags: {},
actions: {
'TerminateInstances' : // omitted for brevity
},
targets: {
'myInstance' : // omitted for brevity
}
})
deploying this fails with the above error message. Looking at the synth output:
fistemplate:
Type: AWS::FIS::ExperimentTemplate
Properties:
description: My first Template
roleArn:
Fn::GetAtt:
- fisrole33E76559
- Arn
stopConditions:
- source: none
tags: {}
targets:
myInstance:
resourceTags: {}
resourceType: aws:ec2:instance
selectionMode: COUNT(1)
actions:
TerminateInstances:
actionId: aws:ec2:stop-instances
parameters: {}
targets: {}
you can see that the property-keys like description
, roleArn
, … are all starting with a lower letter. This is not what CFN expects according to https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-fis-experimenttemplate.html.
If I manually change the synth output to uppercase (and fix some other issues, which I created #14309 for) and then deploy via aws cloudformation create-stack ...
I can work around this issue.
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Hi @skinny85,
I see! I appreciate the thorough reply. I did not realize the code was being generated from a spec like that. Indeed I noticed that the fis.generated.js file incorrectly contained lowercase keys, but did not know what the source of that generated code was. Thanks for clearing that up!
I guess at this point my options are to either figure out how to temporarily generate my own code from the spec, or to apply the workarounds mentioned above (property overrides) and wait for an update to the specification to get merged in.
Sorry for derailing the discussion! 😄
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.