Interface IProviderProps
Initialization properties for the Provider
construct.
Namespace: Amazon.CDK.CustomResources
Assembly: Amazon.CDK.AWS.CustomResources.dll
Syntax (csharp)
public interface IProviderProps
Syntax (vb)
Public Interface IProviderProps
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.CustomResources;
using Amazon.CDK.AWS.Lambda;
using Amazon.CDK;
Function myOnEventLambda;
Function myIsCompleteLambda;
var stack = new Stack();
var provider = new Provider(stack, "myProvider", new ProviderProps {
OnEventHandler = myOnEventLambda,
IsCompleteHandler = myIsCompleteLambda
});
Synopsis
Properties
IsCompleteHandler | The AWS Lambda function to invoke in order to determine if the operation is complete. |
LogRetention | The number of days framework log events are kept in CloudWatch Logs. |
OnEventHandler | The AWS Lambda function to invoke for all resource lifecycle operations (CREATE/UPDATE/DELETE). |
ProviderFunctionName | Provider Lambda name. |
QueryInterval | Time between calls to the |
Role | AWS Lambda execution role. |
SecurityGroups | Security groups to attach to the provider functions. |
TotalTimeout | Total timeout for the entire operation. |
Vpc | The vpc to provision the lambda functions in. |
VpcSubnets | Which subnets from the VPC to place the lambda functions in. |
Properties
IsCompleteHandler
The AWS Lambda function to invoke in order to determine if the operation is complete.
virtual IFunction IsCompleteHandler { get; }
Property Value
Remarks
This function will be called immediately after onEvent
and then
periodically based on the configured query interval as long as it returns
false
. If the function still returns false
and the alloted timeout has
passed, the operation will fail.
Default: - provider is synchronous. This means that the onEvent
handler
is expected to finish all lifecycle operations within the initial invocation.
LogRetention
The number of days framework log events are kept in CloudWatch Logs.
virtual Nullable<RetentionDays> LogRetention { get; }
Property Value
System.Nullable<RetentionDays>
Remarks
When
updating this property, unsetting it doesn't remove the log retention policy.
To remove the retention policy, set the value to INFINITE
.
Default: logs.RetentionDays.INFINITE
OnEventHandler
The AWS Lambda function to invoke for all resource lifecycle operations (CREATE/UPDATE/DELETE).
IFunction OnEventHandler { get; }
Property Value
Remarks
This function is responsible to begin the requested resource operation
(CREATE/UPDATE/DELETE) and return any additional properties to add to the
event, which will later be passed to isComplete
. The PhysicalResourceId
property must be included in the response.
ProviderFunctionName
Provider Lambda name.
virtual string ProviderFunctionName { get; }
Property Value
System.String
Remarks
The provider lambda function name.
Default: - CloudFormation default name from unique physical ID
QueryInterval
Time between calls to the isComplete
handler which determines if the resource has been stabilized.
virtual Duration QueryInterval { get; }
Property Value
Remarks
The first isComplete
will be called immediately after handler
and then
every queryInterval
seconds, and until timeout
has been reached or until
isComplete
returns true
.
Default: Duration.seconds(5)
Role
AWS Lambda execution role.
virtual IRole Role { get; }
Property Value
Remarks
The role that will be assumed by the AWS Lambda. Must be assumable by the 'lambda.amazonaws.com' service principal.
Default: - A default role will be created.
SecurityGroups
Security groups to attach to the provider functions.
virtual ISecurityGroup[] SecurityGroups { get; }
Property Value
Remarks
Only used if 'vpc' is supplied
Default: - If vpc
is not supplied, no security groups are attached. Otherwise, a dedicated security
group is created for each function.
TotalTimeout
Total timeout for the entire operation.
virtual Duration TotalTimeout { get; }
Property Value
Remarks
The maximum timeout is 2 hours (yes, it can exceed the AWS Lambda 15 minutes)
Default: Duration.minutes(30)
Vpc
The vpc to provision the lambda functions in.
virtual IVpc Vpc { get; }
Property Value
Remarks
Default: - functions are not provisioned inside a vpc.
VpcSubnets
Which subnets from the VPC to place the lambda functions in.
virtual ISubnetSelection VpcSubnets { get; }
Property Value
Remarks
Only used if 'vpc' is supplied. Note: internet access for Lambdas requires a NAT gateway, so picking Public subnets is not allowed.
Default: - the Vpc default strategy if not specified