Class Provider.Builder

java.lang.Object
software.amazon.awscdk.customresources.Provider.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<Provider>
Enclosing class:
Provider

@Stability(Stable) public static final class Provider.Builder extends Object implements software.amazon.jsii.Builder<Provider>
A fluent builder for Provider.
  • Method Details

    • create

      @Stability(Stable) public static Provider.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of Provider.Builder.
    • onEventHandler

      @Stability(Stable) public Provider.Builder onEventHandler(IFunction onEventHandler)
      The AWS Lambda function to invoke for all resource lifecycle operations (CREATE/UPDATE/DELETE).

      This function is responsible to begin the requested resource operation (CREATE/UPDATE/DELETE) and return any additional properties to add to the event, which will later be passed to isComplete. The PhysicalResourceId property must be included in the response.

      Parameters:
      onEventHandler - The AWS Lambda function to invoke for all resource lifecycle operations (CREATE/UPDATE/DELETE). This parameter is required.
      Returns:
      this
    • isCompleteHandler

      @Stability(Stable) public Provider.Builder isCompleteHandler(IFunction isCompleteHandler)
      The AWS Lambda function to invoke in order to determine if the operation is complete.

      This function will be called immediately after onEvent and then periodically based on the configured query interval as long as it returns false. If the function still returns false and the alloted timeout has passed, the operation will fail.

      Default: - provider is synchronous. This means that the `onEvent` handler is expected to finish all lifecycle operations within the initial invocation.

      Parameters:
      isCompleteHandler - The AWS Lambda function to invoke in order to determine if the operation is complete. This parameter is required.
      Returns:
      this
    • logRetention

      @Stability(Stable) public Provider.Builder logRetention(RetentionDays logRetention)
      The number of days framework log events are kept in CloudWatch Logs.

      When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to INFINITE.

      Default: logs.RetentionDays.INFINITE

      Parameters:
      logRetention - The number of days framework log events are kept in CloudWatch Logs. This parameter is required.
      Returns:
      this
    • providerFunctionName

      @Stability(Stable) public Provider.Builder providerFunctionName(String providerFunctionName)
      Provider Lambda name.

      The provider lambda function name.

      Default: - CloudFormation default name from unique physical ID

      Parameters:
      providerFunctionName - Provider Lambda name. This parameter is required.
      Returns:
      this
    • queryInterval

      @Stability(Stable) public Provider.Builder queryInterval(Duration queryInterval)
      Time between calls to the isComplete handler which determines if the resource has been stabilized.

      The first isComplete will be called immediately after handler and then every queryInterval seconds, and until timeout has been reached or until isComplete returns true.

      Default: Duration.seconds(5)

      Parameters:
      queryInterval - Time between calls to the isComplete handler which determines if the resource has been stabilized. This parameter is required.
      Returns:
      this
    • role

      @Stability(Stable) public Provider.Builder role(IRole role)
      AWS Lambda execution role.

      The role that will be assumed by the AWS Lambda. Must be assumable by the 'lambda.amazonaws.com' service principal.

      Default: - A default role will be created.

      Parameters:
      role - AWS Lambda execution role. This parameter is required.
      Returns:
      this
    • securityGroups

      @Stability(Stable) public Provider.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      Security groups to attach to the provider functions.

      Only used if 'vpc' is supplied

      Default: - If `vpc` is not supplied, no security groups are attached. Otherwise, a dedicated security group is created for each function.

      Parameters:
      securityGroups - Security groups to attach to the provider functions. This parameter is required.
      Returns:
      this
    • totalTimeout

      @Stability(Stable) public Provider.Builder totalTimeout(Duration totalTimeout)
      Total timeout for the entire operation.

      The maximum timeout is 2 hours (yes, it can exceed the AWS Lambda 15 minutes)

      Default: Duration.minutes(30)

      Parameters:
      totalTimeout - Total timeout for the entire operation. This parameter is required.
      Returns:
      this
    • vpc

      @Stability(Stable) public Provider.Builder vpc(IVpc vpc)
      The vpc to provision the lambda functions in.

      Default: - functions are not provisioned inside a vpc.

      Parameters:
      vpc - The vpc to provision the lambda functions in. This parameter is required.
      Returns:
      this
    • vpcSubnets

      @Stability(Stable) public Provider.Builder vpcSubnets(SubnetSelection vpcSubnets)
      Which subnets from the VPC to place the lambda functions in.

      Only used if 'vpc' is supplied. Note: internet access for Lambdas requires a NAT gateway, so picking Public subnets is not allowed.

      Default: - the Vpc default strategy if not specified

      Parameters:
      vpcSubnets - Which subnets from the VPC to place the lambda functions in. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public Provider build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Provider>
      Returns:
      a newly built instance of Provider.