Show / Hide Table of Contents

Class CustomResourceProviderOptions

Initialization options for custom resource providers.

Inheritance
object
CustomResourceProviderOptions
Implements
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 CustomResourceProviderOptions : ICustomResourceProviderOptions
Syntax (vb)
Public Class CustomResourceProviderOptions Implements 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 customResourceProviderOptions = new CustomResourceProviderOptions {
                Description = "description",
                Environment = new Dictionary<string, string> {
                    { "environmentKey", "environment" }
                },
                MemorySize = size,
                PolicyStatements = new [] { policyStatements },
                Timeout = Duration.Minutes(30),
                UseCfnResponseWrapper = false
            };

Synopsis

Constructors

CustomResourceProviderOptions()

Initialization options for custom resource providers.

Properties

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.

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

CustomResourceProviderOptions()

Initialization options for custom resource providers.

public CustomResourceProviderOptions()
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 customResourceProviderOptions = new CustomResourceProviderOptions {
                Description = "description",
                Environment = new Dictionary<string, string> {
                    { "environmentKey", "environment" }
                },
                MemorySize = size,
                PolicyStatements = new [] { policyStatements },
                Timeout = Duration.Minutes(30),
                UseCfnResponseWrapper = false
            };

Properties

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", "*" }
                 } }
             });

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

ICustomResourceProviderOptions
Back to top Generated by DocFX