CustomResourceProvider¶
-
class
aws_cdk.core.
CustomResourceProvider
(scope, id, *, code_directory, runtime, description=None, 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.description (
Optional
[str
]) – (experimental) A description of the function. Default: - No description.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 policytimeout (
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
-
role_arn
¶ (experimental) The ARN of the provider’s AWS Lambda function role.
- Stability
experimental
- Return type
str
-
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. See https://github.com/aws/jsii/issues/826 CustomResource(self, "MyCustomResource", # ... service_token=my_provider.service_token )
- Return type
str
Static Methods
-
classmethod
get_or_create
(scope, uniqueid, *, code_directory, runtime, description=None, 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.description (
Optional
[str
]) – (experimental) A description of the function. Default: - No description.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 policytimeout (
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
get_or_create_provider
(scope, uniqueid, *, code_directory, runtime, description=None, environment=None, memory_size=None, policy_statements=None, timeout=None)¶ (experimental) Returns a stack-level singleton 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.description (
Optional
[str
]) – (experimental) A description of the function. Default: - No description.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 policytimeout (
Optional
[Duration
]) – (experimental) AWS Lambda timeout for the provider. Default: Duration.minutes(15)
- Return type
- 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