Show / Hide Table of Contents

Class CustomResourceProviderBaseProps

Initialization properties for CustomResourceProviderBase.

Inheritance
object
CustomResourceProviderBaseProps
Implements
ICustomResourceProviderBaseProps
ICustomResourceProviderOptions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CustomResourceProviderBaseProps : ICustomResourceProviderBaseProps, ICustomResourceProviderOptions
Syntax (vb)
Public Class CustomResourceProviderBaseProps Implements ICustomResourceProviderBaseProps, ICustomResourceProviderOptions
Remarks

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
            // The values are placeholders you should change.
            using Amazon.CDK;

            var policyStatements;
            Size size;

            var customResourceProviderBaseProps = new CustomResourceProviderBaseProps {
                CodeDirectory = "codeDirectory",
                RuntimeName = "runtimeName",

                // the properties below are optional
                Description = "description",
                Environment = new Dictionary<string, string> {
                    { "environmentKey", "environment" }
                },
                MemorySize = size,
                PolicyStatements = new [] { policyStatements },
                Timeout = Duration.Minutes(30),
                UseCfnResponseWrapper = false
            };

Synopsis

Constructors

CustomResourceProviderBaseProps()

Initialization properties for CustomResourceProviderBase.

Properties

CodeDirectory

A local file system directory with the provider's code.

Description

A description of the function.

Environment

Key-value pairs that are passed to Lambda as Environment.

MemorySize

The amount of memory that your function has access to.

PolicyStatements

A set of IAM policy statements to include in the inline policy of the provider's lambda function.

RuntimeName

The AWS Lambda runtime and version name to use for the provider.

Timeout

AWS Lambda timeout for the provider.

UseCfnResponseWrapper

Whether or not the cloudformation response wrapper (nodejs-entrypoint.ts) is used. If set to true, nodejs-entrypoint.js is bundled in the same asset as the custom resource and set as the entrypoint. If set to false, the custom resource provided is the entrypoint.

Constructors

CustomResourceProviderBaseProps()

Initialization properties for CustomResourceProviderBase.

public CustomResourceProviderBaseProps()
Remarks

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
            // The values are placeholders you should change.
            using Amazon.CDK;

            var policyStatements;
            Size size;

            var customResourceProviderBaseProps = new CustomResourceProviderBaseProps {
                CodeDirectory = "codeDirectory",
                RuntimeName = "runtimeName",

                // the properties below are optional
                Description = "description",
                Environment = new Dictionary<string, string> {
                    { "environmentKey", "environment" }
                },
                MemorySize = size,
                PolicyStatements = new [] { policyStatements },
                Timeout = Duration.Minutes(30),
                UseCfnResponseWrapper = false
            };

Properties

CodeDirectory

A local file system directory with the provider's code.

public string CodeDirectory { get; set; }
Property Value

string

Remarks

The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.

Description

A description of the function.

public string? Description { get; set; }
Property Value

string

Remarks

Default: - No description.

Environment

Key-value pairs that are passed to Lambda as Environment.

public IDictionary<string, string>? Environment { get; set; }
Property Value

IDictionary<string, string>

Remarks

Default: - No environment variables.

MemorySize

The amount of memory that your function has access to.

public Size? MemorySize { get; set; }
Property Value

Size

Remarks

Increasing the function's memory also increases its CPU allocation.

Default: Size.mebibytes(128)

PolicyStatements

A set of IAM policy statements to include in the inline policy of the provider's lambda function.

public object[]? PolicyStatements { get; set; }
Property Value

object[]

Remarks

Please note: these are direct IAM JSON policy blobs, not iam.PolicyStatement objects like you will see in the rest of the CDK.

Default: - no additional inline policy

Examples
var provider = CustomResourceProvider.GetOrCreateProvider(this, "Custom::MyCustomResourceType", new CustomResourceProviderProps {
                 CodeDirectory = $"{__dirname}/my-handler",
                 Runtime = CustomResourceProviderRuntime.NODEJS_18_X,
                 PolicyStatements = new [] { new Dictionary<string, string> {
                     { "Effect", "Allow" },
                     { "Action", "s3:PutObject*" },
                     { "Resource", "*" }
                 } }
             });

RuntimeName

The AWS Lambda runtime and version name to use for the provider.

public string RuntimeName { get; set; }
Property Value

string

Remarks

ExampleMetadata: fixture=_generated

Timeout

AWS Lambda timeout for the provider.

public Duration? Timeout { get; set; }
Property Value

Duration

Remarks

Default: Duration.minutes(15)

UseCfnResponseWrapper

Whether or not the cloudformation response wrapper (nodejs-entrypoint.ts) is used. If set to true, nodejs-entrypoint.js is bundled in the same asset as the custom resource and set as the entrypoint. If set to false, the custom resource provided is the entrypoint.

public bool? UseCfnResponseWrapper { get; set; }
Property Value

bool?

Remarks

Default: - true if inlineCode: false and false otherwise.

Implements

ICustomResourceProviderBaseProps
ICustomResourceProviderOptions
Back to top Generated by DocFX