Class CustomResourceProviderOptions
Initialization options for custom resource providers.
Inheritance
Implements
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CustomResourceProviderOptions : Object, ICustomResourceProviderOptions
Syntax (vb)
Public Class CustomResourceProviderOptions
Inherits Object
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() |
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 ( |
Constructors
CustomResourceProviderOptions()
public CustomResourceProviderOptions()
Properties
Description
A description of the function.
public string Description { get; set; }
Property Value
System.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
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: - No environment variables.
MemorySize
The amount of memory that your function has access to.
public Size MemorySize { get; set; }
Property Value
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
System.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
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 Nullable<bool> UseCfnResponseWrapper { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true
if inlineCode: false
and false
otherwise.