Introduction
CloudFormation is an AWS service that allows you to define your AWS infrastructure as code (IaC). Using CloudFormation you can create, update, and delete AWS resources. Benefits include fast deployment of infrastructure, consistency across deployments, and automation of infrastructure creation.
The two primary concepts used in CloudFormation are templates and stacks. Templates are JSON or YAML files that describe the AWS resources you will deploy. Stacks are the set of resources that are created and managed together when a template is run in CloudFormation. Stacks can be deployed from templates using the AWS console, AWS command-line interface (CLI) or via AWS APIs.
Using CloudFormation templates, you can automate the deployment of Infoblox vNIOS appliances in AWS. This is useful for deploying vNIOS with identical configurations across multiple regions or for quickly deploying and tearing down a test environment. Two sample templates can be found at the end of this blog. The first deploys a new VPC, subnets, internet gateway, routes, public IP, security group and a vNIOS instance. The second uses an existing VPC and subnets for a new vNIOS instance. These templates can be used as a baseline to customize deployment in your AWS environment.
Infoblox vNIOS Instance Template
We’ll take a look at some components of the first sample template, which deploys a new VPC along with the vNIOS instance.
The template utilizes two mappings, tables which provide values based on input. The first mapping will select the appropriate vNIOS 8.5 Amazon Machine Image (AMI) based on which region the template is used in. This map has entries for many AWS regions and other specific regions can be added as needed.
The second mapping selects appropriate temporary license and instance size based on a vNIOS model parameter input.
NOTE: Not all instance types are available in every region. If you are modifying the templates to deploy in other regions, verify which instance types are available. To find recommended instance types for vNIOS instances in your region, refer to the vNIOS for AWS Installation Guide on the Infoblox support site: https://docs.infoblox.com.
These mappings are referenced in the template when creating the vNIOS instance, to provide specific values for “ImageId” and “InstanceType” properties.
The “UserData” property in the template allows you to pass some initial configuration to the vNIOS appliance. In this template, it is used to allow SSH access, set the admin password, and apply temporary licenses to the instance. Licenses for the specific model are set based on the mapping shown earlier. For further information on working with User Data fields in AWS, refer to the vNIOS for AWS Installation Guide on the Infoblox support site: https://docs.infoblox.com.
For documentation on other resources and sections in the templates, refer to AWS CloudFormation documentation: https://aws.amazon.com/cloudformation.
Deploy vNIOS Instance Template
To deploy this template using the AWS browser console, follow these steps:
In the AWS console, use the Services dropdown menu to navigate to CloudFormation and create a new stack. In Step 1 of the create stack wizard, select Template is ready and Upload a template file. Click on Choose file and select the deployVNIOSv1.json file you downloaded. Click Next.
On Step 2, enter a name for your stack. Set the parameters to your desired values or leave the defaults. The VPCCIDR parameter will only accept a /16 CIDR. Click Next.
On Step 3, add tags for your resources if desired. You can leave defaults for all other settings on this step. Click Next.
On Step 4, review the details for your stack deployment. Click Edit on any section to make changes if needed. Once everything looks correct for deployment, click on Create stack.
You can monitor the progress of your deployment in the Events tab of the stack.
Once you see CREATE_COMPLETE for the stack, access your vNIOS instance and other resources from their respective AWS console pages.
When you no longer need the resources in this stack, you can terminate them using the Delete button on the stack page. This will remove all resources created by this deployment.
Deploy Templates from AWS CLI
To deploy the sample CloudFormation templates using the AWS CLI, use the following commands.
For Template 1:
aws cloudformation deploy /
–template-file ./deployVNIOSv1.json /
–stack-name new-stack1 /
–parameter-overrides VPCName=demo-vpc VPCCIDR=10.17.0.0/16 /
InstanceName=demo-vnios NIOSmodel=TE-V1425
Replace each value in the parameter overrides section with your desired value.
For Template 2:
aws cloudformation deploy /
–template-file ./deployVNIOS_existingVPC.json /
–stack-name new-stack1 /
–parameter-overrides VpcId=vpc-1234abcd SubnetLAN1=subnet-1234abcd /
SubnetMGMT=subnet-5678efgh InstanceName=demo-vnios NIOSmodel=TE-V1425
Replace each value in the parameter overrides section with your desired value. Values for VPC and Subnet IDs are required. SubnetLAN1 and SubnetMGMT can be the same subnet or 2 subnets in the same VPC and availability zone.
Conclusion
AWS CloudFormation allows fast and consistent automated deployment and management of your Infoblox DDI infrastructure in AWS. Templates are highly customizable and can be used for most deployment scenarios. To try out the templates featured in this blog, download them below.
Template1: New VPC, subnets, gateway, routes, security group, and vNIOS instance.
Template 2: vNIOS instance and security group. Uses existing VPC.