salt.modules.boto_vpc

Connection module for Amazon VPC

New in version 2014.7.0.

configuration:

This module accepts explicit VPC credentials but can also utilize IAM roles assigned to the instance trough Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

If IAM roles are not used you need to specify them either in a pillar or in the minion's config file:

vpc.keyid: GKTADJGHEIQSXMKKRBJ08H
vpc.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

A region may also be specified in the configuration:

vpc.region: us-east-1

If a region is not specified, the default is us-east-1.

It's also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:

myprofile:

keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1

depends:

boto

salt.modules.boto_vpc.associate_dhcp_options_to_vpc(dhcp_options_id, vpc_id, region=None, key=None, keyid=None, profile=None)

Given valid DHCP options id and a valid VPC id, associate the DHCP options record with the VPC.

Returns True if the DHCP options record were associated and returns False if the DHCP options record was not associated.

CLI example:

.. code-block:: bash
salt myminion boto_vpc.associate_dhcp_options_to_vpc 'dhcp-a0bl34pp' 'vpc-6b1fe402'
salt.modules.boto_vpc.associate_network_acl_to_subnet(network_acl_id, subnet_id, region=None, key=None, keyid=None, profile=None)

Given a network acl ID and a subnet ID, associates a network acl to a subnet.

Returns the association ID if successful, otherwise returns False.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.associate_network_acl_to_subnet 'acl-5fb85d36' 'subnet-6a1fe403'
salt.modules.boto_vpc.associate_new_dhcp_options_to_vpc(vpc_id, domain_name=None, domain_name_servers=None, ntp_servers=None, netbios_name_servers=None, netbios_node_type=None, region=None, key=None, keyid=None, profile=None)

Given valid DHCP options and a valid VPC id, create and associate the DHCP options record with the VPC.

Returns True if the DHCP options record were created and associated and returns False if the DHCP options record was not created and associated.

CLI example:

.. code-block:: bash
salt myminion boto_vpc.associate_new_dhcp_options_to_vpc 'vpc-6b1fe402' domain_name='example.com' domain_name_servers='[1.2.3.4]' ntp_servers='[5.6.7.8]' netbios_name_servers='[10.0.0.1]' netbios_node_type=1
salt.modules.boto_vpc.associate_new_network_acl_to_subnet(vpc_id, subnet_id, network_acl_name=None, tags=None, region=None, key=None, keyid=None, profile=None)

Given a vpc ID and a subnet ID, associates a new network act to a subnet.

Returns a dictionary containing the network acl id and the new association id if successful. If unsuccessful, returns False.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.associate_new_network_acl_to_subnet 'vpc-6b1fe402' 'subnet-6a1fe403'
salt.modules.boto_vpc.associate_route_table(route_table_id, subnet_id, region=None, key=None, keyid=None, profile=None)

Given a route table ID and a subnet ID, associates the route table with the subnet.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.associate_route_table 'rtb-1f382e7d' 'subnet-6a1fe403'
salt.modules.boto_vpc.create(cidr_block, instance_tenancy=None, vpc_name=None, tags=None, region=None, key=None, keyid=None, profile=None)

Given a valid CIDR block, create a VPC.

An optional instance_tenancy argument can be provided. If provided, the valid values are 'default' or 'dedicated' An optional vpc_name argument can be provided.

Returns True if the VPC was created and returns False if the VPC was not created.

CLI example:

.. code-block:: bash
salt myminion boto_vpc.create '10.0.0.0/24'
salt.modules.boto_vpc.create_customer_gateway(vpn_connection_type, ip_address, bgp_asn, customer_gateway_name=None, tags=None, region=None, key=None, keyid=None, profile=None)

Given a valid VPN connection type, a static IP address and a customer gateway’s Border Gateway Protocol (BGP) Autonomous System Number, create a customer gateway.

Returns True if the customer gateway was created and returns False if the customer gateway was not created.

CLI example:

.. code-block:: bash
salt myminion boto_vpc.create_customer_gateway 'ipsec.1', '12.1.2.3', 65534
salt.modules.boto_vpc.create_dhcp_options(domain_name=None, domain_name_servers=None, ntp_servers=None, netbios_name_servers=None, netbios_node_type=None, dhcp_options_name=None, tags=None, region=None, key=None, keyid=None, profile=None)

Given valid DHCP options, create a DHCP options record.

Returns True if the DHCP options record was created and returns False if the DHCP options record was not deleted.

CLI example:

.. code-block:: bash
salt myminion boto_vpc.create_dhcp_options domain_name='example.com' domain_name_servers='[1.2.3.4]' ntp_servers='[5.6.7.8]' netbios_name_servers='[10.0.0.1]' netbios_node_type=1
salt.modules.boto_vpc.create_network_acl(vpc_id, network_acl_name=None, tags=None, region=None, key=None, keyid=None, profile=None)

Given a vpc_id, creates a network acl.

Returns the network acl id if successful, otherwise returns False.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.create_network_acl 'vpc-6b1fe402'
salt.modules.boto_vpc.create_network_acl_entry(network_acl_id, rule_number, protocol, rule_action, cidr_block, egress=None, icmp_code=None, icmp_type=None, port_range_from=None, port_range_to=None, region=None, key=None, keyid=None, profile=None)

Creates a network acl entry.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.create_network_acl_entry 'acl-5fb85d36' '32767' '-1' 'deny' '0.0.0.0/0'
salt.modules.boto_vpc.create_route(route_table_id, destination_cidr_block, gateway_id=None, instance_id=None, interface_id=None, region=None, key=None, keyid=None, profile=None)

Creates a route.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.create_route 'rtb-1f382e7d' '10.0.0.0/16'
salt.modules.boto_vpc.create_route_table(vpc_id, route_table_name=None, tags=None, region=None, key=None, keyid=None, profile=None)

Creates a route table.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.create_route_table 'vpc-6b1fe402'
salt.modules.boto_vpc.create_subnet(vpc_id, cidr_block, availability_zone=None, subnet_name=None, tags=None, region=None, key=None, keyid=None, profile=None)

Given a valid VPC ID and a CIDR block, create a subnet for the VPC.

An optional availability zone argument can be provided.

Returns True if the VPC subnet was created and returns False if the VPC subnet was not created.

CLI example:

.. code-block:: bash
salt myminion boto_vpc.create_subnet 'vpc-6b1fe402' '10.0.0.0/25'
salt.modules.boto_vpc.customer_gateway_exists(customer_gateway_id, region=None, key=None, keyid=None, profile=None)

Given a customer gateway ID, check if the customer gateway ID exists.

Returns True if the customer gateway ID exists; Returns False otherwise.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.customer_gateway_exists 'cgw-b6a247df'
salt.modules.boto_vpc.delete(vpc_id, region=None, key=None, keyid=None, profile=None)

Given a VPC ID, delete the VPC.

Returns True if the VPC was deleted and returns False if the VPC was not deleted.

CLI example:

.. code-block:: bash
salt myminion boto_vpc.delete 'vpc-6b1fe402'
salt.modules.boto_vpc.delete_customer_gateway(customer_gateway_id, region=None, key=None, keyid=None, profile=None)

Given a customer gateway ID, delete the customer gateway.

Returns True if the customer gateway was deleted and returns False if the customer gateway was not deleted.

CLI example:

.. code-block:: bash
salt myminion boto_vpc.delete_customer_gateway 'cgw-b6a247df'
salt.modules.boto_vpc.delete_network_acl(network_acl_id, region=None, key=None, keyid=None, profile=None)

Deletes a network acl based on the network_acl_id provided.

Returns True if the network acl was deleted successfully, otherwise returns False.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.delete_network_acl 'acl-5fb85d36'
salt.modules.boto_vpc.delete_network_acl_entry(network_acl_id, rule_number, egress=None, region=None, key=None, keyid=None, profile=None)

Deletes a network acl entry.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.delete_network_acl_entry 'acl-5fb85d36' '32767'
salt.modules.boto_vpc.delete_route(route_table_id, destination_cidr_block, region=None, key=None, keyid=None, profile=None)

Deletes a route.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.delete_route 'rtb-1f382e7d' '10.0.0.0/16'
salt.modules.boto_vpc.delete_route_table(route_table_id, region=None, key=None, keyid=None, profile=None)

Deletes a route table.

CLI Example:

.. code-example:: bash
salt myminion boto_vpc.delete_route_table 'rtb-1f382e7d'
salt.modules.boto_vpc.delete_subnet(subnet_id, region=None, key=None, keyid=None, profile=None)

Given a subnet ID, delete the subnet.

Returns True if the subnet was deleted and returns False if the subnet was not deleted.

CLI example:

.. code-block:: bash
salt myminion boto_vpc.delete_subnet 'subnet-6a1fe403'
salt.modules.boto_vpc.describe(vpc_id=None, region=None, key=None, keyid=None, profile=None)

Given a VPC ID describe it's properties.

Returns a dictionary of interesting properties. CLI example:

.. code-block:: bash
salt myminion boto_vpc.describe vpc_id=vpc-123456
salt.modules.boto_vpc.dhcp_options_exists(dhcp_options_id=None, name=None, tags=None, region=None, key=None, keyid=None, profile=None)

Check if a dhcp option exists.

Returns True if the dhcp option exists; Returns False otherwise.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.dhcp_options_exists dhcp_options_id='dhcp-a0bl34pp'
salt.modules.boto_vpc.disassociate_network_acl(subnet_id, vpc_id=None, region=None, key=None, keyid=None, profile=None)

Given a subnet ID, disassociates a network acl.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.disassociate_network_acl 'subnet-6a1fe403'
salt.modules.boto_vpc.disassociate_route_table(association_id, region=None, key=None, keyid=None, profile=None)

Dissassociates a route table.

association_id
The Route Table Association ID to disassociate

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.disassociate_route_table 'rtbassoc-d8ccddba'
salt.modules.boto_vpc.exists(vpc_id=None, name=None, cidr=None, tags=None, region=None, key=None, keyid=None, profile=None)

Given a VPC ID, check to see if the given VPC ID exists.

Returns True if the given VPC ID exists and returns False if the given VPC ID does not exist.

CLI example:

.. code-block:: bash
salt myminion boto_vpc.exists myvpc
salt.modules.boto_vpc.get_id(name=None, cidr=None, tags=None, region=None, key=None, keyid=None, profile=None)

Given a VPC properties, return VPC ID if exist.

CLI example:

.. code-block:: bash
salt myminion boto_vpc.get_id myvpc
salt.modules.boto_vpc.get_subnet_association(subnets, region=None, key=None, keyid=None, profile=None)

Given a subnet (aka: a vpc zone identifier) or list of subnets, returns vpc association.

Returns a VPC ID if the given subnets are associated with the same VPC ID. Returns False on an error or if the given subnets are associated with different VPC IDs.

CLI Examples:

.. code-block:: bash
salt myminion boto_vpc.get_subnet_association subnet-61b47516
salt myminion boto_vpc.get_subnet_association ['subnet-61b47516','subnet-2cb9785b']
salt.modules.boto_vpc.network_acl_exists(network_acl_id=None, name=None, tags=None, region=None, key=None, keyid=None, profile=None)

Checks if a network acl exists.

Returns True if the network acl exists or returns False if it doesn't exist.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.network_acl_exists network_acl_id='acl-5fb85d36'
salt.modules.boto_vpc.replace_network_acl_entry(network_acl_id, rule_number, protocol, rule_action, cidr_block, egress=None, icmp_code=None, icmp_type=None, port_range_from=None, port_range_to=None, region=None, key=None, keyid=None, profile=None)

Replaces a network acl entry.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.replace_network_acl_entry 'acl-5fb85d36' '32767' '-1' 'deny' '0.0.0.0/0'
salt.modules.boto_vpc.replace_route(route_table_id, destination_cidr_block, gateway_id=None, instance_id=None, interface_id=None, region=None, key=None, keyid=None, profile=None)

Replaces a route.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.replace_route 'rtb-1f382e7d' '10.0.0.0/16'
salt.modules.boto_vpc.replace_route_table_association(association_id, route_table_id, region=None, key=None, keyid=None, profile=None)

Replaces a route table association.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.replace_route_table_association 'rtbassoc-d8ccddba' 'rtb-1f382e7d'
salt.modules.boto_vpc.route_table_exists(route_table_id=None, name=None, tags=None, region=None, key=None, keyid=None, profile=None)

Checks if a route table exists.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.route_table_exists route_table_id='rtb-1f382e7d'
salt.modules.boto_vpc.subnet_exists(subnet_id=None, name=None, tags=None, region=None, key=None, keyid=None, profile=None)

Check if a subnet exists.

Returns True if the subnet exists, otherwise returns False.

CLI Example:

.. code-block:: bash
salt myminion boto_vpc.subnet_exists subnet_id='subnet-6a1fe403'