CustomResourceProvider

class aws_cdk.core.CustomResourceProvider(scope, id, *, code_directory, runtime, environment=None, memory_size=None, policy_statements=None, timeout=None)

Bases: aws_cdk.core.Construct

(experimental) An AWS-Lambda backed custom resource provider.

Stability

experimental

Parameters
  • scope (Construct) –

  • id (str) –

  • code_directory (str) – (experimental) A local file system directory with the provider’s code. The code will be bundled into a zip asset and wired to the provider’s AWS Lambda function.

  • runtime (CustomResourceProviderRuntime) – (experimental) The AWS Lambda runtime and version to use for the provider.

  • environment (Optional[Mapping[str, str]]) – (experimental) Key-value pairs that are passed to Lambda as Environment. Default: - No environment variables.

  • memory_size (Optional[Size]) – (experimental) The amount of memory that your function has access to. Increasing the function’s memory also increases its CPU allocation. Default: Size.mebibytes(128)

  • policy_statements (Optional[List[Any]]) – (experimental) A set of IAM policy statements to include in the inline policy of the provider’s lambda function. Default: - no additional inline policy

  • timeout (Optional[Duration]) – (experimental) AWS Lambda timeout for the provider. Default: Duration.minutes(15)

Stability

experimental

Methods

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

node

The construct tree node associated with this construct.

Return type

ConstructNode

service_token

(experimental) The ARN of the provider’s AWS Lambda function which should be used as the serviceToken when defining a custom resource.

Stability

experimental

Example:

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
CustomResource(self, "MyCustomResource",
    # ...
    service_token=provider.service_token
)
Return type

str

Static Methods

classmethod get_or_create(scope, uniqueid, *, code_directory, runtime, environment=None, memory_size=None, policy_statements=None, timeout=None)

(experimental) Returns a stack-level singleton ARN (service token) for the custom resource provider.

Parameters
  • scope (Construct) – Construct scope.

  • uniqueid (str) – A globally unique id that will be used for the stack-level construct.

  • code_directory (str) – (experimental) A local file system directory with the provider’s code. The code will be bundled into a zip asset and wired to the provider’s AWS Lambda function.

  • runtime (CustomResourceProviderRuntime) – (experimental) The AWS Lambda runtime and version to use for the provider.

  • environment (Optional[Mapping[str, str]]) – (experimental) Key-value pairs that are passed to Lambda as Environment. Default: - No environment variables.

  • memory_size (Optional[Size]) – (experimental) The amount of memory that your function has access to. Increasing the function’s memory also increases its CPU allocation. Default: Size.mebibytes(128)

  • policy_statements (Optional[List[Any]]) – (experimental) A set of IAM policy statements to include in the inline policy of the provider’s lambda function. Default: - no additional inline policy

  • timeout (Optional[Duration]) – (experimental) AWS Lambda timeout for the provider. Default: Duration.minutes(15)

Return type

str

Returns

the service token of the custom resource provider, which should be used when defining a CustomResource.

Stability

experimental

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool