Interface AwsCustomResourceProps

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:42.047Z") @Stability(Stable) public interface AwsCustomResourceProps extends software.amazon.jsii.JsiiSerializable
Properties for AwsCustomResource.

Note that at least onCreate, onUpdate or onDelete must be specified.

Example:

 AwsCustomResource awsCustom = AwsCustomResource.Builder.create(this, "aws-custom")
         .onCreate(AwsSdkCall.builder()
                 .service("...")
                 .action("...")
                 .parameters(Map.of(
                         "text", "..."))
                 .physicalResourceId(PhysicalResourceId.of("..."))
                 .build())
         .onUpdate(AwsSdkCall.builder()
                 .service("...")
                 .action("...")
                 .parameters(Map.of(
                         "text", "...",
                         "resourceId", new PhysicalResourceIdReference()))
                 .build())
         .policy(AwsCustomResourcePolicy.fromSdkCalls(SdkCallsPolicyOptions.builder()
                 .resources(AwsCustomResourcePolicy.ANY_RESOURCE)
                 .build()))
         .build();
 
  • Method Details

    • getPolicy

      @Stability(Stable) @NotNull AwsCustomResourcePolicy getPolicy()
      The policy that will be added to the execution role of the Lambda function implementing this custom resource provider.

      The custom resource also implements iam.IGrantable, making it possible to use the grantXxx() methods.

      As this custom resource uses a singleton Lambda function, it's important to note the that function's role will eventually accumulate the permissions/grants from all resources.

      See Also:
    • getFunctionName

      @Stability(Stable) @Nullable default String getFunctionName()
      A name for the singleton Lambda function implementing this custom resource.

      The function name will remain the same after the first AwsCustomResource is created in a stack.

      Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the function's name. For more information, see Name Type.

    • getInstallLatestAwsSdk

      @Stability(Stable) @Nullable default Boolean getInstallLatestAwsSdk()
      Whether to install the latest AWS SDK v2. Allows to use the latest API calls documented at https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html.

      The installation takes around 60 seconds.

      Default: true

    • getLogRetention

      @Stability(Stable) @Nullable default RetentionDays getLogRetention()
      The number of days log events of the singleton Lambda function implementing this custom resource are kept in CloudWatch Logs.

      Default: logs.RetentionDays.INFINITE

    • getOnCreate

      @Stability(Stable) @Nullable default AwsSdkCall getOnCreate()
      The AWS SDK call to make when the resource is created.

      Default: - the call when the resource is updated

    • getOnDelete

      @Stability(Stable) @Nullable default AwsSdkCall getOnDelete()
      The AWS SDK call to make when the resource is deleted.

      Default: - no call

    • getOnUpdate

      @Stability(Stable) @Nullable default AwsSdkCall getOnUpdate()
      The AWS SDK call to make when the resource is updated.

      Default: - no call

    • getResourceType

      @Stability(Stable) @Nullable default String getResourceType()
      Cloudformation Resource type.

      Default: - Custom::AWS

    • getRole

      @Stability(Stable) @Nullable default IRole getRole()
      The execution role for the singleton Lambda function implementing this custom resource provider.

      This role will apply to all AwsCustomResource instances in the stack. The role must be assumable by the lambda.amazonaws.com service principal.

      Default: - a new role is created

    • getTimeout

      @Stability(Stable) @Nullable default Duration getTimeout()
      The timeout for the singleton Lambda function implementing this custom resource.

      Default: Duration.minutes(2)

    • builder

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