-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
…es (#30911) ### Issue # (if applicable) Closes #30517. ### Reason for this change L2 construct does not support setting `serviceTimeout`. Enabling customizable timeouts is useful when using custom resources, as the current default timeout is set to 3600 seconds. Ref: [AWS CloudFormation accelerates dev-test cycle with adjustable timeouts for custom resources](https://aws.amazon.com/about-aws/whats-new/2024/06/aws-cloudformation-dev-test-cycle-timeouts-custom-resources/) ### Description of changes Add `serviceTimeout` property for `CustomResource` and `AwsCustomResource`. ### Description of how you validated changes Add unit tests and integ tests. Additionally, I confirmed that ServiceTimeout is set by checking the CloudWatch Logs of the Lambda function that generates custom resources. <img width="1036" alt="スクリーンショット 2024-07-21 2 09 15" src="https://github.com/user-attachments/assets/b99bc10b-52e6-4cdc-ba63-b4f379077bfc"> ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{ | ||
"Resources": { | ||
"CustomReflectCustomResourceProviderRoleB4B29AEC": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "lambda.amazonaws.com" | ||
} | ||
} | ||
] | ||
}, | ||
"ManagedPolicyArns": [ | ||
{ | ||
"Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" | ||
} | ||
] | ||
} | ||
}, | ||
"CustomReflectCustomResourceProviderHandler2E189D0B": { | ||
"Type": "AWS::Lambda::Function", | ||
"Properties": { | ||
"Code": { | ||
"S3Bucket": { | ||
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" | ||
}, | ||
"S3Key": "58b00a04670a58e0a99d0ca363cd2c6449822eb21c94bc5d3ca25a4816b69098.zip" | ||
}, | ||
"Timeout": 900, | ||
"MemorySize": 128, | ||
"Handler": "__entrypoint__.handler", | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"CustomReflectCustomResourceProviderRoleB4B29AEC", | ||
"Arn" | ||
] | ||
}, | ||
"Runtime": "nodejs18.x", | ||
"Description": "veni vidi vici" | ||
}, | ||
"DependsOn": [ | ||
"CustomReflectCustomResourceProviderRoleB4B29AEC" | ||
] | ||
}, | ||
"MyResource": { | ||
"Type": "Custom::Reflect", | ||
"Properties": { | ||
"ServiceToken": { | ||
"Fn::GetAtt": [ | ||
"CustomReflectCustomResourceProviderHandler2E189D0B", | ||
"Arn" | ||
] | ||
}, | ||
"ServiceTimeout": "60" | ||
}, | ||
"UpdateReplacePolicy": "Delete", | ||
"DeletionPolicy": "Delete" | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.