From 5ce0b80fd30c3dffce24a637fa9d4a38d027ab09 Mon Sep 17 00:00:00 2001 From: Richard Isaacson Date: Thu, 27 Feb 2014 09:27:28 -0600 Subject: [PATCH] Added instance_tenancy functionality per social request. --- cloud/ec2_vpc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cloud/ec2_vpc b/cloud/ec2_vpc index c44501b5b96..9b9fb95a0b2 100644 --- a/cloud/ec2_vpc +++ b/cloud/ec2_vpc @@ -26,6 +26,12 @@ options: description: - "The cidr block representing the VPC, e.g. 10.0.0.0/16" required: false, unless state=present + instance_tenancy: + description: + - "The supported tenancy options for instances launched into the VPC." + required: false + default: "default" + choices: [ "default", "dedicated" ] dns_support: description: - toggles the "Enable DNS resolution" flag @@ -201,6 +207,7 @@ def create_vpc(module, vpc_conn): id = module.params.get('id') cidr_block = module.params.get('cidr_block') + instance_tenancy = module.params.get('instance_tenancy') dns_support = module.params.get('dns_support') dns_hostnames = module.params.get('dns_hostnames') subnets = module.params.get('subnets') @@ -227,7 +234,7 @@ def create_vpc(module, vpc_conn): else: changed = True try: - vpc = vpc_conn.create_vpc(cidr_block) + vpc = vpc_conn.create_vpc(cidr_block, instance_tenancy) # wait here until the vpc is available pending = True wait_timeout = time.time() + wait_timeout @@ -483,6 +490,7 @@ def main(): argument_spec = ec2_argument_spec() argument_spec.update(dict( cidr_block = dict(), + instance_tenancy = dict(choices=['default', 'dedicated'], default='default'), wait = dict(choices=BOOLEANS, default=False), wait_timeout = dict(default=300), dns_support = dict(choices=BOOLEANS, default=True),