-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
custom-resource: Support of ServiceTimeout from Cloudformation #30517
Comments
Definitely, this is a highly anticipated feature that many users have been waiting for. |
I just created this PR. I would appreciate to receive your thoughts and feedback: I still need to work on adding integration tests (probably a maintainer needs to create the snapshots) + also I don't know where in docs this can be added, but meanwhile would be great if someone looks at the approach and give feedback. Currently, we have the timeout field for the lambda function that creates the resource (here is the cfn docs), but this new field sets timeout on a higher level (stack, instead of the lambda fn that creates the resource). |
@pahud, what do you think about the idea of having a feature flag to control the default timeout for all the custom resources in a stack ? Also, I do want to suggest having a different default timeout for CDK of 15mins rather than setting to 1hour (excluding edge cases like EKS cluster provider). Main reason being for cases like lambda's failing to signal back due to network issues, users need not wait 1+1 hour (update as well as rollback) to have an updatable stack. |
It's a good question on how to customize the default timeout for custom resource and we've seen similar issue like this for all custom resource providers that does not have LoggingConfig specified and should have a custom retention period. I am not sure if feature flag is a good solution as most of our feature flags are boolean typed that toggle some features on or off. I guess what users need is a global config like this that applies to existing resources if relevant config is undefined.
But users would still need further customization like:
Maybe something like the Tags class that comes with an Aspect iterating the construct tree would be a nice solution? WDYT? Just added a feat request #30800 |
So, neither Wasting a lot of time waiting for stack deployment and rollback / cleanup to time out. I assumed that CDK is somehow generated from CloudFormation and would at least contain everything as level-1 constructs? I am using CDK v2 and Java. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-customresource.html#aws-resource-cloudformation-customresource-properties |
We have a PR in progress now |
nice! will it be available then also for cdk for java? |
a workaround I found useful was to run cdk synth, then add the service timeout in cloud formation template and use Aws cli for cloud formation to deploy the template. |
Currently it is possible simply to add "ServiceTimeout" to Properties: new CustomResource(parentConstruct, "id", new CustomResourceProps
{
ServiceToken = lambda.FunctionArn,
Properties = new Dictionary<string, object>
{
["ServiceTimeout"] = "900",
},
//...
}); |
Describe the feature
Hi, everyone.
Cloudformation just release ServiceTimeout attribute support in Custom Resources, so now we do not need to wait 1h to notice faulty deployment.
Announcement: https://aws.amazon.com/about-aws/whats-new/2024/06/aws-cloudformation-dev-test-cycle-timeouts-custom-resources/
Docs: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html#response-timeout
Use Case
Mostly development cycle should be improved when you actively develop custom resources. I will be able to set timeout to 5 min max and see it fail faster.
Proposed Solution
New optional property added to custom resource construct (not sure to which part, most likely it is framework)
Other Information
No response
Acknowledgements
CDK version used
all
Environment details (OS name and version, etc.)
AL2
The text was updated successfully, but these errors were encountered: