You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::Backup::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for AWS Backup. To construct a client, you need to configure a :region and :credentials.

backup = Aws::Backup::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::Backup::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::Backup::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#create_backup_plan(options = {}) ⇒ Types::CreateBackupPlanOutput

Creates a backup plan using a backup plan name and backup rules. A backup plan is a document that contains information that AWS Backup uses to schedule tasks that create recovery points for resources.

If you call CreateBackupPlan with a plan that already exists, an AlreadyExistsException is returned.

Examples:

Request syntax with placeholder values


resp = client.create_backup_plan({
  backup_plan: { # required
    backup_plan_name: "BackupPlanName", # required
    rules: [ # required
      {
        rule_name: "BackupRuleName", # required
        target_backup_vault_name: "BackupVaultName", # required
        schedule_expression: "CronExpression",
        start_window_minutes: 1,
        completion_window_minutes: 1,
        lifecycle: {
          move_to_cold_storage_after_days: 1,
          delete_after_days: 1,
        },
        recovery_point_tags: {
          "TagKey" => "TagValue",
        },
        copy_actions: [
          {
            lifecycle: {
              move_to_cold_storage_after_days: 1,
              delete_after_days: 1,
            },
            destination_backup_vault_arn: "ARN", # required
          },
        ],
      },
    ],
    advanced_backup_settings: [
      {
        resource_type: "ResourceType",
        backup_options: {
          "BackupOptionKey" => "BackupOptionValue",
        },
      },
    ],
  },
  backup_plan_tags: {
    "TagKey" => "TagValue",
  },
  creator_request_id: "string",
})

Response structure


resp.backup_plan_id #=> String
resp.backup_plan_arn #=> String
resp.creation_date #=> Time
resp.version_id #=> String
resp.advanced_backup_settings #=> Array
resp.advanced_backup_settings[0].resource_type #=> String
resp.advanced_backup_settings[0].backup_options #=> Hash
resp.advanced_backup_settings[0].backup_options["BackupOptionKey"] #=> String

Options Hash (options):

  • :backup_plan (required, Types::BackupPlanInput)

    Specifies the body of a backup plan. Includes a BackupPlanName and one or more sets of Rules.

  • :backup_plan_tags (Hash<String,String>)

    To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair. The specified tags are assigned to all backups created with this plan.

  • :creator_request_id (String)

    Identifies the request and allows failed requests to be retried without the risk of running the operation twice. If the request includes a CreatorRequestId that matches an existing backup plan, that plan is returned. This parameter is optional.

Returns:

See Also:

#create_backup_selection(options = {}) ⇒ Types::CreateBackupSelectionOutput

Creates a JSON document that specifies a set of resources to assign to a backup plan. Resources can be included by specifying patterns for a ListOfTags and selected Resources.

For example, consider the following patterns:

  • Resources: "arn:aws:ec2:region:account-id:volume/volume-id"

  • ConditionKey:"department"

    ConditionValue:"finance"

    ConditionType:"StringEquals"

  • ConditionKey:"importance"

    ConditionValue:"critical"

    ConditionType:"StringEquals"

Using these patterns would back up all Amazon Elastic Block Store (Amazon EBS) volumes that are tagged as "department=finance", "importance=critical", in addition to an EBS volume with the specified volume ID.

Resources and conditions are additive in that all resources that match the pattern are selected. This shouldn't be confused with a logical AND, where all conditions must match. The matching patterns are logically put together using the OR operator. In other words, all patterns that match are selected for backup.

Examples:

Request syntax with placeholder values


resp = client.create_backup_selection({
  backup_plan_id: "string", # required
  backup_selection: { # required
    selection_name: "BackupSelectionName", # required
    iam_role_arn: "IAMRoleArn", # required
    resources: ["ARN"],
    list_of_tags: [
      {
        condition_type: "STRINGEQUALS", # required, accepts STRINGEQUALS
        condition_key: "ConditionKey", # required
        condition_value: "ConditionValue", # required
      },
    ],
  },
  creator_request_id: "string",
})

Response structure


resp.selection_id #=> String
resp.backup_plan_id #=> String
resp.creation_date #=> Time

Options Hash (options):

  • :backup_plan_id (required, String)

    Uniquely identifies the backup plan to be associated with the selection of resources.

  • :backup_selection (required, Types::BackupSelection)

    Specifies the body of a request to assign a set of resources to a backup plan.

  • :creator_request_id (String)

    A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice.

Returns:

See Also:

#create_backup_vault(options = {}) ⇒ Types::CreateBackupVaultOutput

Creates a logical container where backups are stored. A CreateBackupVault request includes a name, optionally one or more resource tags, an encryption key, and a request ID.

Sensitive data, such as passport numbers, should not be included the name of a backup vault.

Examples:

Request syntax with placeholder values


resp = client.create_backup_vault({
  backup_vault_name: "BackupVaultName", # required
  backup_vault_tags: {
    "TagKey" => "TagValue",
  },
  encryption_key_arn: "ARN",
  creator_request_id: "string",
})

Response structure


resp.backup_vault_name #=> String
resp.backup_vault_arn #=> String
resp.creation_date #=> Time

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

  • :backup_vault_tags (Hash<String,String>)

    Metadata that you can assign to help organize the resources that you create. Each tag is a key-value pair.

  • :encryption_key_arn (String)

    The server-side encryption key that is used to protect your backups; for example, arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

  • :creator_request_id (String)

    A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice.

Returns:

See Also:

#delete_backup_plan(options = {}) ⇒ Types::DeleteBackupPlanOutput

Deletes a backup plan. A backup plan can only be deleted after all associated selections of resources have been deleted. Deleting a backup plan deletes the current version of a backup plan. Previous versions, if any, will still exist.

Examples:

Request syntax with placeholder values


resp = client.delete_backup_plan({
  backup_plan_id: "string", # required
})

Response structure


resp.backup_plan_id #=> String
resp.backup_plan_arn #=> String
resp.deletion_date #=> Time
resp.version_id #=> String

Options Hash (options):

  • :backup_plan_id (required, String)

    Uniquely identifies a backup plan.

Returns:

See Also:

#delete_backup_selection(options = {}) ⇒ Struct

Deletes the resource selection associated with a backup plan that is specified by the SelectionId.

Examples:

Request syntax with placeholder values


resp = client.delete_backup_selection({
  backup_plan_id: "string", # required
  selection_id: "string", # required
})

Options Hash (options):

  • :backup_plan_id (required, String)

    Uniquely identifies a backup plan.

  • :selection_id (required, String)

    Uniquely identifies the body of a request to assign a set of resources to a backup plan.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_backup_vault(options = {}) ⇒ Struct

Deletes the backup vault identified by its name. A vault can be deleted only if it is empty.

Examples:

Request syntax with placeholder values


resp = client.delete_backup_vault({
  backup_vault_name: "string", # required
})

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_backup_vault_access_policy(options = {}) ⇒ Struct

Deletes the policy document that manages permissions on a backup vault.

Examples:

Request syntax with placeholder values


resp = client.delete_backup_vault_access_policy({
  backup_vault_name: "BackupVaultName", # required
})

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_backup_vault_notifications(options = {}) ⇒ Struct

Deletes event notifications for the specified backup vault.

Examples:

Request syntax with placeholder values


resp = client.delete_backup_vault_notifications({
  backup_vault_name: "BackupVaultName", # required
})

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created. They consist of lowercase letters, numbers, and hyphens.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_recovery_point(options = {}) ⇒ Struct

Deletes the recovery point specified by a recovery point ID.

Examples:

Request syntax with placeholder values


resp = client.delete_recovery_point({
  backup_vault_name: "BackupVaultName", # required
  recovery_point_arn: "ARN", # required
})

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

  • :recovery_point_arn (required, String)

    An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#describe_backup_job(options = {}) ⇒ Types::DescribeBackupJobOutput

Returns backup job details for the specified BackupJobId.

Examples:

Request syntax with placeholder values


resp = client.describe_backup_job({
  backup_job_id: "string", # required
})

Response structure


resp. #=> String
resp.backup_job_id #=> String
resp.backup_vault_name #=> String
resp.backup_vault_arn #=> String
resp.recovery_point_arn #=> String
resp.resource_arn #=> String
resp.creation_date #=> Time
resp.completion_date #=> Time
resp.state #=> String, one of "CREATED", "PENDING", "RUNNING", "ABORTING", "ABORTED", "COMPLETED", "FAILED", "EXPIRED"
resp.status_message #=> String
resp.percent_done #=> String
resp.backup_size_in_bytes #=> Integer
resp.iam_role_arn #=> String
resp.created_by.backup_plan_id #=> String
resp.created_by.backup_plan_arn #=> String
resp.created_by.backup_plan_version #=> String
resp.created_by.backup_rule_id #=> String
resp.resource_type #=> String
resp.bytes_transferred #=> Integer
resp.expected_completion_date #=> Time
resp.start_by #=> Time
resp.backup_options #=> Hash
resp.backup_options["BackupOptionKey"] #=> String
resp.backup_type #=> String

Options Hash (options):

  • :backup_job_id (required, String)

    Uniquely identifies a request to AWS Backup to back up a resource.

Returns:

See Also:

#describe_backup_vault(options = {}) ⇒ Types::DescribeBackupVaultOutput

Returns metadata about a backup vault specified by its name.

Examples:

Request syntax with placeholder values


resp = client.describe_backup_vault({
  backup_vault_name: "string", # required
})

Response structure


resp.backup_vault_name #=> String
resp.backup_vault_arn #=> String
resp.encryption_key_arn #=> String
resp.creation_date #=> Time
resp.creator_request_id #=> String
resp.number_of_recovery_points #=> Integer

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

Returns:

See Also:

#describe_copy_job(options = {}) ⇒ Types::DescribeCopyJobOutput

Returns metadata associated with creating a copy of a resource.

Examples:

Request syntax with placeholder values


resp = client.describe_copy_job({
  copy_job_id: "string", # required
})

Response structure


resp.copy_job. #=> String
resp.copy_job.copy_job_id #=> String
resp.copy_job.source_backup_vault_arn #=> String
resp.copy_job.source_recovery_point_arn #=> String
resp.copy_job.destination_backup_vault_arn #=> String
resp.copy_job.destination_recovery_point_arn #=> String
resp.copy_job.resource_arn #=> String
resp.copy_job.creation_date #=> Time
resp.copy_job.completion_date #=> Time
resp.copy_job.state #=> String, one of "CREATED", "RUNNING", "COMPLETED", "FAILED"
resp.copy_job.status_message #=> String
resp.copy_job.backup_size_in_bytes #=> Integer
resp.copy_job.iam_role_arn #=> String
resp.copy_job.created_by.backup_plan_id #=> String
resp.copy_job.created_by.backup_plan_arn #=> String
resp.copy_job.created_by.backup_plan_version #=> String
resp.copy_job.created_by.backup_rule_id #=> String
resp.copy_job.resource_type #=> String

Options Hash (options):

  • :copy_job_id (required, String)

    Uniquely identifies a copy job.

Returns:

See Also:

#describe_global_settings(options = {}) ⇒ Types::DescribeGlobalSettingsOutput

The current feature settings for the AWS Account.

Examples:

Request syntax with placeholder values


resp = client.describe_global_settings()

Response structure


resp.global_settings #=> Hash
resp.global_settings["GlobalSettingsName"] #=> String
resp.last_update_time #=> Time

Returns:

See Also:

#describe_protected_resource(options = {}) ⇒ Types::DescribeProtectedResourceOutput

Returns information about a saved resource, including the last time it was backed up, its Amazon Resource Name (ARN), and the AWS service type of the saved resource.

Examples:

Request syntax with placeholder values


resp = client.describe_protected_resource({
  resource_arn: "ARN", # required
})

Response structure


resp.resource_arn #=> String
resp.resource_type #=> String
resp.last_backup_time #=> Time

Options Hash (options):

  • :resource_arn (required, String)

    An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.

Returns:

See Also:

#describe_recovery_point(options = {}) ⇒ Types::DescribeRecoveryPointOutput

Returns metadata associated with a recovery point, including ID, status, encryption, and lifecycle.

Examples:

Request syntax with placeholder values


resp = client.describe_recovery_point({
  backup_vault_name: "BackupVaultName", # required
  recovery_point_arn: "ARN", # required
})

Response structure


resp.recovery_point_arn #=> String
resp.backup_vault_name #=> String
resp.backup_vault_arn #=> String
resp.source_backup_vault_arn #=> String
resp.resource_arn #=> String
resp.resource_type #=> String
resp.created_by.backup_plan_id #=> String
resp.created_by.backup_plan_arn #=> String
resp.created_by.backup_plan_version #=> String
resp.created_by.backup_rule_id #=> String
resp.iam_role_arn #=> String
resp.status #=> String, one of "COMPLETED", "PARTIAL", "DELETING", "EXPIRED"
resp.creation_date #=> Time
resp.completion_date #=> Time
resp.backup_size_in_bytes #=> Integer
resp.calculated_lifecycle.move_to_cold_storage_at #=> Time
resp.calculated_lifecycle.delete_at #=> Time
resp.lifecycle.move_to_cold_storage_after_days #=> Integer
resp.lifecycle.delete_after_days #=> Integer
resp.encryption_key_arn #=> String
resp.is_encrypted #=> true/false
resp.storage_class #=> String, one of "WARM", "COLD", "DELETED"
resp.last_restore_time #=> Time

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

  • :recovery_point_arn (required, String)

    An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

Returns:

See Also:

#describe_region_settings(options = {}) ⇒ Types::DescribeRegionSettingsOutput

Returns the current service opt-in settings for the Region. If service-opt-in is enabled for a service, AWS Backup tries to protect that service's resources in this Region, when the resource is included in an on-demand backup or scheduled backup plan. Otherwise, AWS Backup does not try to protect that service's resources in this Region, AWS Backup does not try to protect that service's resources in this Region.

Examples:

Request syntax with placeholder values


resp = client.describe_region_settings()

Response structure


resp.resource_type_opt_in_preference #=> Hash
resp.resource_type_opt_in_preference["ResourceType"] #=> true/false

Returns:

See Also:

#describe_restore_job(options = {}) ⇒ Types::DescribeRestoreJobOutput

Returns metadata associated with a restore job that is specified by a job ID.

Examples:

Request syntax with placeholder values


resp = client.describe_restore_job({
  restore_job_id: "RestoreJobId", # required
})

Response structure


resp. #=> String
resp.restore_job_id #=> String
resp.recovery_point_arn #=> String
resp.creation_date #=> Time
resp.completion_date #=> Time
resp.status #=> String, one of "PENDING", "RUNNING", "COMPLETED", "ABORTED", "FAILED"
resp.status_message #=> String
resp.percent_done #=> String
resp.backup_size_in_bytes #=> Integer
resp.iam_role_arn #=> String
resp.expected_completion_time_minutes #=> Integer
resp.created_resource_arn #=> String
resp.resource_type #=> String

Options Hash (options):

  • :restore_job_id (required, String)

    Uniquely identifies the job that restores a recovery point.

Returns:

See Also:

#export_backup_plan_template(options = {}) ⇒ Types::ExportBackupPlanTemplateOutput

Returns the backup plan that is specified by the plan ID as a backup template.

Examples:

Request syntax with placeholder values


resp = client.export_backup_plan_template({
  backup_plan_id: "string", # required
})

Response structure


resp.backup_plan_template_json #=> String

Options Hash (options):

  • :backup_plan_id (required, String)

    Uniquely identifies a backup plan.

Returns:

See Also:

#get_backup_plan(options = {}) ⇒ Types::GetBackupPlanOutput

Returns BackupPlan details for the specified BackupPlanId. Returns the body of a backup plan in JSON format, in addition to plan metadata.

Examples:

Request syntax with placeholder values


resp = client.get_backup_plan({
  backup_plan_id: "string", # required
  version_id: "string",
})

Response structure


resp.backup_plan.backup_plan_name #=> String
resp.backup_plan.rules #=> Array
resp.backup_plan.rules[0].rule_name #=> String
resp.backup_plan.rules[0].target_backup_vault_name #=> String
resp.backup_plan.rules[0].schedule_expression #=> String
resp.backup_plan.rules[0].start_window_minutes #=> Integer
resp.backup_plan.rules[0].completion_window_minutes #=> Integer
resp.backup_plan.rules[0].lifecycle.move_to_cold_storage_after_days #=> Integer
resp.backup_plan.rules[0].lifecycle.delete_after_days #=> Integer
resp.backup_plan.rules[0].recovery_point_tags #=> Hash
resp.backup_plan.rules[0].recovery_point_tags["TagKey"] #=> String
resp.backup_plan.rules[0].rule_id #=> String
resp.backup_plan.rules[0].copy_actions #=> Array
resp.backup_plan.rules[0].copy_actions[0].lifecycle.move_to_cold_storage_after_days #=> Integer
resp.backup_plan.rules[0].copy_actions[0].lifecycle.delete_after_days #=> Integer
resp.backup_plan.rules[0].copy_actions[0].destination_backup_vault_arn #=> String
resp.backup_plan.advanced_backup_settings #=> Array
resp.backup_plan.advanced_backup_settings[0].resource_type #=> String
resp.backup_plan.advanced_backup_settings[0].backup_options #=> Hash
resp.backup_plan.advanced_backup_settings[0].backup_options["BackupOptionKey"] #=> String
resp.backup_plan_id #=> String
resp.backup_plan_arn #=> String
resp.version_id #=> String
resp.creator_request_id #=> String
resp.creation_date #=> Time
resp.deletion_date #=> Time
resp.last_execution_date #=> Time
resp.advanced_backup_settings #=> Array
resp.advanced_backup_settings[0].resource_type #=> String
resp.advanced_backup_settings[0].backup_options #=> Hash
resp.advanced_backup_settings[0].backup_options["BackupOptionKey"] #=> String

Options Hash (options):

  • :backup_plan_id (required, String)

    Uniquely identifies a backup plan.

  • :version_id (String)

    Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version IDs cannot be edited.

Returns:

See Also:

#get_backup_plan_from_json(options = {}) ⇒ Types::GetBackupPlanFromJSONOutput

Returns a valid JSON document specifying a backup plan or an error.

Examples:

Request syntax with placeholder values


resp = client.get_backup_plan_from_json({
  backup_plan_template_json: "string", # required
})

Response structure


resp.backup_plan.backup_plan_name #=> String
resp.backup_plan.rules #=> Array
resp.backup_plan.rules[0].rule_name #=> String
resp.backup_plan.rules[0].target_backup_vault_name #=> String
resp.backup_plan.rules[0].schedule_expression #=> String
resp.backup_plan.rules[0].start_window_minutes #=> Integer
resp.backup_plan.rules[0].completion_window_minutes #=> Integer
resp.backup_plan.rules[0].lifecycle.move_to_cold_storage_after_days #=> Integer
resp.backup_plan.rules[0].lifecycle.delete_after_days #=> Integer
resp.backup_plan.rules[0].recovery_point_tags #=> Hash
resp.backup_plan.rules[0].recovery_point_tags["TagKey"] #=> String
resp.backup_plan.rules[0].rule_id #=> String
resp.backup_plan.rules[0].copy_actions #=> Array
resp.backup_plan.rules[0].copy_actions[0].lifecycle.move_to_cold_storage_after_days #=> Integer
resp.backup_plan.rules[0].copy_actions[0].lifecycle.delete_after_days #=> Integer
resp.backup_plan.rules[0].copy_actions[0].destination_backup_vault_arn #=> String
resp.backup_plan.advanced_backup_settings #=> Array
resp.backup_plan.advanced_backup_settings[0].resource_type #=> String
resp.backup_plan.advanced_backup_settings[0].backup_options #=> Hash
resp.backup_plan.advanced_backup_settings[0].backup_options["BackupOptionKey"] #=> String

Options Hash (options):

  • :backup_plan_template_json (required, String)

    A customer-supplied backup plan document in JSON format.

Returns:

See Also:

#get_backup_plan_from_template(options = {}) ⇒ Types::GetBackupPlanFromTemplateOutput

Returns the template specified by its templateId as a backup plan.

Examples:

Request syntax with placeholder values


resp = client.get_backup_plan_from_template({
  backup_plan_template_id: "string", # required
})

Response structure


resp.backup_plan_document.backup_plan_name #=> String
resp.backup_plan_document.rules #=> Array
resp.backup_plan_document.rules[0].rule_name #=> String
resp.backup_plan_document.rules[0].target_backup_vault_name #=> String
resp.backup_plan_document.rules[0].schedule_expression #=> String
resp.backup_plan_document.rules[0].start_window_minutes #=> Integer
resp.backup_plan_document.rules[0].completion_window_minutes #=> Integer
resp.backup_plan_document.rules[0].lifecycle.move_to_cold_storage_after_days #=> Integer
resp.backup_plan_document.rules[0].lifecycle.delete_after_days #=> Integer
resp.backup_plan_document.rules[0].recovery_point_tags #=> Hash
resp.backup_plan_document.rules[0].recovery_point_tags["TagKey"] #=> String
resp.backup_plan_document.rules[0].rule_id #=> String
resp.backup_plan_document.rules[0].copy_actions #=> Array
resp.backup_plan_document.rules[0].copy_actions[0].lifecycle.move_to_cold_storage_after_days #=> Integer
resp.backup_plan_document.rules[0].copy_actions[0].lifecycle.delete_after_days #=> Integer
resp.backup_plan_document.rules[0].copy_actions[0].destination_backup_vault_arn #=> String
resp.backup_plan_document.advanced_backup_settings #=> Array
resp.backup_plan_document.advanced_backup_settings[0].resource_type #=> String
resp.backup_plan_document.advanced_backup_settings[0].backup_options #=> Hash
resp.backup_plan_document.advanced_backup_settings[0].backup_options["BackupOptionKey"] #=> String

Options Hash (options):

  • :backup_plan_template_id (required, String)

    Uniquely identifies a stored backup plan template.

Returns:

See Also:

#get_backup_selection(options = {}) ⇒ Types::GetBackupSelectionOutput

Returns selection metadata and a document in JSON format that specifies a list of resources that are associated with a backup plan.

Examples:

Request syntax with placeholder values


resp = client.get_backup_selection({
  backup_plan_id: "string", # required
  selection_id: "string", # required
})

Response structure


resp.backup_selection.selection_name #=> String
resp.backup_selection.iam_role_arn #=> String
resp.backup_selection.resources #=> Array
resp.backup_selection.resources[0] #=> String
resp.backup_selection.list_of_tags #=> Array
resp.backup_selection.list_of_tags[0].condition_type #=> String, one of "STRINGEQUALS"
resp.backup_selection.list_of_tags[0].condition_key #=> String
resp.backup_selection.list_of_tags[0].condition_value #=> String
resp.selection_id #=> String
resp.backup_plan_id #=> String
resp.creation_date #=> Time
resp.creator_request_id #=> String

Options Hash (options):

  • :backup_plan_id (required, String)

    Uniquely identifies a backup plan.

  • :selection_id (required, String)

    Uniquely identifies the body of a request to assign a set of resources to a backup plan.

Returns:

See Also:

#get_backup_vault_access_policy(options = {}) ⇒ Types::GetBackupVaultAccessPolicyOutput

Returns the access policy document that is associated with the named backup vault.

Examples:

Request syntax with placeholder values


resp = client.get_backup_vault_access_policy({
  backup_vault_name: "BackupVaultName", # required
})

Response structure


resp.backup_vault_name #=> String
resp.backup_vault_arn #=> String
resp.policy #=> String

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

Returns:

See Also:

#get_backup_vault_notifications(options = {}) ⇒ Types::GetBackupVaultNotificationsOutput

Returns event notifications for the specified backup vault.

Examples:

Request syntax with placeholder values


resp = client.get_backup_vault_notifications({
  backup_vault_name: "BackupVaultName", # required
})

Response structure


resp.backup_vault_name #=> String
resp.backup_vault_arn #=> String
resp.sns_topic_arn #=> String
resp.backup_vault_events #=> Array
resp.backup_vault_events[0] #=> String, one of "BACKUP_JOB_STARTED", "BACKUP_JOB_COMPLETED", "BACKUP_JOB_SUCCESSFUL", "BACKUP_JOB_FAILED", "BACKUP_JOB_EXPIRED", "RESTORE_JOB_STARTED", "RESTORE_JOB_COMPLETED", "RESTORE_JOB_SUCCESSFUL", "RESTORE_JOB_FAILED", "COPY_JOB_STARTED", "COPY_JOB_SUCCESSFUL", "COPY_JOB_FAILED", "RECOVERY_POINT_MODIFIED", "BACKUP_PLAN_CREATED", "BACKUP_PLAN_MODIFIED"

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

Returns:

See Also:

#get_recovery_point_restore_metadata(options = {}) ⇒ Types::GetRecoveryPointRestoreMetadataOutput

Returns a set of metadata key-value pairs that were used to create the backup.

Examples:

Request syntax with placeholder values


resp = client.({
  backup_vault_name: "BackupVaultName", # required
  recovery_point_arn: "ARN", # required
})

Response structure


resp.backup_vault_arn #=> String
resp.recovery_point_arn #=> String
resp. #=> Hash
resp.["MetadataKey"] #=> String

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

  • :recovery_point_arn (required, String)

    An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

Returns:

See Also:

#get_supported_resource_types(options = {}) ⇒ Types::GetSupportedResourceTypesOutput

Returns the AWS resource types supported by AWS Backup.

Examples:

Request syntax with placeholder values


resp = client.get_supported_resource_types()

Response structure


resp.resource_types #=> Array
resp.resource_types[0] #=> String

Returns:

See Also:

#list_backup_jobs(options = {}) ⇒ Types::ListBackupJobsOutput

Returns a list of existing backup jobs for an authenticated account.

Examples:

Request syntax with placeholder values


resp = client.list_backup_jobs({
  next_token: "string",
  max_results: 1,
  by_resource_arn: "ARN",
  by_state: "CREATED", # accepts CREATED, PENDING, RUNNING, ABORTING, ABORTED, COMPLETED, FAILED, EXPIRED
  by_backup_vault_name: "BackupVaultName",
  by_created_before: Time.now,
  by_created_after: Time.now,
  by_resource_type: "ResourceType",
  by_account_id: "AccountId",
})

Response structure


resp.backup_jobs #=> Array
resp.backup_jobs[0]. #=> String
resp.backup_jobs[0].backup_job_id #=> String
resp.backup_jobs[0].backup_vault_name #=> String
resp.backup_jobs[0].backup_vault_arn #=> String
resp.backup_jobs[0].recovery_point_arn #=> String
resp.backup_jobs[0].resource_arn #=> String
resp.backup_jobs[0].creation_date #=> Time
resp.backup_jobs[0].completion_date #=> Time
resp.backup_jobs[0].state #=> String, one of "CREATED", "PENDING", "RUNNING", "ABORTING", "ABORTED", "COMPLETED", "FAILED", "EXPIRED"
resp.backup_jobs[0].status_message #=> String
resp.backup_jobs[0].percent_done #=> String
resp.backup_jobs[0].backup_size_in_bytes #=> Integer
resp.backup_jobs[0].iam_role_arn #=> String
resp.backup_jobs[0].created_by.backup_plan_id #=> String
resp.backup_jobs[0].created_by.backup_plan_arn #=> String
resp.backup_jobs[0].created_by.backup_plan_version #=> String
resp.backup_jobs[0].created_by.backup_rule_id #=> String
resp.backup_jobs[0].expected_completion_date #=> Time
resp.backup_jobs[0].start_by #=> Time
resp.backup_jobs[0].resource_type #=> String
resp.backup_jobs[0].bytes_transferred #=> Integer
resp.backup_jobs[0].backup_options #=> Hash
resp.backup_jobs[0].backup_options["BackupOptionKey"] #=> String
resp.backup_jobs[0].backup_type #=> String
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

  • :by_resource_arn (String)

    Returns only backup jobs that match the specified resource Amazon Resource Name (ARN).

  • :by_state (String)

    Returns only backup jobs that are in the specified state.

  • :by_backup_vault_name (String)

    Returns only backup jobs that will be stored in the specified backup vault. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

  • :by_created_before (Time)

    Returns only backup jobs that were created before the specified date.

  • :by_created_after (Time)

    Returns only backup jobs that were created after the specified date.

  • :by_resource_type (String)

    Returns only backup jobs for the specified resources:

    • DynamoDB for Amazon DynamoDB

    • EBS for Amazon Elastic Block Store

    • EC2 for Amazon Elastic Compute Cloud

    • EFS for Amazon Elastic File System

    • RDS for Amazon Relational Database Service

    • Storage Gateway for AWS Storage Gateway

  • :by_account_id (String)

    The account ID to list the jobs from. Returns only backup jobs associated with the specified account ID.

Returns:

See Also:

#list_backup_plan_templates(options = {}) ⇒ Types::ListBackupPlanTemplatesOutput

Returns metadata of your saved backup plan templates, including the template ID, name, and the creation and deletion dates.

Examples:

Request syntax with placeholder values


resp = client.list_backup_plan_templates({
  next_token: "string",
  max_results: 1,
})

Response structure


resp.next_token #=> String
resp.backup_plan_templates_list #=> Array
resp.backup_plan_templates_list[0].backup_plan_template_id #=> String
resp.backup_plan_templates_list[0].backup_plan_template_name #=> String

Options Hash (options):

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

Returns:

See Also:

#list_backup_plan_versions(options = {}) ⇒ Types::ListBackupPlanVersionsOutput

Returns version metadata of your backup plans, including Amazon Resource Names (ARNs), backup plan IDs, creation and deletion dates, plan names, and version IDs.

Examples:

Request syntax with placeholder values


resp = client.list_backup_plan_versions({
  backup_plan_id: "string", # required
  next_token: "string",
  max_results: 1,
})

Response structure


resp.next_token #=> String
resp.backup_plan_versions_list #=> Array
resp.backup_plan_versions_list[0].backup_plan_arn #=> String
resp.backup_plan_versions_list[0].backup_plan_id #=> String
resp.backup_plan_versions_list[0].creation_date #=> Time
resp.backup_plan_versions_list[0].deletion_date #=> Time
resp.backup_plan_versions_list[0].version_id #=> String
resp.backup_plan_versions_list[0].backup_plan_name #=> String
resp.backup_plan_versions_list[0].creator_request_id #=> String
resp.backup_plan_versions_list[0].last_execution_date #=> Time
resp.backup_plan_versions_list[0].advanced_backup_settings #=> Array
resp.backup_plan_versions_list[0].advanced_backup_settings[0].resource_type #=> String
resp.backup_plan_versions_list[0].advanced_backup_settings[0].backup_options #=> Hash
resp.backup_plan_versions_list[0].advanced_backup_settings[0].backup_options["BackupOptionKey"] #=> String

Options Hash (options):

  • :backup_plan_id (required, String)

    Uniquely identifies a backup plan.

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

Returns:

See Also:

#list_backup_plans(options = {}) ⇒ Types::ListBackupPlansOutput

Returns a list of existing backup plans for an authenticated account. The list is populated only if the advanced option is set for the backup plan. The list contains information such as Amazon Resource Names (ARNs), plan IDs, creation and deletion dates, version IDs, plan names, and creator request IDs.

Examples:

Request syntax with placeholder values


resp = client.list_backup_plans({
  next_token: "string",
  max_results: 1,
  include_deleted: false,
})

Response structure


resp.next_token #=> String
resp.backup_plans_list #=> Array
resp.backup_plans_list[0].backup_plan_arn #=> String
resp.backup_plans_list[0].backup_plan_id #=> String
resp.backup_plans_list[0].creation_date #=> Time
resp.backup_plans_list[0].deletion_date #=> Time
resp.backup_plans_list[0].version_id #=> String
resp.backup_plans_list[0].backup_plan_name #=> String
resp.backup_plans_list[0].creator_request_id #=> String
resp.backup_plans_list[0].last_execution_date #=> Time
resp.backup_plans_list[0].advanced_backup_settings #=> Array
resp.backup_plans_list[0].advanced_backup_settings[0].resource_type #=> String
resp.backup_plans_list[0].advanced_backup_settings[0].backup_options #=> Hash
resp.backup_plans_list[0].advanced_backup_settings[0].backup_options["BackupOptionKey"] #=> String

Options Hash (options):

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

  • :include_deleted (Boolean)

    A Boolean value with a default value of FALSE that returns deleted backup plans when set to TRUE.

Returns:

See Also:

#list_backup_selections(options = {}) ⇒ Types::ListBackupSelectionsOutput

Returns an array containing metadata of the resources associated with the target backup plan.

Examples:

Request syntax with placeholder values


resp = client.list_backup_selections({
  backup_plan_id: "string", # required
  next_token: "string",
  max_results: 1,
})

Response structure


resp.next_token #=> String
resp.backup_selections_list #=> Array
resp.backup_selections_list[0].selection_id #=> String
resp.backup_selections_list[0].selection_name #=> String
resp.backup_selections_list[0].backup_plan_id #=> String
resp.backup_selections_list[0].creation_date #=> Time
resp.backup_selections_list[0].creator_request_id #=> String
resp.backup_selections_list[0].iam_role_arn #=> String

Options Hash (options):

  • :backup_plan_id (required, String)

    Uniquely identifies a backup plan.

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

Returns:

See Also:

#list_backup_vaults(options = {}) ⇒ Types::ListBackupVaultsOutput

Returns a list of recovery point storage containers along with information about them.

Examples:

Request syntax with placeholder values


resp = client.list_backup_vaults({
  next_token: "string",
  max_results: 1,
})

Response structure


resp.backup_vault_list #=> Array
resp.backup_vault_list[0].backup_vault_name #=> String
resp.backup_vault_list[0].backup_vault_arn #=> String
resp.backup_vault_list[0].creation_date #=> Time
resp.backup_vault_list[0].encryption_key_arn #=> String
resp.backup_vault_list[0].creator_request_id #=> String
resp.backup_vault_list[0].number_of_recovery_points #=> Integer
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

Returns:

See Also:

#list_copy_jobs(options = {}) ⇒ Types::ListCopyJobsOutput

Returns metadata about your copy jobs.

Examples:

Request syntax with placeholder values


resp = client.list_copy_jobs({
  next_token: "string",
  max_results: 1,
  by_resource_arn: "ARN",
  by_state: "CREATED", # accepts CREATED, RUNNING, COMPLETED, FAILED
  by_created_before: Time.now,
  by_created_after: Time.now,
  by_resource_type: "ResourceType",
  by_destination_vault_arn: "string",
  by_account_id: "AccountId",
})

Response structure


resp.copy_jobs #=> Array
resp.copy_jobs[0]. #=> String
resp.copy_jobs[0].copy_job_id #=> String
resp.copy_jobs[0].source_backup_vault_arn #=> String
resp.copy_jobs[0].source_recovery_point_arn #=> String
resp.copy_jobs[0].destination_backup_vault_arn #=> String
resp.copy_jobs[0].destination_recovery_point_arn #=> String
resp.copy_jobs[0].resource_arn #=> String
resp.copy_jobs[0].creation_date #=> Time
resp.copy_jobs[0].completion_date #=> Time
resp.copy_jobs[0].state #=> String, one of "CREATED", "RUNNING", "COMPLETED", "FAILED"
resp.copy_jobs[0].status_message #=> String
resp.copy_jobs[0].backup_size_in_bytes #=> Integer
resp.copy_jobs[0].iam_role_arn #=> String
resp.copy_jobs[0].created_by.backup_plan_id #=> String
resp.copy_jobs[0].created_by.backup_plan_arn #=> String
resp.copy_jobs[0].created_by.backup_plan_version #=> String
resp.copy_jobs[0].created_by.backup_rule_id #=> String
resp.copy_jobs[0].resource_type #=> String
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

  • :by_resource_arn (String)

    Returns only copy jobs that match the specified resource Amazon Resource Name (ARN).

  • :by_state (String)

    Returns only copy jobs that are in the specified state.

  • :by_created_before (Time)

    Returns only copy jobs that were created before the specified date.

  • :by_created_after (Time)

    Returns only copy jobs that were created after the specified date.

  • :by_resource_type (String)

    Returns only backup jobs for the specified resources:

    • DynamoDB for Amazon DynamoDB

    • EBS for Amazon Elastic Block Store

    • EC2 for Amazon Elastic Compute Cloud

    • EFS for Amazon Elastic File System

    • RDS for Amazon Relational Database Service

    • Storage Gateway for AWS Storage Gateway

  • :by_destination_vault_arn (String)

    An Amazon Resource Name (ARN) that uniquely identifies a source backup vault to copy from; for example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.

  • :by_account_id (String)

    The account ID to list the jobs from. Returns only copy jobs associated with the specified account ID.

Returns:

See Also:

#list_protected_resources(options = {}) ⇒ Types::ListProtectedResourcesOutput

Returns an array of resources successfully backed up by AWS Backup, including the time the resource was saved, an Amazon Resource Name (ARN) of the resource, and a resource type.

Examples:

Request syntax with placeholder values


resp = client.list_protected_resources({
  next_token: "string",
  max_results: 1,
})

Response structure


resp.results #=> Array
resp.results[0].resource_arn #=> String
resp.results[0].resource_type #=> String
resp.results[0].last_backup_time #=> Time
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

Returns:

See Also:

#list_recovery_points_by_backup_vault(options = {}) ⇒ Types::ListRecoveryPointsByBackupVaultOutput

Returns detailed information about the recovery points stored in a backup vault.

Examples:

Request syntax with placeholder values


resp = client.list_recovery_points_by_backup_vault({
  backup_vault_name: "BackupVaultName", # required
  next_token: "string",
  max_results: 1,
  by_resource_arn: "ARN",
  by_resource_type: "ResourceType",
  by_backup_plan_id: "string",
  by_created_before: Time.now,
  by_created_after: Time.now,
})

Response structure


resp.next_token #=> String
resp.recovery_points #=> Array
resp.recovery_points[0].recovery_point_arn #=> String
resp.recovery_points[0].backup_vault_name #=> String
resp.recovery_points[0].backup_vault_arn #=> String
resp.recovery_points[0].source_backup_vault_arn #=> String
resp.recovery_points[0].resource_arn #=> String
resp.recovery_points[0].resource_type #=> String
resp.recovery_points[0].created_by.backup_plan_id #=> String
resp.recovery_points[0].created_by.backup_plan_arn #=> String
resp.recovery_points[0].created_by.backup_plan_version #=> String
resp.recovery_points[0].created_by.backup_rule_id #=> String
resp.recovery_points[0].iam_role_arn #=> String
resp.recovery_points[0].status #=> String, one of "COMPLETED", "PARTIAL", "DELETING", "EXPIRED"
resp.recovery_points[0].creation_date #=> Time
resp.recovery_points[0].completion_date #=> Time
resp.recovery_points[0].backup_size_in_bytes #=> Integer
resp.recovery_points[0].calculated_lifecycle.move_to_cold_storage_at #=> Time
resp.recovery_points[0].calculated_lifecycle.delete_at #=> Time
resp.recovery_points[0].lifecycle.move_to_cold_storage_after_days #=> Integer
resp.recovery_points[0].lifecycle.delete_after_days #=> Integer
resp.recovery_points[0].encryption_key_arn #=> String
resp.recovery_points[0].is_encrypted #=> true/false
resp.recovery_points[0].last_restore_time #=> Time

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

  • :by_resource_arn (String)

    Returns only recovery points that match the specified resource Amazon Resource Name (ARN).

  • :by_resource_type (String)

    Returns only recovery points that match the specified resource type.

  • :by_backup_plan_id (String)

    Returns only recovery points that match the specified backup plan ID.

  • :by_created_before (Time)

    Returns only recovery points that were created before the specified timestamp.

  • :by_created_after (Time)

    Returns only recovery points that were created after the specified timestamp.

Returns:

See Also:

#list_recovery_points_by_resource(options = {}) ⇒ Types::ListRecoveryPointsByResourceOutput

Returns detailed information about recovery points of the type specified by a resource Amazon Resource Name (ARN).

Examples:

Request syntax with placeholder values


resp = client.list_recovery_points_by_resource({
  resource_arn: "ARN", # required
  next_token: "string",
  max_results: 1,
})

Response structure


resp.next_token #=> String
resp.recovery_points #=> Array
resp.recovery_points[0].recovery_point_arn #=> String
resp.recovery_points[0].creation_date #=> Time
resp.recovery_points[0].status #=> String, one of "COMPLETED", "PARTIAL", "DELETING", "EXPIRED"
resp.recovery_points[0].encryption_key_arn #=> String
resp.recovery_points[0].backup_size_bytes #=> Integer
resp.recovery_points[0].backup_vault_name #=> String

Options Hash (options):

  • :resource_arn (required, String)

    An ARN that uniquely identifies a resource. The format of the ARN depends on the resource type.

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

Returns:

See Also:

#list_restore_jobs(options = {}) ⇒ Types::ListRestoreJobsOutput

Returns a list of jobs that AWS Backup initiated to restore a saved resource, including metadata about the recovery process.

Examples:

Request syntax with placeholder values


resp = client.list_restore_jobs({
  next_token: "string",
  max_results: 1,
  by_account_id: "AccountId",
  by_created_before: Time.now,
  by_created_after: Time.now,
  by_status: "PENDING", # accepts PENDING, RUNNING, COMPLETED, ABORTED, FAILED
})

Response structure


resp.restore_jobs #=> Array
resp.restore_jobs[0]. #=> String
resp.restore_jobs[0].restore_job_id #=> String
resp.restore_jobs[0].recovery_point_arn #=> String
resp.restore_jobs[0].creation_date #=> Time
resp.restore_jobs[0].completion_date #=> Time
resp.restore_jobs[0].status #=> String, one of "PENDING", "RUNNING", "COMPLETED", "ABORTED", "FAILED"
resp.restore_jobs[0].status_message #=> String
resp.restore_jobs[0].percent_done #=> String
resp.restore_jobs[0].backup_size_in_bytes #=> Integer
resp.restore_jobs[0].iam_role_arn #=> String
resp.restore_jobs[0].expected_completion_time_minutes #=> Integer
resp.restore_jobs[0].created_resource_arn #=> String
resp.restore_jobs[0].resource_type #=> String
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

  • :by_account_id (String)

    The account ID to list the jobs from. Returns only restore jobs associated with the specified account ID.

  • :by_created_before (Time)

    Returns only restore jobs that were created before the specified date.

  • :by_created_after (Time)

    Returns only restore jobs that were created after the specified date.

  • :by_status (String)

    Returns only restore jobs associated with the specified job status.

Returns:

See Also:

#list_tags(options = {}) ⇒ Types::ListTagsOutput

Returns a list of key-value pairs assigned to a target recovery point, backup plan, or backup vault.

ListTags are currently only supported with Amazon EFS backups.

Examples:

Request syntax with placeholder values


resp = client.list_tags({
  resource_arn: "ARN", # required
  next_token: "string",
  max_results: 1,
})

Response structure


resp.next_token #=> String
resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Options Hash (options):

  • :resource_arn (required, String)

    An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the type of resource. Valid targets for ListTags are recovery points, backup plans, and backup vaults.

  • :next_token (String)

    The next item following a partial list of returned items. For example, if a request is made to return maxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • :max_results (Integer)

    The maximum number of items to be returned.

Returns:

See Also:

#put_backup_vault_access_policy(options = {}) ⇒ Struct

Sets a resource-based policy that is used to manage access permissions on the target backup vault. Requires a backup vault name and an access policy document in JSON format.

Examples:

Request syntax with placeholder values


resp = client.put_backup_vault_access_policy({
  backup_vault_name: "BackupVaultName", # required
  policy: "IAMPolicy",
})

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

  • :policy (String)

    The backup vault access policy document in JSON format.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#put_backup_vault_notifications(options = {}) ⇒ Struct

Turns on notifications on a backup vault for the specified topic and events.

Examples:

Request syntax with placeholder values


resp = client.put_backup_vault_notifications({
  backup_vault_name: "BackupVaultName", # required
  sns_topic_arn: "ARN", # required
  backup_vault_events: ["BACKUP_JOB_STARTED"], # required, accepts BACKUP_JOB_STARTED, BACKUP_JOB_COMPLETED, BACKUP_JOB_SUCCESSFUL, BACKUP_JOB_FAILED, BACKUP_JOB_EXPIRED, RESTORE_JOB_STARTED, RESTORE_JOB_COMPLETED, RESTORE_JOB_SUCCESSFUL, RESTORE_JOB_FAILED, COPY_JOB_STARTED, COPY_JOB_SUCCESSFUL, COPY_JOB_FAILED, RECOVERY_POINT_MODIFIED, BACKUP_PLAN_CREATED, BACKUP_PLAN_MODIFIED
})

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

  • :sns_topic_arn (required, String)

    The Amazon Resource Name (ARN) that specifies the topic for a backup vault’s events; for example, arn:aws:sns:us-west-2:111122223333:MyVaultTopic.

  • :backup_vault_events (required, Array<String>)

    An array of events that indicate the status of jobs to back up resources to the backup vault.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#start_backup_job(options = {}) ⇒ Types::StartBackupJobOutput

Starts an on-demand backup job for the specified resource.

Examples:

Request syntax with placeholder values


resp = client.start_backup_job({
  backup_vault_name: "BackupVaultName", # required
  resource_arn: "ARN", # required
  iam_role_arn: "IAMRoleArn", # required
  idempotency_token: "string",
  start_window_minutes: 1,
  complete_window_minutes: 1,
  lifecycle: {
    move_to_cold_storage_after_days: 1,
    delete_after_days: 1,
  },
  recovery_point_tags: {
    "TagKey" => "TagValue",
  },
  backup_options: {
    "BackupOptionKey" => "BackupOptionValue",
  },
})

Response structure


resp.backup_job_id #=> String
resp.recovery_point_arn #=> String
resp.creation_date #=> Time

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

  • :resource_arn (required, String)

    An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type.

  • :iam_role_arn (required, String)

    Specifies the IAM role ARN used to create the target recovery point; for example, arn:aws:iam::123456789012:role/S3Access.

  • :idempotency_token (String)

    A customer chosen string that can be used to distinguish between calls to StartBackupJob.

  • :start_window_minutes (Integer)

    A value in minutes after a backup is scheduled before a job will be canceled if it doesn\'t start successfully. This value is optional.

  • :complete_window_minutes (Integer)

    A value in minutes after a backup job is successfully started before it must be completed or it will be canceled by AWS Backup. This value is optional.

  • :lifecycle (Types::Lifecycle)

    The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup will transition and expire backups automatically according to the lifecycle that you define.

    Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.

  • :recovery_point_tags (Hash<String,String>)

    To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair.

  • :backup_options (Hash<String,String>)

    Specifies the backup option for a selected resource. This option is only available for Windows VSS backup jobs.

    Valid values: Set to "WindowsVSS”:“enabled" to enable WindowsVSS backup option and create a VSS Windows backup. Set to “WindowsVSS”:”disabled” to create a regular backup. The WindowsVSS option is not enabled by default.

Returns:

See Also:

#start_copy_job(options = {}) ⇒ Types::StartCopyJobOutput

Starts a job to create a one-time copy of the specified resource.

Examples:

Request syntax with placeholder values


resp = client.start_copy_job({
  recovery_point_arn: "ARN", # required
  source_backup_vault_name: "BackupVaultName", # required
  destination_backup_vault_arn: "ARN", # required
  iam_role_arn: "IAMRoleArn", # required
  idempotency_token: "string",
  lifecycle: {
    move_to_cold_storage_after_days: 1,
    delete_after_days: 1,
  },
})

Response structure


resp.copy_job_id #=> String
resp.creation_date #=> Time

Options Hash (options):

  • :recovery_point_arn (required, String)

    An ARN that uniquely identifies a recovery point to use for the copy job; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

  • :source_backup_vault_name (required, String)

    The name of a logical source container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

  • :destination_backup_vault_arn (required, String)

    An Amazon Resource Name (ARN) that uniquely identifies a destination backup vault to copy to; for example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.

  • :iam_role_arn (required, String)

    Specifies the IAM role ARN used to copy the target recovery point; for example, arn:aws:iam::123456789012:role/S3Access.

  • :idempotency_token (String)

    A customer chosen string that can be used to distinguish between calls to StartCopyJob.

  • :lifecycle (Types::Lifecycle)

    Contains an array of Transition objects specifying how long in days before a recovery point transitions to cold storage or is deleted.

    Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, on the console, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.

Returns:

See Also:

#start_restore_job(options = {}) ⇒ Types::StartRestoreJobOutput

Recovers the saved resource identified by an Amazon Resource Name (ARN).

Examples:

Request syntax with placeholder values


resp = client.start_restore_job({
  recovery_point_arn: "ARN", # required
  metadata: { # required
    "MetadataKey" => "MetadataValue",
  },
  iam_role_arn: "IAMRoleArn", # required
  idempotency_token: "string",
  resource_type: "ResourceType",
})

Response structure


resp.restore_job_id #=> String

Options Hash (options):

  • :recovery_point_arn (required, String)

    An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

  • :metadata (required, Hash<String,String>)

    A set of metadata key-value pairs. Contains information, such as a resource name, required to restore a recovery point.

    You can get configuration metadata about a resource at the time it was backed up by calling GetRecoveryPointRestoreMetadata. However, values in addition to those provided by GetRecoveryPointRestoreMetadata might be required to restore a resource. For example, you might need to provide a new resource name if the original already exists.

    You need to specify specific metadata to restore an Amazon Elastic File System (Amazon EFS) instance:

    • file-system-id: The ID of the Amazon EFS file system that is backed up by AWS Backup. Returned in GetRecoveryPointRestoreMetadata.

    • Encrypted: A Boolean value that, if true, specifies that the file system is encrypted. If KmsKeyId is specified, Encrypted must be set to true.

    • KmsKeyId: Specifies the AWS KMS key that is used to encrypt the restored file system. You can specify a key from another AWS account provided that key it is properly shared with your account via AWS KMS.

    • PerformanceMode: Specifies the throughput mode of the file system.

    • CreationToken: A user-supplied value that ensures the uniqueness (idempotency) of the request.

    • newFileSystem: A Boolean value that, if true, specifies that the recovery point is restored to a new Amazon EFS file system.

    • ItemsToRestore: A serialized list of up to five strings where each string is a file path. Use ItemsToRestore to restore specific files or directories rather than the entire file system. This parameter is optional.

  • :iam_role_arn (required, String)

    The Amazon Resource Name (ARN) of the IAM role that AWS Backup uses to create the target recovery point; for example, arn:aws:iam::123456789012:role/S3Access.

  • :idempotency_token (String)

    A customer chosen string that can be used to distinguish between calls to StartRestoreJob.

  • :resource_type (String)

    Starts a job to restore a recovery point for one of the following resources:

    • DynamoDB for Amazon DynamoDB

    • EBS for Amazon Elastic Block Store

    • EC2 for Amazon Elastic Compute Cloud

    • EFS for Amazon Elastic File System

    • RDS for Amazon Relational Database Service

    • Storage Gateway for AWS Storage Gateway

Returns:

See Also:

#stop_backup_job(options = {}) ⇒ Struct

Attempts to cancel a job to create a one-time backup of a resource.

Examples:

Request syntax with placeholder values


resp = client.stop_backup_job({
  backup_job_id: "string", # required
})

Options Hash (options):

  • :backup_job_id (required, String)

    Uniquely identifies a request to AWS Backup to back up a resource.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#tag_resource(options = {}) ⇒ Struct

Assigns a set of key-value pairs to a recovery point, backup plan, or backup vault identified by an Amazon Resource Name (ARN).

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "ARN", # required
  tags: { # required
    "TagKey" => "TagValue",
  },
})

Options Hash (options):

  • :resource_arn (required, String)

    An ARN that uniquely identifies a resource. The format of the ARN depends on the type of the tagged resource.

  • :tags (required, Hash<String,String>)

    Key-value pairs that are used to help organize your resources. You can assign your own metadata to the resources you create.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#untag_resource(options = {}) ⇒ Struct

Removes a set of key-value pairs from a recovery point, backup plan, or backup vault identified by an Amazon Resource Name (ARN)

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "ARN", # required
  tag_key_list: ["string"], # required
})

Options Hash (options):

  • :resource_arn (required, String)

    An ARN that uniquely identifies a resource. The format of the ARN depends on the type of the tagged resource.

  • :tag_key_list (required, Array<String>)

    A list of keys to identify which key-value tags to remove from a resource.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_backup_plan(options = {}) ⇒ Types::UpdateBackupPlanOutput

Updates an existing backup plan identified by its backupPlanId with the input document in JSON format. The new version is uniquely identified by a VersionId.

Examples:

Request syntax with placeholder values


resp = client.update_backup_plan({
  backup_plan_id: "string", # required
  backup_plan: { # required
    backup_plan_name: "BackupPlanName", # required
    rules: [ # required
      {
        rule_name: "BackupRuleName", # required
        target_backup_vault_name: "BackupVaultName", # required
        schedule_expression: "CronExpression",
        start_window_minutes: 1,
        completion_window_minutes: 1,
        lifecycle: {
          move_to_cold_storage_after_days: 1,
          delete_after_days: 1,
        },
        recovery_point_tags: {
          "TagKey" => "TagValue",
        },
        copy_actions: [
          {
            lifecycle: {
              move_to_cold_storage_after_days: 1,
              delete_after_days: 1,
            },
            destination_backup_vault_arn: "ARN", # required
          },
        ],
      },
    ],
    advanced_backup_settings: [
      {
        resource_type: "ResourceType",
        backup_options: {
          "BackupOptionKey" => "BackupOptionValue",
        },
      },
    ],
  },
})

Response structure


resp.backup_plan_id #=> String
resp.backup_plan_arn #=> String
resp.creation_date #=> Time
resp.version_id #=> String
resp.advanced_backup_settings #=> Array
resp.advanced_backup_settings[0].resource_type #=> String
resp.advanced_backup_settings[0].backup_options #=> Hash
resp.advanced_backup_settings[0].backup_options["BackupOptionKey"] #=> String

Options Hash (options):

  • :backup_plan_id (required, String)

    Uniquely identifies a backup plan.

  • :backup_plan (required, Types::BackupPlanInput)

    Specifies the body of a backup plan. Includes a BackupPlanName and one or more sets of Rules.

Returns:

See Also:

#update_global_settings(options = {}) ⇒ Struct

Updates the current global settings for the AWS Account. Use the DescribeGlobalSettings API to determine the current settings.

Examples:

Request syntax with placeholder values


resp = client.update_global_settings({
  global_settings: {
    "GlobalSettingsName" => "GlobalSettingsValue",
  },
})

Options Hash (options):

  • :global_settings (Hash<String,String>)

    A list of resources along with the opt-in preferences for the account.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_recovery_point_lifecycle(options = {}) ⇒ Types::UpdateRecoveryPointLifecycleOutput

Sets the transition lifecycle of a recovery point.

The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.

Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.

Examples:

Request syntax with placeholder values


resp = client.update_recovery_point_lifecycle({
  backup_vault_name: "BackupVaultName", # required
  recovery_point_arn: "ARN", # required
  lifecycle: {
    move_to_cold_storage_after_days: 1,
    delete_after_days: 1,
  },
})

Response structure


resp.backup_vault_arn #=> String
resp.recovery_point_arn #=> String
resp.lifecycle.move_to_cold_storage_after_days #=> Integer
resp.lifecycle.delete_after_days #=> Integer
resp.calculated_lifecycle.move_to_cold_storage_at #=> Time
resp.calculated_lifecycle.delete_at #=> Time

Options Hash (options):

  • :backup_vault_name (required, String)

    The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

  • :recovery_point_arn (required, String)

    An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

  • :lifecycle (Types::Lifecycle)

    The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup transitions and expires backups automatically according to the lifecycle that you define.

    Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.

Returns:

See Also:

#update_region_settings(options = {}) ⇒ Struct

Updates the current service opt-in settings for the Region. If service-opt-in is enabled for a service, AWS Backup tries to protect that service's resources in this Region, when the resource is included in an on-demand backup or scheduled backup plan. Otherwise, AWS Backup does not try to protect that service's resources in this Region. Use the DescribeRegionSettings API to determine the resource types that are supported.

Examples:

Request syntax with placeholder values


resp = client.update_region_settings({
  resource_type_opt_in_preference: {
    "ResourceType" => false,
  },
})

Options Hash (options):

  • :resource_type_opt_in_preference (Hash<String,Boolean>)

    Updates the list of services along with the opt-in preferences for the Region.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.