Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::SSM::Document cfn-lint bug with missing DocumentType "Session" #3510

Closed
vschurink opened this issue Jul 17, 2024 · 0 comments · Fixed by #3511
Closed

AWS::SSM::Document cfn-lint bug with missing DocumentType "Session" #3510

vschurink opened this issue Jul 17, 2024 · 0 comments · Fixed by #3511

Comments

@vschurink
Copy link

CloudFormation Lint Version

1.7.1

What operating system are you using?

Ubuntu

Describe the bug

when using an AWS::SSM::Document with type "Session" (which is missing in the Cloudformation documentation btw) the only valid choice of version is "1.0": https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-schema.html

schemaVersion
The schema version of the Session document. Session documents only support version 1.0.
Type: String
Required: Yes

however cfn-lint gives an error with the following feedback:

E3051 '1.0' is not one of ['0.3', '1.2', '2.0', '2.2']

which is NOT correct.
perhaps it's better to also check DocumentType and match more specific on versions allowed according to AWS documentation:

https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-schemas-features.html

Documents of type Command can use schema version 1.2, 2.0, and 2.2. If you use schema 1.2 documents, we recommend that you create documents that use schema version 2.2.
Documents of type Policy must use schema version 2.0 or later.
Documents of type Automation must use schema version 0.3.

this would fix the 'generic' error and allow for DocumentType specific errors with regards to schemaVersion.

Expected behavior

no errors when using DocumentType: Session and schemaVersion: "1.0"

Reproduction template

    Type: AWS::SSM::Document
    Properties:
      Name: SSM-SessionManagerRunShell
      DocumentFormat: YAML
      DocumentType: Session
      UpdateMethod: NewVersion
      Content:
        schemaVersion: '1.0'
        description: Regional settings for Session Manager sessions
        sessionType: Standard_Stream
        inputs:
          cloudWatchLogGroupName: 'randomloggroupname-xxxxx'
          cloudWatchEncryptionEnabled: true
          cloudWatchStreamingEnabled: true
          kmsKeyId: 'KMSIDarn'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant