salt.cloud.clouds.libcloud_aws

The AWS Cloud Module

The AWS cloud module is used to interact with the Amazon Web Services system.

This module has been replaced by the EC2 cloud module, and is no longer supported. The documentation shown here is for reference only; it is highly recommended to change all usages of this driver over to the EC2 driver.

If this driver is still needed, set up the cloud configuration at
/etc/salt/cloud.providers or /etc/salt/cloud.providers.d/aws.conf:
my-aws-config:
  # The AWS API authentication id
  id: GKTADJGHEIQSXMKKRBJ08H
  # The AWS API authentication key
  key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
  # The ssh keyname to use
  keyname: default
  # The amazon security group
  securitygroup: ssh_open
  # The location of the private key which corresponds to the keyname
  private_key: /root/default.pem

  provider: aws
salt.cloud.clouds.libcloud_aws.block_device_mappings(vm_)

Return the block device mapping:

[{'DeviceName': '/dev/sdb', 'VirtualName': 'ephemeral0'},
  {'DeviceName': '/dev/sdc', 'VirtualName': 'ephemeral1'}]
salt.cloud.clouds.libcloud_aws.create(vm_)

Create a single VM from a data dict

salt.cloud.clouds.libcloud_aws.create_attach_volumes(volumes, location, data)

Create and attach volumes to created node

salt.cloud.clouds.libcloud_aws.del_tags(name, kwargs, call=None)

Delete tags for a node

CLI Example:

salt-cloud -a del_tags mymachine tag1,tag2,tag3
salt.cloud.clouds.libcloud_aws.destroy(name)

Wrap core libcloudfuncs destroy method, adding check for termination protection

salt.cloud.clouds.libcloud_aws.get_availability_zone(conn, vm_)

Return the availability zone to use

salt.cloud.clouds.libcloud_aws.get_configured_provider()

Return the first configured instance.

salt.cloud.clouds.libcloud_aws.get_conn(**kwargs)

Return a conn object for the passed VM data

salt.cloud.clouds.libcloud_aws.get_location(vm_=None)
Return the AWS region to use, in this order:
  • CLI parameter
  • Cloud profile setting
  • Global salt-cloud config
salt.cloud.clouds.libcloud_aws.get_salt_interface(vm_)

Return the salt_interface type to connect to. Either 'public_ips' (default) or 'private_ips'.

salt.cloud.clouds.libcloud_aws.get_tags(name, call=None)

Retrieve tags for a node

salt.cloud.clouds.libcloud_aws.iam_profile(vm_)

Return the IAM role

salt.cloud.clouds.libcloud_aws.keyname(vm_)

Return the keyname

salt.cloud.clouds.libcloud_aws.rename(name, kwargs, call=None)

Properly rename a node. Pass in the new name as "new name".

CLI Example:

salt-cloud -a rename mymachine newname=yourmachine
salt.cloud.clouds.libcloud_aws.securitygroup(vm_)

Return the security group

salt.cloud.clouds.libcloud_aws.set_tags(name, tags, call=None)

Set tags for a node

CLI Example:

salt-cloud -a set_tags mymachine tag1=somestuff tag2='Other stuff'
salt.cloud.clouds.libcloud_aws.ssh_interface(vm_)

Return the ssh_interface type to connect to. Either 'public_ips' (default) or 'private_ips'.

salt.cloud.clouds.libcloud_aws.ssh_username(vm_)

Return the ssh_username. Defaults to 'ec2-user'.

salt.cloud.clouds.libcloud_aws.start(name, call=None)

Start a node

salt.cloud.clouds.libcloud_aws.stop(name, call=None)

Stop a node