AwsCustomResourceProps

class aws_cdk.custom_resources.AwsCustomResourceProps(*, on_create=None, on_delete=None, on_update=None, policy_statements=None, resource_type=None, role=None, timeout=None)

Bases: object

__init__(*, on_create=None, on_delete=None, on_update=None, policy_statements=None, resource_type=None, role=None, timeout=None)
Parameters
  • on_create (Optional[AwsSdkCall]) – The AWS SDK call to make when the resource is created. At least onCreate, onUpdate or onDelete must be specified. 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

  • policy_statements (Optional[List[PolicyStatement]]) – The IAM policy statements to allow the different calls. Use only if resource restriction is needed. 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. Default: - extract the permissions from the calls

  • 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)

stability :stability: experimental

Attributes

on_create

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

At least onCreate, onUpdate or onDelete must be specified.

default :default: - the call when the resource is updated

stability :stability: experimental

Return type

Optional[AwsSdkCall]

on_delete

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

default :default: - no call

stability :stability: experimental

Return type

Optional[AwsSdkCall]

on_update

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

default :default: - no call

stability :stability: experimental

Return type

Optional[AwsSdkCall]

policy_statements

The IAM policy statements to allow the different calls. Use only if resource restriction is needed.

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.

default :default: - extract the permissions from the calls

stability :stability: experimental

Return type

Optional[List[PolicyStatement]]

resource_type

Cloudformation Resource type.

default :default: - Custom::AWS

stability :stability: experimental

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 :default: - a new role is created

stability :stability: experimental

Return type

Optional[IRole]

timeout

The timeout for the Lambda function implementing this custom resource.

default :default: Duration.minutes(2)

stability :stability: experimental

Return type

Optional[Duration]