-
Notifications
You must be signed in to change notification settings - Fork 4k
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(custom-resources): provider framework #4572
Conversation
`AsyncCustomResource` is a framework for defining robust custom resources. It makes it easy to implement providers for resources that require waiting for the resource to be ready, potentially for time period longer than the AWS Lambda timeout (15min at the moment). When a resource is created, the "begin" operation is invoked, and a state machine is triggered to wait for "complete" to indicate that it's done. It can also indicate that it's still waiting, in which case, Step Functions retry logic will kick in and "complete" will be called thereafter. If retries are exhausted, the resource operation will fail with a timeout. Any exceptions thrown from "begin" or "complete" will be reported as an operation failure to ensure that the custom resource does not hang the stack operation.
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
* use RequestId as the name of the state machine execution due to limitations in the name * make handler names required to make sure users are aware that they have to implement them * implement another custom resource in the integration test which "waits" for the object to contain certain contents (tests async resources).
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/util.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/util.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/cfn-response.ts
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/outbound.ts
Show resolved
Hide resolved
packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts
Outdated
Show resolved
Hide resolved
Are we marking this |
The whole module is experimental |
- remove validation of CFN event (not required) - redesign `failOnError` as `safeHandler` which returns a "safe" cloudformation handler. - fail if user handler returns a non-JSON response.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
later on we can figure out something smarter if need be
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
The
@aws-cdk/custom-resources.Provider
construct is a "mini-framework" forimplementing providers for AWS CloudFormation custom resources. The framework offers a high-level API which makes it easier to implement robust
and powerful custom resources and includes the following capabilities:
deployments
See README file for details.
Fixes #4711
Related #4147
onEvent
andisComplete
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license