AwsCustomResourceProps

class aws_cdk.custom_resources.AwsCustomResourceProps(*, policy, function_name=None, install_latest_aws_sdk=None, log_retention=None, on_create=None, on_delete=None, on_update=None, resource_type=None, role=None, timeout=None)

Bases: object

Properties for AwsCustomResource.

Note that at least onCreate, onUpdate or onDelete must be specified.

Parameters
  • policy (AwsCustomResourcePolicy) – 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.

  • function_name (Optional[str]) – A name for the Lambda function implementing this custom resource. Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the function’s name. For more information, see Name Type.

  • install_latest_aws_sdk (Optional[bool]) – 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. Default: true

  • log_retention (Optional[RetentionDays]) – The number of days log events of the Lambda function implementing this custom resource are kept in CloudWatch Logs. Default: logs.RetentionDays.INFINITE

  • on_create (Optional[AwsSdkCall]) – The AWS SDK call to make when the resource is created. Default: - the call when the resource is updated

  • on_delete (Optional[AwsSdkCall]) – The AWS SDK call to make when the resource is deleted. Default: - no call

  • on_update (Optional[AwsSdkCall]) – The AWS SDK call to make when the resource is updated. Default: - no call

  • resource_type (Optional[str]) – Cloudformation Resource type. Default: - Custom::AWS

  • role (Optional[IRole]) – The execution role for the 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. Default: - a new role is created

  • timeout (Optional[Duration]) – The timeout for the Lambda function implementing this custom resource. Default: Duration.minutes(2)

Attributes

function_name

A name for the Lambda function implementing this custom resource.

Default

  • AWS CloudFormation generates a unique physical ID and uses that

ID for the function’s name. For more information, see Name Type.

Return type

Optional[str]

install_latest_aws_sdk

//docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html.

The installation takes around 60 seconds.

Default

true

Type

Whether to install the latest AWS SDK v2. Allows to use the latest API calls documented at https

Return type

Optional[bool]

log_retention

The number of days log events of the Lambda function implementing this custom resource are kept in CloudWatch Logs.

Default

logs.RetentionDays.INFINITE

Return type

Optional[RetentionDays]

on_create

The AWS SDK call to make when the resource is created.

Default
  • the call when the resource is updated

Return type

Optional[AwsSdkCall]

on_delete

The AWS SDK call to make when the resource is deleted.

Default
  • no call

Return type

Optional[AwsSdkCall]

on_update

The AWS SDK call to make when the resource is updated.

Default
  • no call

Return type

Optional[AwsSdkCall]

policy

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

Policy.fromSdkCalls

Return type

AwsCustomResourcePolicy

resource_type

Cloudformation Resource type.

Default
  • Custom::AWS

Return type

Optional[str]

role

The execution role for the 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.

Default
  • a new role is created

Return type

Optional[IRole]

timeout

The timeout for the Lambda function implementing this custom resource.

Default

Duration.minutes(2)

Return type

Optional[Duration]