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

feat(lambda): allow Topic to be dlq for Lambda #18546

Merged
merged 19 commits into from Feb 17, 2022

Conversation

kornicameister
Copy link
Contributor

Adds possibility of using sns.Topic as a deadLetterQueue
for a lambda function as described in AWS::Lambda::Function
documentation.

closes: #16246


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Adds possibility of using sns.Topic as a deadLetterQueue
for a lambda function as described in `AWS::Lambda::Function`
documentation.

closes: aws#16246
@gitpod-io
Copy link

gitpod-io bot commented Jan 19, 2022

@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Jan 19, 2022
* origin/master:
  chore(ecr): migrate to Assertions (aws#18538)
  chore(codepipeline): migrate tests to assertions (aws#18545)
  chore(cfn-include): migrate all tests to Assertions (aws#18537)
  chore: move decdk to cdklabs (aws#18529)
  chore(cloudwatch-actions): migrate to Assertions (aws#18539)
  chore(globalaccelerator): migrate tests to `assertions` (aws#18532)
  chore(config): migrate tests to `assertions` (aws#18533)
  chore(docdb): migrate tests to use the Assertions module (aws#18518)
  chore: npm-check-updates && yarn upgrade (aws#18528)
@kornicameister
Copy link
Contributor Author

@kaizen3031593 I don't really follow what went wrong now. Any assistance?

@jumic
Copy link
Contributor

jumic commented Jan 21, 2022

@kornicameister This error message in the build log is relevant:

@aws-cdk/aws-lambda: /codebuild/output/src522368232/src/github.com/aws/aws-cdk/packages/@aws-cdk/aws-lambda/test/function.test.ts
@aws-cdk/aws-lambda:   710:15  error  Properties shouldn't be quoted as all quotes are redundant  quote-props
@aws-cdk/aws-lambda:   721:11  error  Properties shouldn't be quoted as all quotes are redundant  quote-props

You have to remove the single quotes from Ref.

Resource: {
  'Ref': 'DeadLetterQueue9F481546',
},

Correct syntax:

Resource: {
  Ref: 'DeadLetterQueue9F481546',
},

FYI: Just in case you don't know: You can also execute the build on your local machine to see the errors before committing the changes.

@kornicameister
Copy link
Contributor Author

I really need to do more TS coding...I didn't connect the dots. Will fix that as soon as I can

* origin/master: (31 commits)
  feat(iotevents): add DetectorModel L2 Construct (aws#18049)
  feat(ecs): add `BaseService.fromServiceArnWithCluster()` for use in CodePipeline (aws#18530)
  docs(s3): remove vestigial documentation (aws#18604)
  chore(cli): LogMonitor test fails randomly due to Date.now() (aws#18601)
  chore(codedeploy): migrate tests to use the Assertions module (aws#18585)
  docs(stepfunctions): fix typo (aws#18583)
  chore(eks-legacy): migrate tests to `assertions` (aws#18596)
  fix(cli): hotswap should wait for lambda's `updateFunctionCode` to complete (aws#18536)
  fix(apigatewayv2): websocket api: allow all methods in grant manage connections (aws#18544)
  chore(dynamodb): migrate tests to assertions (aws#18560)
  fix(aws-apigateway): cross region authorizer ref (aws#18444)
  feat(lambda-nodejs): Allow setting mainFields for esbuild (aws#18569)
  docs(cfnspec): update CloudFormation documentation (aws#18587)
  feat(assertions): support for conditions (aws#18577)
  fix(ecs-patterns): Fix Network Load Balancer Port assignments in ECS Patterns (aws#18157)
  chore(region-info): ap-southeast-3 (Jakarta) ELBV2_ACCOUNT (aws#18300)
  fix(pipelines): CodeBuild projects are hard to tell apart (aws#18492)
  fix(ecs): only works in 'aws' partition (aws#18496)
  chore(app-delivery): migrate unit tests to Assertions (aws#18574)
  chore: migrate kaizen3031593's modules to assertions (aws#18205)
  ...
@kaizencc kaizencc added effort/small Small work item – less than a day of effort p2 labels Jan 24, 2022
* origin/master: (74 commits)
  chore: remove reliance on `decdk` in build system (aws#18760)
  chore: add repository directory for all packages.json  (aws#17203)
  docs(ecs): correct comment documentation for NetworkMode (aws#17841)
  feat(ecs): expose image name in container definition (aws#17793)
  feat(ecr): add server-side encryption configuration  (aws#16966)
  chore(region-info): ap-southeast-3 (Jakarta) ROUTE_53_BUCKET_WEBSITE_ZONE_ID (aws#18110)
  chore: reassign njlynch's ownership areas (aws#18751)
  chore(ecs-service-extensions): migrate tests to assertions (aws#18649)
  chore(s3): Fixed documentation for `InventoryFormat.ORC` (aws#18717)
  feat(iot): add Action to republish MQTT messages to another MQTT topic (aws#18661)
  chore(rds): add support for PostgreSQL 14 (aws#18713)
  fix(core): correctly reference versionless secure parameters (aws#18730)
  fix(ec2): `UserData.addSignalOnExitCommand` does not work in combination with `userDataCausesReplacement` (aws#18726)
  fix(vpc): Vpc.fromLookup should throw if subnet group name tag is explicitly given and does not exist (aws#18714)
  docs(dynamodb): add note around table encryption (aws#18721)
  chore: override `markdown-it` version (aws#18723)
  docs(cfnspec): update CloudFormation documentation (aws#18741)
  chore(release): 1.142.0
  chore(lambda-layer-awscli): contains a CLI version with a CVE (aws#18727)
  chore(lambda-python): remove Pillow dependency (aws#18722)
  ...
Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

looks good! just a couple minor comments.

packages/@aws-cdk/aws-lambda/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-lambda/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-lambda/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-lambda/lib/function.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-lambda/lib/function.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-lambda/lib/function.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-lambda/lib/function.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-lambda/lib/function.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-lambda/test/function.test.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-lambda/test/function.test.ts Outdated Show resolved Hide resolved
Co-authored-by: Kaizen Conroy <36202692+kaizen3031593@users.noreply.github.com>
@mergify mergify bot dismissed kaizencc’s stale review February 6, 2022 21:52

Pull request has been modified.

* origin/master: (27 commits)
  chore(eks): deprecate older versions of EKS (aws#18842)
  fix(tooling): update vscode devcontainer image (aws#18455)
  chore: npm-check-updates && yarn upgrade (aws#18832)
  chore(docs): Fix broken md links (aws#18384)
  chore(lambda-layer-awscli): install awscli with pip and requirements.txt (aws#18800)
  fix(aws-appsync): Strip unsupported characters from Lambda DataSource (aws#18765)
  feat(cfnspec): cloudformation spec v55.0.0 (aws#18827)
  docs(cfnspec): update CloudFormation documentation (aws#18826)
  chore(cxapi): plugin context provider limited by cx schema (aws#18709)
  feat(iotevents): add grant method to Input class (aws#18617)
  chore(cx-api): break circular dependencies (aws#18767)
  docs(core): clarify that `addOverride` does not change property casing (aws#18687)
  feat(s3-deployment): deploy data with deploy-time values (aws#18659)
  docs(cfnspec): update CloudFormation documentation (aws#18808)
  feat(cli): `cdk diff` works for Nested Stacks (aws#18207)
  docs(cfnspec): update CloudFormation documentation (aws#18783)
  chore(lambda-layer-awscli): add update mechanism for AWS CLI (aws#18780)
  chore(release): 1.143.0
  feat(fsx): add support for FSx Lustre Persistent_2 deployment type (aws#18626)
  feat(amplify): support performance mode in Branch (aws#18598)
  ...
@kornicameister
Copy link
Contributor Author

Alright @kaizen3031593 I think all comments have been resolved and all changes have been made. Ready for another round.

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

Almost there, caught me at a good time so here's a quick turnaround :).

packages/@aws-cdk/aws-lambda/lib/function.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-lambda/lib/function.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-lambda/lib/function.ts Outdated Show resolved Hide resolved
kornicameister and others added 2 commits February 6, 2022 23:34
Co-authored-by: Kaizen Conroy <36202692+kaizen3031593@users.noreply.github.com>
Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, @kornicameister!

@mergify
Copy link
Contributor

mergify bot commented Feb 17, 2022

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: d9c0036
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit f8d8fe4 into aws:master Feb 17, 2022
@mergify
Copy link
Contributor

mergify bot commented Feb 17, 2022

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@kornicameister kornicameister deleted the feat_16246 branch February 18, 2022 12:08
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
Adds possibility of using sns.Topic as a deadLetterQueue
for a lambda function as described in `AWS::Lambda::Function`
documentation.

closes: aws#16246

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(lambda): Support SNS Topics as DLQs
4 participants