-
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
Graduate @aws-cdk/custom-resources to stable #5873
Comments
@richardhboyd see my response: #5874 (comment) |
@eladb @rix0rrr @iliapolo regarding the 15 minutes / 14 minutes and retry question raised today: CloudFormation invokes the Lambda asynchronously. This means that we can now use Lambda destinations: you can get rid of the We will have the user function directly called by CloudFormation and a "framework" Lambda function set as destination for both aws-cdk/packages/@aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts Lines 34 to 36 in 8d5ee04
In a way the framework could be simplified to providing only a destination function? I think that it's even possible for the case with What do you think? |
@jogold This is nice, looks like we should be leveraging some of these capabilities. Though I don't think we should start this endeavor just now. If this doesn't result in a change to the API, then it definitely doesn't qualify as a graduation blocker. And if it does, it sounds a bit risky to do now and i think is more suitable for the upcoming |
Summary of the API reviewFollowing the API review we conducted, here are the points we discussed. AwsCustomResources uses default STAR (*) permissionsThis grants the lambda that invokes the user-defined SDK calls permissions to all resources for a given This is considered bad practice. For example, if a user defined the Action ItemIdeally we would require specific resource ARNs, but the nature of the resource makes it impossible because there is no ARN when invoking the We decided that we should at least make the users aware of this fact and make this behavior opt in. So basically we would require the user to pass Clarify Async OperationsThe Provider Framework section states that it: - Supports asynchronous handlers to enable long operations which can exceed the AWS Lambda timeout This is a bit confusing because it doesn't actually allow for long synchronous computations/executions. That is, a lambda function doing Action ItemClarify that the intent here is to allow for long waiting periods, as opposed to long executions. AwsSdkCall Physical Resource IDWe currently have two different properties for defining the resource id:
One of these must be configured for both the Action ItemCreate a union type for these two properties, something like: export class PhysicalResourceID {
public static fromResponseData(path: string): PhysicalResourceID {}
public static fromString(id: string): PhysicalResourceID {}
} There is quirk here because even with this union type, we can't make it a required property because the AwsCustomResource: getData() & getDataString()The names are a bit confusing, as well as the docstring: Returns response data for the AWS SDK call Which call? This actually doesn't relate to any call but simply returns attributes of the custom resource that was created/updated by sdk calls. Action ItemThink of a better name. Maybe just AwsSdkCall.catchErrorPatternWe talked about the name not being clear enough. It also surfaced the issue of using When using Action Item
User defined state machines@jogold mentioned that we could add the ability to specify custom state machines to allow for long running executions. Action Item@jogold Can you please open a ticket for this with some more details and context? 14 minute timeoutOur README states: It is recommended not to exceed a 14 minutes timeout We talked about maybe reducing this to 5-7 minutes because of retries that might happen our of our control. Action ItemDig a little into the invocation behavior and see if this number actually makes sense or not. Package RestructuringWe talked about the fact that the In addition, the name Action ItemWe initially talked about simply extracting However, @eladb and I were talking that this is probably too intrusive for now and wouldn't really provide our customers with much value. So the action item becomes:
Also, we would like to restructure the So another action item:
|
@iliapolo I will try to work on the items for
I think that we agreed on
I think we can do this now, it's easy.
There are no retries, this function (the user function) is invoked synchronously. |
I think that it should be possible to do this as a refactor without bringing breaking changes. |
@jogold wrote:
Excellent, even better since it means we can do this after graduation. We want to make as little changes as possible for this graduation push. @eladb thoughts? (Relates to #5873 (comment)) |
Yes, I like the idea, but definitely not something I would do right now. Let's open an issue with this info. |
Summarizing action items for graduation:
@jogold thanks for stepping forward and offering to do some of these! But i think i'll have it all covered soon enough. So don't worry about it, you can focus on the bigger features if you want :) |
…call policies In an attempt to be more explicit about our usage of `*` permissions, we are inverting the flow. Instead of defaulting to auto-generated policy statements that use `*` permissions, we now force users to pass the `policy` property. To make life easier, we provide factory methods that help configure this. Note that the `*` is now explicitly set by the user, not by the library. Relates to #5873 BREAKING CHANGE: `policyStatements` property was removed in favor of a required `policy` property. Refer to [Execution Policy](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/custom-resources#execution-policy-1) for more details. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* <!-- Please read the contribution guidelines and follow the pull-request checklist: https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md -->
…esMatching` (#6553) In the spirit of being "Explicit and Clear*, renaming `catchErrorPattern` to `ignoreErrorCodesMatching` since it better describes the meaning of this property. In addition, the following validations were added: - `ignoreErrorCodesMatching` cannot be used with `PhysicalResourceId.fromResponse` since the response might not exist. - `ignoreErrorCodesMatching` cannot be used with `getData` or `getDataString` since the resource might not have any attributes due to the error catching. Relates to #5873 BREAKING CHANGE: `catchErrorPattern` was renamed to `ignoreErrorCodesMatching`. In addition, a few synth time validations were added when using this property. See [Error Handling](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/custom-resources#error-handling-1) for details.
Renaming for some more clarity. Relates to #5873 BREAKING CHANGE: `getDataString` was renamed to `getResponseField` and `getData` was renamed to `getResponseFieldReference`
…call policies In an attempt to be more explicit about our usage of `*` permissions, we are inverting the flow. Instead of defaulting to auto-generated policy statements that use `*` permissions, we now force users to pass the `policy` property. To make life easier, we provide factory methods that help configure this. Note that the `*` is now explicitly set by the user, not by the library. Relates to #5873 BREAKING CHANGE: `policyStatements` property was removed in favor of a required `policy` property. Refer to [Execution Policy](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/custom-resources#execution-policy-1) for more details. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* <!-- Please read the contribution guidelines and follow the pull-request checklist: https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md -->
…esMatching` (#6553) In the spirit of being "Explicit and Clear*, renaming `catchErrorPattern` to `ignoreErrorCodesMatching` since it better describes the meaning of this property. In addition, the following validations were added: - `ignoreErrorCodesMatching` cannot be used with `PhysicalResourceId.fromResponse` since the response might not exist. - `ignoreErrorCodesMatching` cannot be used with `getData` or `getDataString` since the resource might not have any attributes due to the error catching. Relates to #5873 BREAKING CHANGE: `catchErrorPattern` was renamed to `ignoreErrorCodesMatching`. In addition, a few synth time validations were added when using this property. See [Error Handling](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/custom-resources#error-handling-1) for details.
Renaming for some more clarity. Relates to #5873 BREAKING CHANGE: `getDataString` was renamed to `getResponseField` and `getData` was renamed to `getResponseFieldReference`
…esMatching` (aws#6553) In the spirit of being "Explicit and Clear*, renaming `catchErrorPattern` to `ignoreErrorCodesMatching` since it better describes the meaning of this property. In addition, the following validations were added: - `ignoreErrorCodesMatching` cannot be used with `PhysicalResourceId.fromResponse` since the response might not exist. - `ignoreErrorCodesMatching` cannot be used with `getData` or `getDataString` since the resource might not have any attributes due to the error catching. Relates to aws#5873 BREAKING CHANGE: `catchErrorPattern` was renamed to `ignoreErrorCodesMatching`. In addition, a few synth time validations were added when using this property. See [Error Handling](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/custom-resources#error-handling-1) for details.
No description provided.
The text was updated successfully, but these errors were encountered: