Interface CustomResourceProviderProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CustomResourceProviderProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:55.011Z") @Stability(Stable) public interface CustomResourceProviderProps extends software.amazon.jsii.JsiiSerializable
Initialization properties for CustomResourceProvider.

Example:

 String serviceToken = CustomResourceProvider.getOrCreate(this, "Custom::MyCustomResourceType", CustomResourceProviderProps.builder()
         .codeDirectory(String.format("%s/my-handler", __dirname))
         .runtime(CustomResourceProviderRuntime.NODEJS_14_X)
         .description("Lambda function created by the custom resource provider")
         .build());
 CustomResource.Builder.create(this, "MyResource")
         .resourceType("Custom::MyCustomResourceType")
         .serviceToken(serviceToken)
         .build();
 
  • Method Details

    • getCodeDirectory

      @Stability(Stable) @NotNull String getCodeDirectory()
      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.

    • getRuntime

      @Stability(Stable) @NotNull CustomResourceProviderRuntime getRuntime()
      The AWS Lambda runtime and version to use for the provider.
    • getDescription

      @Stability(Stable) @Nullable default String getDescription()
      A description of the function.

      Default: - No description.

    • getEnvironment

      @Stability(Stable) @Nullable default Map<String,String> getEnvironment()
      Key-value pairs that are passed to Lambda as Environment.

      Default: - No environment variables.

    • getMemorySize

      @Stability(Stable) @Nullable default Size getMemorySize()
      The amount of memory that your function has access to.

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

      Default: Size.mebibytes(128)

    • getPolicyStatements

      @Stability(Stable) @Nullable default List<Object> getPolicyStatements()
      A set of IAM policy statements to include in the inline policy of the provider's lambda function.

      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

      Example:

       CustomResourceProvider provider = CustomResourceProvider.getOrCreateProvider(this, "Custom::MyCustomResourceType", CustomResourceProviderProps.builder()
               .codeDirectory(String.format("%s/my-handler", __dirname))
               .runtime(CustomResourceProviderRuntime.NODEJS_14_X)
               .policyStatements(List.of(Map.of(
                       "Effect", "Allow",
                       "Action", "s3:PutObject*",
                       "Resource", "*")))
               .build());
       
    • getTimeout

      @Stability(Stable) @Nullable default Duration getTimeout()
      AWS Lambda timeout for the provider.

      Default: Duration.minutes(15)

    • builder

      @Stability(Stable) static CustomResourceProviderProps.Builder builder()
      Returns:
      a CustomResourceProviderProps.Builder of CustomResourceProviderProps