Home > Blogs > VMware {code}


VMware Cloud on AWS Integrations with CloudFormation

The latest update to VMware Cloud on AWS has some real gems in it for developers and automation engineers. As well as the introduction of the Developer Center (which is amazing). It’s such a terrific resource, I’m finding myself using it all the time! The other big news was the addition of an Open Sourced Github repository to showcase VMware Cloud on AWS integrations written by both VMware and the community at large.

The first of these integrations is the support for CloudFormation and Terraform integrations.

In this blog post we’re going to walk through how easy it is to create a software defined data center (SDDC) using the CloudFormation template available in the VMware Cloud on AWS Integration Examples repository. Please note, this will require an AWS account and may incur AWS charges.

First things first, we need to get access to the template. We can clone the repository locally with the following command:

CloudFormation Stack Creation

In order to deploy our SDDC with CloudFormation, we’ll need to start by logging into the AWS Console and checking to make sure we’re in the Oregon region. If you’re not in that region, there is a drop-down box towards the top right-hand side with a site name that’s located between your user account and the “Support” drop-down. Click on the drop-down and select “US West (Oregon)”.

Example: Selecting the Oregon Region

We’ll now want to go to the CloudFormation service. We can find the service by clicking on the “Services” drop-down and locating it in the “Management Tools” section. Alternatively, just type “CloudFormation” in the AWS services search box on the main screen of the console.

Once in the CloudFormation service, we will want to create a new stack by clicking on the “Create New Stack” button. This stack will be used to deploy our SDDC that will be based on the template we’ll import on the next screen.

Example: Creating a new CloudFormation Stack

As part of the stack creation process, we’ll need to either create a new template or select an existing template. We can upload the template we retrieved from the GitHub repo by choosing “Upload a template to Amazon S3” then clicking on “Choose File”. Browse to the location the repo was cloned to, select the “vmc-aws-cloud-cf-template.txt”, and click “Next”.

Example: Choosing the repository sourced template

On the next screen we will need to specify a stack name. In this case, I used “VMWonAWS-CF” as the stack name.

Example: Assigning the new stack a name

For the “Options” screen, there is nothing to update, so we can click “Next”. On the last screen, review the details and check the box that you “acknowledge that AWS CloudFormation might create IAM resources”. We’re now ready to create our stack by clicking the “Create” button!

After few moments, we should see a screen like the following indicating that the stack creation has been successfully completed.

Example: stack creation process

SDDC Creation

We’ve now laid out the groundwork to deploy our new SDDC. One piece of which is the result of the stack creation, in the form of a new Lambda function. We’ll use this function to input our SDDC criteria and then ultimately deploy our new SDDC.

While we’re still in the CloudFormation service, we’ll want to click on our newly created stack to retrieve the details. Once on the “Stack Detail” page, expand the “Resources” section. There we see the IAM Role and Lambda function. Click on the physical ID of the Lambda function, which will take us to the function’s page.

Example: Examining the newly created stack resources

Once on the newly created Lamda function page, scroll down to the “Environmental variables” section. This section is where we need to input the criteria for the SDDC variables:

  • connected_account_id: Enter the AWS account this SDDC should be connected to.
    Note: This is the ID for the account which can be pulled from the API with the following:
    Method: GET /orgs/{org}/account-link/connected-accounts
    Property: ID
  • email: Enter an email address which you would like notified when the process has completed.
  • name: Enter the desired name of the SDDC
  • numOfHosts: Enter the number of desired hosts. (Minimum is 4)
  • orgId: Enter the Org ID for which the SDDC will be assigned. (This is available in the VMware Cloud Console in the “Support Info” tab)
  • region: Enter the desired region. (Case sensitive format: US_WEST_2)
  • customer_subnet_ids: Enter the desired subnet ID for VPC traffic.
    Note: This is the ID for the VPC subnet which can be pulled from the API with the following:

    Method: GET /orgs/{org}/account-link/compatible-subnets
    Property: subnet_id
  • user_refresh_token: Enter the creating user’s OAuth Refresh Token.
    Note: This is available in the VMware Cloud Console by clicking your username then “OAuth Refresh Token”.
  • vpc_cidr: Enter the desired subnet to use that corresponds with preferred management subnet. (Default is 10.2.0.0/16)

Example: Filling in the SDDC variables for the lambda resource

With all of our variables now input, we’re ready to save and run our function. First, click “Save” then click “Test”. On the “Configure test event” pop out, give the test event a name and click “Create”.

Example: Creating a lambda test event

Next to the “Test” button is a drop-down list of events. Make sure that list is set to our previously created test event and then click “Test” again. If everything was set properly, we should see a response like the following:

Example: lambda test event results

We can note from the above image that the response is a task. If we source out the ID, we can then follow along using the tasks API until the creation is complete. Alternatively, we can also watch the deployment process on the SDDCs tab of our Cloud Console.

Example: VMware Cloud on AWS Cloud Console results

Summary

The latest update to VMware Cloud on AWS introduced a couple great features for developers and automation specialists as well as a way for you to share your integrations. This blog covered the newly released integrations with CloudFormation. We showed how to access the CloudFormation template in the VMware Cloud on AWS Integration Examples repository. We then walked through how to easily get started deploying SDDCs in VMware Cloud on AWS using the CloudFormation template.

Get started with it today and let us know how you’re planning on integrating this into your existing workflows in the comments below!

This entry was posted in How to and tagged , , , on by .
Kyle Ruddy

About Kyle Ruddy

Kyle Ruddy is a Senior Technical Marketing Engineer at VMware in the Cloud Platform Business Unit. Kyle currently focuses on vSphere with Operations Management as well as all things API, SDK, and CLI. Kyle can be found blogging on VMware blogs, http://blogs.vmware.com/vSphere and http://blogs.vmware.com/PowerCLI, and his personal blog, http://www.thatcouldbeaproblem.com. You can follow Kyle on twitter as @kmruddy.

Leave a Reply

Your email address will not be published. Required fields are marked *

*