ec2_snapshot - creates a snapshot from an existing volume

Author:Will Thames

Synopsis

New in version 1.5.

creates an EC2 snapshot from an existing EBS volume

Options

parameter required default choices comments
aws_access_key no
    AWS access key. If not set then the value of the AWS_ACCESS_KEY environment variable is used.
    aws_secret_key no
      AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used.
      description no
        description to be applied to the snapshot
        device_name no
          device name of a mounted volume to be snapshotted
          ec2_url no
            Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Must be specified if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used
            instance_id no
              instance that has the required volume to snapshot mounted
              profile no
                uses a boto profile. Only works with boto >= 2.24.0 (added in Ansible 1.6)
                region no
                  The AWS region to use. If not specified then the value of the EC2_REGION environment variable, if any, is used.
                  security_token no
                    security token to authenticate against AWS (added in Ansible 1.6)
                    snapshot_tags no
                      a hash/dictionary of tags to add to the snapshot (added in Ansible 1.6)
                      validate_certs no yes
                      • yes
                      • no
                      When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0. (added in Ansible 1.5)
                      volume_id no
                        volume from which to take the snapshot

                        Note

                        Requires boto

                        Examples


                        # Simple snapshot of volume using volume_id
                        - local_action:
                            module: ec2_snapshot
                            volume_id: vol-abcdef12
                            description: snapshot of /data from DB123 taken 2013/11/28 12:18:32
                        
                        # Snapshot of volume mounted on device_name attached to instance_id
                        - local_action:
                            module: ec2_snapshot
                            instance_id: i-12345678
                            device_name: /dev/sdb1
                            description: snapshot of /data from DB123 taken 2013/11/28 12:18:32
                        
                        # Snapshot of volume with tagging
                        - local_action:
                            module: ec2_snapshot
                            instance_id: i-12345678
                            device_name: /dev/sdb1
                            snapshot_tags:
                                frequency: hourly
                                source: /data

                        Note

                        The following environment variables can be used AWS_ACCESS_KEY or EC2_ACCESS_KEY or AWS_ACCESS_KEY_ID, AWS_SECRET_KEY or EC2_SECRET_KEY or AWS_SECRET_ACCESS_KEY, AWS_REGION or EC2_REGION, AWS_SECURITY_TOKEN

                        Note

                        Ansible uses the boto configuration file (typically ~/.boto) if no credentials are provided. See http://boto.readthedocs.org/en/latest/boto_config_tut.html

                        Note

                        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