class Aws::DLM::Types::PolicyDetails

Specifies the configuration of a lifecycle policy.

@note When making an API call, you may pass PolicyDetails

data as a hash:

    {
      policy_type: "EBS_SNAPSHOT_MANAGEMENT", # accepts EBS_SNAPSHOT_MANAGEMENT, IMAGE_MANAGEMENT, EVENT_BASED_POLICY
      resource_types: ["VOLUME"], # accepts VOLUME, INSTANCE
      resource_locations: ["CLOUD"], # accepts CLOUD, OUTPOST
      target_tags: [
        {
          key: "String", # required
          value: "String", # required
        },
      ],
      schedules: [
        {
          name: "ScheduleName",
          copy_tags: false,
          tags_to_add: [
            {
              key: "String", # required
              value: "String", # required
            },
          ],
          variable_tags: [
            {
              key: "String", # required
              value: "String", # required
            },
          ],
          create_rule: {
            location: "CLOUD", # accepts CLOUD, OUTPOST_LOCAL
            interval: 1,
            interval_unit: "HOURS", # accepts HOURS
            times: ["Time"],
            cron_expression: "CronExpression",
          },
          retain_rule: {
            count: 1,
            interval: 1,
            interval_unit: "DAYS", # accepts DAYS, WEEKS, MONTHS, YEARS
          },
          fast_restore_rule: {
            count: 1,
            interval: 1,
            interval_unit: "DAYS", # accepts DAYS, WEEKS, MONTHS, YEARS
            availability_zones: ["AvailabilityZone"], # required
          },
          cross_region_copy_rules: [
            {
              target_region: "TargetRegion",
              target: "Target",
              encrypted: false, # required
              cmk_arn: "CmkArn",
              copy_tags: false,
              retain_rule: {
                interval: 1,
                interval_unit: "DAYS", # accepts DAYS, WEEKS, MONTHS, YEARS
              },
              deprecate_rule: {
                interval: 1,
                interval_unit: "DAYS", # accepts DAYS, WEEKS, MONTHS, YEARS
              },
            },
          ],
          share_rules: [
            {
              target_accounts: ["AwsAccountId"], # required
              unshare_interval: 1,
              unshare_interval_unit: "DAYS", # accepts DAYS, WEEKS, MONTHS, YEARS
            },
          ],
          deprecate_rule: {
            count: 1,
            interval: 1,
            interval_unit: "DAYS", # accepts DAYS, WEEKS, MONTHS, YEARS
          },
        },
      ],
      parameters: {
        exclude_boot_volume: false,
        no_reboot: false,
      },
      event_source: {
        type: "MANAGED_CWE", # required, accepts MANAGED_CWE
        parameters: {
          event_type: "shareSnapshot", # required, accepts shareSnapshot
          snapshot_owner: ["AwsAccountId"], # required
          description_regex: "DescriptionRegex", # required
        },
      },
      actions: [
        {
          name: "ActionName", # required
          cross_region_copy: [ # required
            {
              target: "Target", # required
              encryption_configuration: { # required
                encrypted: false, # required
                cmk_arn: "CmkArn",
              },
              retain_rule: {
                interval: 1,
                interval_unit: "DAYS", # accepts DAYS, WEEKS, MONTHS, YEARS
              },
            },
          ],
        },
      ],
    }

@!attribute [rw] policy_type

The valid target resource types and actions a policy can manage.
Specify `EBS_SNAPSHOT_MANAGEMENT` to create a lifecycle policy that
manages the lifecycle of Amazon EBS snapshots. Specify
`IMAGE_MANAGEMENT` to create a lifecycle policy that manages the
lifecycle of EBS-backed AMIs. Specify `EVENT_BASED_POLICY ` to
create an event-based policy that performs specific actions when a
defined event occurs in your Amazon Web Services account.

The default is `EBS_SNAPSHOT_MANAGEMENT`.
@return [String]

@!attribute [rw] resource_types

The target resource type for snapshot and AMI lifecycle policies.
Use `VOLUME `to create snapshots of individual volumes or use
`INSTANCE` to create multi-volume snapshots from the volumes for an
instance.

This parameter is required for snapshot and AMI policies only. If
you are creating an event-based policy, omit this parameter.
@return [Array<String>]

@!attribute [rw] resource_locations

The location of the resources to backup. If the source resources are
located in an Amazon Web Services Region, specify `CLOUD`. If the
source resources are located on an Outpost in your account, specify
`OUTPOST`.

If you specify `OUTPOST`, Amazon Data Lifecycle Manager backs up all
resources of the specified type with matching target tags across all
of the Outposts in your account.
@return [Array<String>]

@!attribute [rw] target_tags

The single tag that identifies targeted resources for this policy.

This parameter is required for snapshot and AMI policies only. If
you are creating an event-based policy, omit this parameter.
@return [Array<Types::Tag>]

@!attribute [rw] schedules

The schedules of policy-defined actions for snapshot and AMI
lifecycle policies. A policy can have up to four schedules—one
mandatory schedule and up to three optional schedules.

This parameter is required for snapshot and AMI policies only. If
you are creating an event-based policy, omit this parameter.
@return [Array<Types::Schedule>]

@!attribute [rw] parameters

A set of optional parameters for snapshot and AMI lifecycle
policies.

This parameter is required for snapshot and AMI policies only. If
you are creating an event-based policy, omit this parameter.
@return [Types::Parameters]

@!attribute [rw] event_source

The event that triggers the event-based policy.

This parameter is required for event-based policies only. If you are
creating a snapshot or AMI policy, omit this parameter.
@return [Types::EventSource]

@!attribute [rw] actions

The actions to be performed when the event-based policy is
triggered. You can specify only one action per policy.

This parameter is required for event-based policies only. If you are
creating a snapshot or AMI policy, omit this parameter.
@return [Array<Types::Action>]

@see docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/PolicyDetails AWS API Documentation

Constants

SENSITIVE