Show / Hide Table of Contents

Class CustomResourceProviderProps

Initialization properties for CustomResourceProvider.

Inheritance
object
CustomResourceProviderProps
Implements
ICustomResourceProviderProps
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 CustomResourceProviderProps : ICustomResourceProviderProps, ICustomResourceProviderOptions
Syntax (vb)
Public Class CustomResourceProviderProps Implements ICustomResourceProviderProps, ICustomResourceProviderOptions
Remarks

ExampleMetadata: infused

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

Synopsis

Constructors

CustomResourceProviderProps()

Initialization properties for CustomResourceProvider.

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.

Runtime

The AWS Lambda runtime and version 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

CustomResourceProviderProps()

Initialization properties for CustomResourceProvider.

public CustomResourceProviderProps()
Remarks

ExampleMetadata: infused

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

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

Runtime

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

public CustomResourceProviderRuntime Runtime { get; set; }
Property Value

CustomResourceProviderRuntime

Remarks

ExampleMetadata: infused

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

ICustomResourceProviderProps
ICustomResourceProviderOptions
Back to top Generated by DocFX