interface AwsCustomResourceProps
Language | Type name |
---|---|
.NET | Amazon.CDK.CustomResources.AwsCustomResourceProps |
Java | software.amazon.awscdk.customresources.AwsCustomResourceProps |
Python | aws_cdk.custom_resources.AwsCustomResourceProps |
TypeScript (source) | @aws-cdk/custom-resources » AwsCustomResourceProps |
Properties for AwsCustomResource.
Note that at least onCreate, onUpdate or onDelete must be specified.
Example
const awsCustom = new cr.AwsCustomResource(this, 'aws-custom', {
onCreate: {
service: '...',
action: '...',
parameters: {
text: '...',
},
physicalResourceId: cr.PhysicalResourceId.of('...'),
},
onUpdate: {
service: '...',
action: '...',
parameters: {
text: '...',
resourceId: new cr.PhysicalResourceIdReference(),
},
},
policy: cr.AwsCustomResourcePolicy.fromSdkCalls({
resources: cr.AwsCustomResourcePolicy.ANY_RESOURCE,
}),
})
Properties
Name | Type | Description |
---|---|---|
policy | Aws | The policy that will be added to the execution role of the Lambda function implementing this custom resource provider. |
function | string | A name for the singleton Lambda function implementing this custom resource. |
install | boolean | Whether to install the latest AWS SDK v2. Allows to use the latest API calls documented at https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html. |
log | Retention | The number of days log events of the singleton Lambda function implementing this custom resource are kept in CloudWatch Logs. |
on | Aws | The AWS SDK call to make when the resource is created. |
on | Aws | The AWS SDK call to make when the resource is deleted. |
on | Aws | The AWS SDK call to make when the resource is updated. |
resource | string | Cloudformation Resource type. |
role? | IRole | The execution role for the singleton Lambda function implementing this custom resource provider. |
timeout? | Duration | The timeout for the singleton Lambda function implementing this custom resource. |
policy
Type:
Aws
The policy that will be added to the execution role of the Lambda function implementing this custom resource provider.
The custom resource also implements iam.IGrantable
, making it possible
to use the grantXxx()
methods.
As this custom resource uses a singleton Lambda function, it's important to note the that function's role will eventually accumulate the permissions/grants from all resources.
See also: Policy.fromSdkCalls
functionName?
Type:
string
(optional, default: AWS CloudFormation generates a unique physical ID and uses that
ID for the function's name. For more information, see Name Type.)
A name for the singleton Lambda function implementing this custom resource.
The function name will remain the same after the first AwsCustomResource is created in a stack.
installLatestAwsSdk?
Type:
boolean
(optional, default: true)
Whether to install the latest AWS SDK v2. Allows to use the latest API calls documented at https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html.
The installation takes around 60 seconds.
logRetention?
Type:
Retention
(optional, default: logs.RetentionDays.INFINITE)
The number of days log events of the singleton Lambda function implementing this custom resource are kept in CloudWatch Logs.
onCreate?
Type:
Aws
(optional, default: the call when the resource is updated)
The AWS SDK call to make when the resource is created.
onDelete?
Type:
Aws
(optional, default: no call)
The AWS SDK call to make when the resource is deleted.
onUpdate?
Type:
Aws
(optional, default: no call)
The AWS SDK call to make when the resource is updated.
resourceType?
Type:
string
(optional, default: Custom::AWS)
Cloudformation Resource type.
role?
Type:
IRole
(optional, default: a new role is created)
The execution role for the singleton Lambda function implementing this custom resource provider.
This role will apply to all AwsCustomResource
instances in the stack. The role must be assumable by the
lambda.amazonaws.com
service principal.
timeout?
Type:
Duration
(optional, default: Duration.minutes(2))
The timeout for the singleton Lambda function implementing this custom resource.