Interface CreateLifecyclePolicyRequest.Builder

  • Method Details

    • name

      The name of the lifecycle policy to create. Policy names must be unique to your account in each Amazon Web Services Region. Image Builder generates the policy ARN from a normalized form of the name, so names that differ only in case, spaces, or underscores count as the same name. You can't change the name after creation.

      Parameters:
      name - The name of the lifecycle policy to create. Policy names must be unique to your account in each Amazon Web Services Region. Image Builder generates the policy ARN from a normalized form of the name, so names that differ only in case, spaces, or underscores count as the same name. You can't change the name after creation.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • description

      CreateLifecyclePolicyRequest.Builder description(String description)

      Optional description for the lifecycle policy.

      Parameters:
      description - Optional description for the lifecycle policy.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • status

      Indicates whether the lifecycle policy resource is enabled. If you don't specify a status, it defaults to ENABLED. Only enabled policies run on their schedule.

      Parameters:
      status - Indicates whether the lifecycle policy resource is enabled. If you don't specify a status, it defaults to ENABLED. Only enabled policies run on their schedule.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • status

      Indicates whether the lifecycle policy resource is enabled. If you don't specify a status, it defaults to ENABLED. Only enabled policies run on their schedule.

      Parameters:
      status - Indicates whether the lifecycle policy resource is enabled. If you don't specify a status, it defaults to ENABLED. Only enabled policies run on their schedule.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • executionRole

      CreateLifecyclePolicyRequest.Builder executionRole(String executionRole)

      The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions. You must have permission to pass the role, and the role's trust policy must allow the Image Builder service principal to assume it.

      Parameters:
      executionRole - The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to run lifecycle actions. You must have permission to pass the role, and the role's trust policy must allow the Image Builder service principal to assume it.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • resourceType

      CreateLifecyclePolicyRequest.Builder resourceType(String resourceType)

      The type of Image Builder resource that the lifecycle policy applies to. The resource type determines the allowed rule actions: policies for AMI-based Image Builder images support DELETE, DEPRECATE, and DISABLE, and policies for container-based Image Builder images support only DELETE. You can't change the resource type after creation.

      Parameters:
      resourceType - The type of Image Builder resource that the lifecycle policy applies to. The resource type determines the allowed rule actions: policies for AMI-based Image Builder images support DELETE, DEPRECATE, and DISABLE, and policies for container-based Image Builder images support only DELETE. You can't change the resource type after creation.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • resourceType

      The type of Image Builder resource that the lifecycle policy applies to. The resource type determines the allowed rule actions: policies for AMI-based Image Builder images support DELETE, DEPRECATE, and DISABLE, and policies for container-based Image Builder images support only DELETE. You can't change the resource type after creation.

      Parameters:
      resourceType - The type of Image Builder resource that the lifecycle policy applies to. The resource type determines the allowed rule actions: policies for AMI-based Image Builder images support DELETE, DEPRECATE, and DISABLE, and policies for container-based Image Builder images support only DELETE. You can't change the resource type after creation.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • policyDetails

      Configuration details for the lifecycle policy rules. A policy can contain at most one rule per action type: one DELETE, one DEPRECATE, and one DISABLE.

      Parameters:
      policyDetails - Configuration details for the lifecycle policy rules. A policy can contain at most one rule per action type: one DELETE, one DEPRECATE, and one DISABLE.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • policyDetails

      Configuration details for the lifecycle policy rules. A policy can contain at most one rule per action type: one DELETE, one DEPRECATE, and one DISABLE.

      Parameters:
      policyDetails - Configuration details for the lifecycle policy rules. A policy can contain at most one rule per action type: one DELETE, one DEPRECATE, and one DISABLE.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • policyDetails

      Configuration details for the lifecycle policy rules. A policy can contain at most one rule per action type: one DELETE, one DEPRECATE, and one DISABLE.

      This is a convenience method that creates an instance of the LifecyclePolicyDetail.Builder avoiding the need to create one manually via LifecyclePolicyDetail.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to policyDetails(List<LifecyclePolicyDetail>).

      Parameters:
      policyDetails - a consumer that will call methods on LifecyclePolicyDetail.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • resourceSelection

      Selection criteria for the resources that the lifecycle policy applies to. You must specify exactly one selection criteria: either recipes or a tag map, not both.

      Parameters:
      resourceSelection - Selection criteria for the resources that the lifecycle policy applies to. You must specify exactly one selection criteria: either recipes or a tag map, not both.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • resourceSelection

      Selection criteria for the resources that the lifecycle policy applies to. You must specify exactly one selection criteria: either recipes or a tag map, not both.

      This is a convenience method that creates an instance of the LifecyclePolicyResourceSelection.Builder avoiding the need to create one manually via LifecyclePolicyResourceSelection.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to resourceSelection(LifecyclePolicyResourceSelection).

      Parameters:
      resourceSelection - a consumer that will call methods on LifecyclePolicyResourceSelection.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • tags

      Tags to apply to the lifecycle policy resource.

      Parameters:
      tags - Tags to apply to the lifecycle policy resource.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • clientToken

      CreateLifecyclePolicyRequest.Builder clientToken(String clientToken)

      A unique, case-sensitive identifier you provide to ensure that the operation runs no more than one time. If you retry a request with the same client token, Image Builder returns the original response without running the operation again. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.

      Parameters:
      clientToken - A unique, case-sensitive identifier you provide to ensure that the operation runs no more than one time. If you retry a request with the same client token, Image Builder returns the original response without running the operation again. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • dryRun

      Validates the required permissions and request parameters without performing the operation. If validation succeeds, the operation returns a DryRunOperationException error response.

      Parameters:
      dryRun - Validates the required permissions and request parameters without performing the operation. If validation succeeds, the operation returns a DryRunOperationException error response.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • overrideConfiguration

      CreateLifecyclePolicyRequest.Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration)
      Description copied from interface: AwsRequest.Builder
      Add an optional request override configuration.
      Specified by:
      overrideConfiguration in interface AwsRequest.Builder
      Parameters:
      overrideConfiguration - The override configuration.
      Returns:
      This object for method chaining.
    • overrideConfiguration

      Description copied from interface: AwsRequest.Builder
      Add an optional request override configuration.
      Specified by:
      overrideConfiguration in interface AwsRequest.Builder
      Parameters:
      builderConsumer - A Consumer to which an empty AwsRequestOverrideConfiguration.Builder will be given.
      Returns:
      This object for method chaining.