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

SQS 'Enabled' should be of type 'Boolean' #7532

Merged
merged 1 commit into from Apr 21, 2020

Conversation

michael-wolfenden
Copy link
Contributor

What did you implement

The Enabled property on the SQS resource was typed as a string but should be a boolean

Closes #7438

How can we verify it

Input serverless.yml

service: issue-7438

provider:
  name: aws
  runtime: nodejs12.x

functions:
  hello:
    handler: handler.hello
    events:
      - sqs:
          enabled: true
          arn:
            Fn::GetAtt:
              - notifyAppSyncAboutActivitySQSQueue
              - Arn

Run > sls package

Output cloudformation-template-update-stack.json

"HelloEventSourceMappingSQSNotifyAppSyncAboutActivitySQSQueue": {
  "Type": "AWS::Lambda::EventSourceMapping",
  "DependsOn": "IamRoleLambdaExecution",
  "Properties": {
    "BatchSize": 10,
    "EventSourceArn": {
      "Fn::GetAtt": [
        "notifyAppSyncAboutActivitySQSQueue",
        "Arn"
      ]
    },
    "FunctionName": {
      "Fn::GetAtt": [
        "HelloLambdaFunction",
        "Arn"
      ]
    },
    "Enabled": true
  }
}

Enabled is now being set to a boolean

Before the change cloudformation-template-update-stack.json

"HelloEventSourceMappingSQSNotifyAppSyncAboutActivitySQSQueue": {
  "Type": "AWS::Lambda::EventSourceMapping",
  "DependsOn": "IamRoleLambdaExecution",
  "Properties": {
    "BatchSize": 10,
    "EventSourceArn": {
      "Fn::GetAtt": [
        "notifyAppSyncAboutActivitySQSQueue",
        "Arn"
      ]
    },
    "FunctionName": {
      "Fn::GetAtt": [
        "HelloLambdaFunction",
        "Arn"
      ]
    },
    "Enabled": "True"
  }
}

Enabled was being set to a string

Todos

Useful Scripts
  • npm run test:ci --> Run all validation checks on proposed changes
  • npm run lint:updated --> Lint all the updated files
  • npm run lint:fix --> Automatically fix lint problems (if possible)
  • npm run prettier-check:updated --> Check if updated files adhere to Prettier config
  • npm run prettify:updated --> Prettify all the updated files
  • Write and run all tests
  • Write documentation
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: POTENTIALLY

I'm unsure how CloudFormation would have handled this property being set to a string.

For example did CloudFormation treat "Enabled": 'True' as true or false

@codecov-io
Copy link

Codecov Report

Merging #7532 into master will not change coverage by %.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7532   +/-   ##
=======================================
  Coverage   87.99%   87.99%           
=======================================
  Files         241      241           
  Lines        9120     9120           
=======================================
  Hits         8025     8025           
  Misses       1095     1095           
Impacted Files Coverage Δ
...ib/plugins/aws/package/compile/events/sqs/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76ade5e...d0ccb9f. Read the comment docs.

Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @michael-wolfenden !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants