question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

aws-fis: CfnExperimentTemplate does not generate a valid AWS::FIS::ExperimentTemplate

See original GitHub issue

CFN Yaml synthesized from CfnExperimentTemplatedoes 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:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mrmiloszcommented, Apr 29, 2021

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! 😄

0reactions
github-actions[bot]commented, May 4, 2021

⚠️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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS::FIS::ExperimentTemplate - AWS CloudFormation
Specifies an experiment template. An experiment template includes the following components: Targets: A target can be a specific resource in your AWS environment ......
Read more >
CreateExperimentTemplate - AWS Fault Injection Simulator
Creates an experiment template. ... The specified input is not valid, or fails to satisfy the constraints for the request. HTTP Status Code:...
Read more >
Example AWS FIS experiment templates - AWS Documentation
View example experiment templates for AWS Fault Injection Simulator. ... the AWS FIS API or a command line tool to create an experiment...
Read more >
Experiment templates for AWS FIS - AWS Fault Injection ...
An experiment template contains one or more actions to run on specified targets during an experiment. It also contains the stop conditions that...
Read more >
Work with AWS FIS experiment templates
You can create and manage experiment templates using the AWS FIS console or the command line. After you create an experiment template, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found