{ "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "AWS CloudFormation Template to create vWLC instance with required resources and assign a public IP that can be used to access the instance over the internet. This templates requires two separate subnets for service and management port in the same VPC", "Parameters" : { "InstanceType" : { "Description" : "vWLC EC2 instance type", "Type" : "String", "Default" : "c3.large", "AllowedValues" : [ "m4.large", "m4.xlarge", "m4.2xlarge", "m4.4xlarge", "m4.10xlarge", "c3.large", "c3.xlarge", "c3.2xlarge", "c3.4xlarge", "c3.8xlarge", "c4.large", "c4.xlarge", "c4.2xlarge", "c4.4xlarge", "c4.8xlarge", "r3.large", "r3.xlarge", "r3.2xlarge", "r3.4xlarge", "r3.8xlarge", "i2.xlarge", "i2.2xlarge", "i2.4xlarge", "i2.8xlarge", "d2.xlarge", "d2.2xlarge", "d2.4xlarge", "d2.8xlarge"], "ConstraintDescription" : "must be a valid SRIOv EC2 instance type." }, "VpcId" : { "Type" : "AWS::EC2::VPC::Id", "Description" : "VpcId of your existing Virtual Private Cloud (VPC)", "ConstraintDescription" : "must be the VPC Id of an existing Virtual Private Cloud." }, "Eth0SubnetId" : { "Type" : "AWS::EC2::Subnet::Id", "Description" : "SubnetId of an existing subnet (for the service port) in your Virtual Private Cloud (VPC)", "ConstraintDescription" : "must be an existing subnet in the selected Virtual Private Cloud." }, "Eth1SubnetId" : { "Type" : "AWS::EC2::Subnet::Id", "Description" : "SubnetId of an existing subnet (for the management port) in your Virtual Private Cloud (VPC)", "ConstraintDescription" : "must be an existing subnet in the selected Virtual Private Cloud." }, "SecurityGroup" : { "Type" : "AWS::EC2::SecurityGroup::Id", "Description" : "SecurityGroupId of on existing group (VPC)", "ConstraintDescription" : "must be an existing subnet in the selected Virtual Private Cloud." } }, "Mappings" : { "AWSRegion2AMI" : { "us-west-1" : {"AMI" : "ami-14a9f774"} } }, "Resources" : { "EIP1" : { "Type" : "AWS::EC2::EIP", "Properties" : { "Domain" : "vpc" } }, "EIPAssoc1" : { "Type" : "AWS::EC2::EIPAssociation", "Properties" : { "NetworkInterfaceId" : { "Ref" : "Eth1" }, "AllocationId" : { "Fn::GetAtt" : ["EIP1", "AllocationId"] }, "PrivateIpAddress" : { "Fn::GetAtt" : ["Eth1", "PrimaryPrivateIpAddress" ] } } }, "EC2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "InstanceType" : { "Ref" : "InstanceType" }, "ImageId" : { "Fn::FindInMap" : [ "AWSRegion2AMI", { "Ref" : "AWS::Region" }, "AMI" ]}, "NetworkInterfaces" : [ { "NetworkInterfaceId" : {"Ref" : "Eth0" }, "DeviceIndex" : "0" }, { "NetworkInterfaceId" : {"Ref" : "Eth1" }, "DeviceIndex" : "1" }], "Tags" : [ {"Key" : "Name", "Value" : "vWLC" } ] } }, "Eth0" : { "Type" : "AWS::EC2::NetworkInterface", "Properties" : { "Description" : "eth0", "GroupSet" : [ { "Ref" : "SecurityGroup" } ], "SourceDestCheck" : "true", "SubnetId" : { "Ref" : "Eth0SubnetId" }, "Tags" : [ {"Key" : "Name", "Value" : "Interface 0"}, {"Key" : "Interface", "Value" : "eth0"} ] } }, "Eth1" : { "Type" : "AWS::EC2::NetworkInterface", "Properties" : { "Description" : "eth1", "GroupSet" : [ { "Ref" : "SecurityGroup" } ], "SourceDestCheck" : "true", "SubnetId" : { "Ref" : "Eth1SubnetId" }, "Tags" : [ {"Key" : "Name", "Value" : "Interface 1"}, {"Key" : "Interface", "Value" : "eth1"} ] } } }, "Outputs" : { "InstanceId" : { "Value" : { "Ref" : "EC2Instance" }, "Description" : "Instance Id of newly created instance" }, "EIP1" : { "Value" : { "Fn::Join" : [" ", [ "IP address", { "Ref" : "EIP1" }, "on subnet", {"Ref" : "Eth1SubnetId"}]]}, "Description" : "Primary public IP address for Eth1" }, "PrimaryPrivateIPAddress" : { "Value" : { "Fn::Join" : [" ", [ "IP address", { "Fn::GetAtt" : ["Eth1", "PrimaryPrivateIpAddress"] }, "on subnet", {"Ref" : "Eth1SubnetId"}]]}, "Description" : "Primary private IP address of Eth1" } } }