Skip to content

Latest commit

 

History

History
745 lines (703 loc) · 41.4 KB

community.missing_collection.aws_backup_info_module.rst

File metadata and controls

745 lines (703 loc) · 41.4 KB

community.missing_collection.aws_backup_info

Get Information about AWS Backup.

Version added: 0.0.1

The below requirements are needed on the host that executes this module.

  • boto
  • boto3
  • botocore
  • python >= 2.6
Parameter Choices/Defaults Comments
aws_access_key
string
AWS access key. If not set then the value of the AWS_ACCESS_KEY_ID, AWS_ACCESS_KEY or EC2_ACCESS_KEY environment variable is used.
If profile is set this parameter is ignored.
Passing the aws_access_key and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.

aliases: ec2_access_key, access_key
aws_ca_bundle
path
The location of a CA Bundle to use when validating SSL certificates.
Only used for boto3 based modules.
Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally.
aws_config
dictionary
A dictionary to modify the botocore configuration.
Only the 'user_agent' key is used for boto modules. See http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto for more boto configuration.
aws_secret_key
string
AWS secret key. If not set then the value of the AWS_SECRET_ACCESS_KEY, AWS_SECRET_KEY, or EC2_SECRET_KEY environment variable is used.
If profile is set this parameter is ignored.
Passing the aws_secret_key and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.

aliases: ec2_secret_key, secret_key
backup_plan_id
string
Id of Backup Plan.
Mutually Exclusive with list_backup_plans_include_deleted, list_backup_plan_templates.
list_backup_vaults, list_backup_jobs and list_copy_jobs
debug_botocore_endpoint_logs
boolean
    Choices:
  • no ←
  • yes
Use a botocore.endpoint logger to parse the unique (rather than total) "resource:action" API calls made during a task, outputing the set to the resource_actions key in the task results. Use the aws_resource_action callback to output to total list made during a playbook. The ANSIBLE_DEBUG_BOTOCORE_LOGS environment variable may also be used.
ec2_url
string
Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used.

aliases: aws_endpoint_url, endpoint_url
list_backup_jobs
boolean
    Choices:
  • no
  • yes
do you want to fetch backup jobs?
list_backup_jobs_by_account_id
string
fetch backup jobs by account id used in backup job.
list_backup_jobs_by_backup_vault_name
string
fetch backup jobs by backup vault name.
list_backup_jobs_by_resource_arn
string
fetch backup jobs by resource arn.
list_backup_jobs_by_resource_type
string
fetch backup jobs by resource type used in backup job.
list_backup_jobs_by_state
string
fetch backup jobs by job state.
list_backup_plan_templates
boolean
    Choices:
  • no
  • yes
do you want to fetch backup plan templates?
list_backup_plan_versions
boolean
    Choices:
  • no
  • yes
do you want to fetch backup plan versions?
list_backup_plans_include_deleted
boolean
    Choices:
  • no
  • yes
do you want to include deleted backup plans?
list_backup_selections
boolean
    Choices:
  • no
  • yes
do you want to fetch backup selections?
list_backup_vaults
boolean
    Choices:
  • no
  • yes
do you want to fetch list of backup vaults?
list_copy_jobs
boolean
    Choices:
  • no
  • yes
do you want to fetch backup copy jobs?
list_copy_jobs_by_account_id
boolean
    Choices:
  • no
  • yes
fetch backup copy jobs by account id.
list_copy_jobs_by_destination_vault_arn
string
fetch backup copy jobs by destination vault arn?
list_copy_jobs_by_resource_arn
string
fetch backup copy jobs by resource arn.
list_copy_jobs_by_resource_type
string
fetch backup copy jobs by resource type.
list_copy_jobs_by_state
string
fetch backup copy jobs by state of job.
profile
string
Uses a boto profile. Only works with boto >= 2.24.0.
Using profile will override aws_access_key, aws_secret_key and security_token and support for passing them at the same time as profile has been deprecated.
aws_access_key, aws_secret_key and security_token will be made mutually exclusive with profile after 2022-06-01.

aliases: aws_profile
region
string
The AWS region to use. If not specified then the value of the AWS_REGION or EC2_REGION environment variable, if any, is used. See http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region

aliases: aws_region, ec2_region
security_token
string
AWS STS security token. If not set then the value of the AWS_SECURITY_TOKEN or EC2_SECURITY_TOKEN environment variable is used.
If profile is set this parameter is ignored.
Passing the security_token and profile options at the same time has been deprecated and the options will be made mutually exclusive after 2022-06-01.

aliases: aws_security_token, access_token
validate_certs
boolean
    Choices:
  • no
  • yes ←
When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0.

Note

  • If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence AWS_URL or EC2_URL, AWS_PROFILE or AWS_DEFAULT_PROFILE, AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY or EC2_ACCESS_KEY, AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY or EC2_SECRET_KEY, AWS_SECURITY_TOKEN or EC2_SECURITY_TOKEN, AWS_REGION or EC2_REGION, AWS_CA_BUNDLE
  • Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See https://boto.readthedocs.io/en/latest/boto_config_tut.html
  • AWS_REGION or EC2_REGION can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file
- name: "get list of aws backup plans without deleted plans"
  aws_backup_info:
  register: __b

- name: "get list of aws backup plans with deleted plans"
  aws_backup_info:
    list_backup_plans_include_deleted: true

- name: "get basic details about specific backup plan"
  aws_backup_info:
    backup_plan_id: "{{ __b.backup_plans[0].backup_plan_id }}"
    list_backup_selections: true

- name: "get list of backup plan versions about specific backup plan"
  aws_backup_info:
    backup_plan_id: "{{ __b.backup_plans[0].backup_plan_id }}"
    list_backup_plan_versions: true

- name: "get list of backup plan templates"
  aws_backup_info:
    list_backup_plan_templates: true

- name: "get list of backup vaults"
  aws_backup_info:
    list_backup_vaults: true

- name: "get list of backup jobs for given backup vault name"
  aws_backup_info:
    list_backup_jobs: true
    list_backup_jobs_by_backup_vault_name: 'rds-valut'

- name: "list of backup jobs for given vault name and state"
  aws_backup_info:
    list_backup_jobs: true
    list_backup_jobs_by_backup_vault_name: 'rds-valut'
    list_backup_jobs_by_state: 'COMPLETED'

- name: "list of backup copy jobs"
  aws_backup_info:
    list_copy_jobs: true
    list_copy_jobs_by_state: 'COMPLETED'

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
backup_jobs
list
when `list_backup_jobs` and any filter values are passed like `list_backup_jobs_by_backup_vault_name`, `list_backup_jobs_by_state` `list_backup_jobs_by_resource_arn`, `list_backup_jobs_by_resource_type` `list_backup_jobs_by_account_id` and success
List of backup jobs.

Sample:
[{'account_id': 'xxxx', 'backup_job_id': '9AA49310-xxxx-6B3522195FDB', 'backup_size_in_bytes': 0, 'backup_vault_arn': 'arn:aws:backup:us-east-1:xxx:backup-vault:rds-valut', 'backup_vault_name': 'rds-valut', 'completion_date': '2020-12-23T01:28:05.634000+02:00', 'created_by': {'backup_plan_arn': 'arn:aws:backup:us-east-1:xxxx:backup-plan:55934731-xxxxx-a4a44b98f40b', 'backup_plan_id': '55934731-xxxxx-a4a44b98f40b', 'backup_plan_version': 'ODJhZDFhOWIxxxxxxxYjA5ZGYyZDgx', 'backup_rule_id': '8430c4d0-xxxxxxxxx-54c449719284'}, 'creation_date': '2020-12-23T01:14:33.406000+02:00', 'iam_role_arn': 'arn:aws:iam::xxxxxx:role/service-role/AWSBackupDefaultServiceRole', 'percent_done': '100.0', 'recovery_point_arn': 'arn:aws:rds:us-east-1:xxxxxxx:snapshot:awsbackup:job-9aa49310-xxxxx-6b3522195fdb', 'resource_arn': 'arn:aws:rds:us-east-1:xxxxxxxxxxx:db:test', 'resource_type': 'RDS', 'start_by': '2020-12-23T02:10:00+02:00', 'state': 'COMPLETED'}]
backup_plan_selections
list
when `backup_plan_id`, `list_backup_selections` and success
List of backup plans selections.

Sample:
[{'backup_plan_id': '55934731-xxxxx-a4a44b98f40b', 'creation_date': '2020-11-16T14:33:42.554000+02:00', 'creator_request_id': '8dd55ad7-xxx-47edc804e3d3', 'iam_role_arn': 'arn:aws:iam::xxxxx:role/service-role/AWSBackupDefaultServiceRole', 'selection_id': '06c9f85f-c49e-4efb-ace3-b1fd1ef86862', 'selection_name': 'test-rds'}]
backup_plan_templates
list
when `list_backup_plan_templates` and success
List of backup plans templates.

Sample:
[{'backup_plan_template_id': '87c0c1ef-xxxxxx-2e76a2c38aaa', 'backup_plan_template_name': 'Daily-35day-Retention'}, {'backup_plan_template_id': '87c0c1ef-xxxxxx-2e76a2c38aab', 'backup_plan_template_name': 'Daily-Monthly-1yr-Retention'}]
backup_plan_versions
list
when `backup_plan_id`, `list_backup_plan_versions` and success
List of backup plans versions.

Sample:
[{'backup_plan_arn': 'arn:aws:backup:us-east-1:xxxxx:backup-plan:55934731-xxxxx-a4a44b98f40b', 'backup_plan_id': '55934731-xxxxx-a4a44b98f40b', 'backup_plan_name': 'test-rds-backup', 'creation_date': '2020-11-16T16:08:15.039000+02:00', 'last_execution_date': '2020-12-23T01:14:33.406000+02:00', 'version_id': 'ODJhZDFhOWItYxxxxxxxYjA5ZGYyZDgx'}, {'backup_plan_arn': 'arn:aws:backup:us-east-1:xxxx:backup-plan:55934731-xxxxx-a4a44b98f40b', 'backup_plan_id': '55934731-xxxxx-a4a44b98f40b', 'backup_plan_name': 'test-rds-backup', 'creation_date': '2020-11-16T14:55:46.131000+02:00', 'deletion_date': '2020-11-16T16:08:15.039000+02:00', 'last_execution_date': '2020-11-16T16:07:47.272000+02:00', 'version_id': 'ZDliN2U5YjMxxxxxI1NmU4Y2U1MDk5'}]
backup_plans
list
when no argument is defined or `list_backup_plans_include_deleted` and success
List of backup plans.

Sample:
[{'backup_plan_arn': 'arn:aws:backup:us-east-1:xxxx:backup-plan:55934731-xxxxx-a4a44b98f40b', 'backup_plan_id': '55934731-xxxxx-a4a44b98f40b', 'backup_plan_name': 'test-rds-backup', 'creation_date': '2020-11-16T16:08:15.039000+02:00', 'last_execution_date': '2020-12-23T01:14:33.406000+02:00', 'version_id': 'ODJhZDFhxxxxxxxxxA5ZGYyZDgx'}, {'backup_plan_arn': 'arn:aws:backup:us-east-1:xxxxx:backup-plan:74a37778-xxxxx-9176d22ae8f2', 'backup_plan_id': '74a37778-xxxxx-9176d22ae8f2', 'backup_plan_name': 'Test', 'creation_date': '2020-10-13T15:39:45.605000+03:00', 'deletion_date': '2021-11-15T16:58:10.741000+03:00', 'last_execution_date': '2020-10-13T16:33:12.037000+03:00', 'version_id': 'Yzk2YWJmMTxxxxxFkNTNmNTRm'}]
backup_vaults
list
when `list_backup_vaults` and success
List of backup vaults.

Sample:
[{'backup_vault_arn': 'arn:aws:backup:us-east-1:xxxx:backup-vault:Default', 'backup_vault_name': 'Default', 'creation_date': '2019-01-28T10:31:25.594000+02:00', 'creator_request_id': 'Default', 'encryption_key_arn': 'arn:aws:kms:us-east-1:xxxx:key/8308c521-xxxxx-86bda5017bf4', 'number_of_recovery_points': 0}]
copy_jobs
list
when `list_copy_jobs` and any filter values are passed like `list_copy_jobs_by_state`, `list_copy_jobs_by_resource_arn`, `list_copy_jobs_by_resource_type`, `list_copy_jobs_by_account_id` `list_copy_jobs_by_destination_vault_arn` and success
List of backup copy jobs.

Sample:
[{'account_id': 'string', 'copy_job_id': 'string', 'source_backup_vault_arn': 'string', 'source_recovery_point_arn': 'string', 'destination_backup_vault_arn': 'string', 'destination_recovery_point_arn': 'string', 'resource_arn': 'string', 'creation_date': 'datetime(2017', 7: None, '7)': None, 'completion_date': 'datetime(2015', 1: None, '1)': None, 'state': 'CREATED', 'status_message': 'string', 'backup_size_in_bytes': 123, 'iam_role_arn': 'string', 'created_by': {'backup_plan_id': 'string', 'backup_plan_arn': 'string', 'backup_plan_version': 'string', 'backup_rule_id': 'string'}, 'resource_type': 'string'}]


Authors