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

Changed AWS subscription filters to use function object name #6402

Merged
merged 1 commit into from
Jul 19, 2019
Merged

Changed AWS subscription filters to use function object name #6402

merged 1 commit into from
Jul 19, 2019

Conversation

sameer-s
Copy link
Contributor

@sameer-s sameer-s commented Jul 18, 2019

What did you implement:

Closes #5700

How did you implement it:

Just changed the expecting log subscription ARN from being calculated using functionName (which is always the name of the function object in serverless.yml, to instead use functionObj.name, which will use the name field if provided, and the default name if not (as it is set in the setFunctioNames method in Service.js).

How can we verify it:

serverless deploy a function with CloudWatch Logs triggers and with the name field set (an example is given in the original issue and re-listed below).

functions:
  app:
    name: cloudwatch2loggly
    handler: src/index.handler
    events:
      - cloudwatchLog: '/aws/lambda/${self:provider.stage}-function1'
      - cloudwatchLog: '/aws/lambda/${self:provider.stage}-function2'
      - cloudwatchLog: '/aws/lambda/${self:provider.stage}-function3'

Opening CloudWatch will show subscriptions for each of the log groups. Re-deploying (using serverless deploy --force) will cause all of the subscriptions to disappear in the upstream repo, but will not with these changes.

Todos:

Note: Run npm run test-ci to run all validation checks on proposed changes

  • Write tests and confirm existing functionality is not broken.
    Validate via npm test
  • Write documentation I don't think this is really applicable for such a minor bugfix
  • Ensure there are no lint errors.
    Validate via npm run lint-updated
    Note: Some reported issues can be automatically fixed by running npm run lint:fix
  • Ensure introduced changes match Prettier formatting.
    Validate via npm run prettier-check-updated
    Note: All reported issues can be automatically fixed by running npm run prettify-updated
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

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

@pmuens pmuens self-assigned this Jul 19, 2019
@pmuens pmuens added this to the 1.49.0 milestone Jul 19, 2019
Copy link
Contributor

@pmuens pmuens left a comment

Choose a reason for hiding this comment

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

Just tested it and it works. Thanks for fixing this @sameer-s 👍

LGTM :shipit:

@pmuens pmuens merged commit d0793ee into serverless:master Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CloudWatch Log Event Subscriptions Deleted
2 participants