AWS CloudFormation
User Guide (API Version 2010-05-15)
Did this page help you?  Yes | No |  Tell us about it...
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.

Using CloudFormer to Create AWS CloudFormation Templates from Existing AWS Resources

CloudFormer is a tool that creates an AWS CloudFormation template from existing AWS resources in your account. The basic procedure is:

  1. Provision and configure the required resources using your existing processes and tools.

  2. Create and launch a CloudFormer stack.

    CloudFormer is itself an AWS CloudFormation stack. You run CloudFormer by launching the stack from your AWS environment. It runs on a t1.micro Amazon EC2 instance and requires no other resources.

  3. Use CloudFormer to create a template using any of your existing AWS resources and save it to an Amazon S3 bucket.

  4. Shut down the CloudFormer stack.

    You usually don't need CloudFormer beyond this point, so you can avoid additional charges by shutting it down, which terminates the associated Amazon EC2 instance.

  5. Use the template to launch the stack, as needed.

Some general notes on how CloudFormer works:

  • CloudFormer supports all AWS CloudFormation resources.

  • CloudFormer automatically selects dependent resources.

    For example, if you include an Amazon EC2 instance that has a dependent EC2 security group, CloudFormer automatically selects the security group resource.

  • You have full control over which resources are included in the template.

    You can override automatically selected resources and add others, as appropriate.

  • You can specify the resource names to be used in the template.

    The default names are based on the existing resource names.

  • You can add output parameters based on a resource's available attributes.

This guide describes how to use CloudFormer by walking you through a basic scenario—a simple website on an EC2 instance—that creates a template with multiple resources. However, this example is just one of many possible scenarios; CloudFormer can create a template from any collection of AWS resources.

Step 1: Create a CloudFormer Stack

CloudFormer is itself an AWS CloudFormation stack, so the first step is to create and launch the stack. There are several ways to perform this task.

Because the AWS CloudFormation console is a good way to learn how to work with AWS resources, this walkthrough launches a CloudFormer stack by using the console.

To create a CloudFormer stack using the AWS CloudFormation Console

  1. Log in to the AWS CloudFormation console and click Create New Stack to launch the stack creation wizard. For instructions on how to log in, see Logging in to the AWS CloudFormation Console.

  2. On the wizard's Create Stack page:

    1. In the Name box, specify a name for this CloudFormer stack.

    2. In the Template section, select Use a sample template and select CloudFormer - create a template from your existing resources from the list.

    Click Next Step to move to the next page.

  3. On the Specify Parameters screen:

    • Under Access Control, specify the IP address range that can be used to access the tool.

      The default IP address range is 0.0.0.0/0, which leaves the tool fully open. We recommend that you specify a more restrictive address range.

  4. Click Next Step

  5. Select I acknowledge that this template may create IAM resources, and then click Next Step.

    This example doesn't use tags.

  6. On the Review screen, examine the information about the stack that will be created, then click Create to begin creating the CloudFormer stack.

    Note: CloudFormer is an AWS CloudFormation stack itself, so must go through the normal stack creation process, which takes a few minutes.

Step 2: Launch the CloudFormer Stack

After the CloudFormer stack's status is CREATE_COMPLETE, you can launch the stack.

To launch the CloudFormer stack

  1. Click the CloudFormer stack's entry in the AWS CloudFormation Console, and select the Outputs tab in the stack information pane.

  2. In Outputs Value column, click the URL to launch the CloudFormer tool.

After the stack launches, it displays the first page of the CloudFormer tool in your browser, which you use to create your template, as described in the next section.

The CloudFormer tool

Note

The CloudFormer stack launches a t1.micro Amazon EC2 instance, which must be manually terminated after you are finished.

After you create a CloudFormer stack, it becomes one of your account's collection of stacks. To create another template, just launch the CloudFormer stack again.

Step 3: Use CloudFormer to Create a Template

Before you start using CloudFormer to create a template, first ensure that your account has all the AWS resources that you want to include in your template. This walkthrough assumes that your account has:

  • An Amazon EC2 instance (AWS::EC2::Instance).

  • An Amazon EC2 security group (AWS::EC2::SecurityGroup). You should associate the security group with the instance.

  • An Elastic IP Address(AWS::EC2::EIP). You should associate the address with the instance.

To use CloudFormer to create a template from your AWS resources

  1. Under Select the AWS Region, select the template's region from the list, and click Create Template. The tool must first analyze your account, so it might take a few minutes before the Intro page is displayed.

  2. On the Intro page, enter a description for your template. You can also use this page to select resources with a filter or select all resources in your account. This walkthrough specifies resources manually, so leave Resource Name Filter and Select all resources in your account blank and cleared, respectively and click Continue.

  3. The following pages are for resources that are not used by this walkthrough, so just examine the page for future reference and click Continue. In order:

    1. DNS Names allows you to include Route 53 records.

    2. The Virtual Private Clouds allows you to include Amazon VPCs.

    3. Virtual Private Cloud Network Topologies allows you to include Amazon VPC subnets, gateways, DHCP configurations, and VPN connections.

    4. Virtual Private Cloud Security Configuration allows you to include network ACLS and route tables.

  4. Network Resources allows you to include Elastic Load Balancing load balancers, Elastic IP Addresses, CloudFront distributions, and Amazon EC2 network interfaces. Select the Elastic IP address you want to include in the template.

  5. The Compute Resources page allows you to include Auto Scaling groups and Amazon EC2 instances. Before you started creating the template, you associated an Elastic IP Address with your Amazon EC2 instance, creating a dependent resource. When you reach Compute Resources, CloudFormer automatically selects dependent instances, so just ensure that your instance is selected and click Continue.

    Note

    You can manually include additional instances, as needed. If you don't want to include an automatically selected instance, just clear the check box.

  6. The following pages are for resources that are not used by this walkthrough, so just examine the page for future reference and click Continue. In order:

    1. Storage allows you to include Amazon EBS volumes, Amazon RDS instances, DynamoDB tables, and Amazon S3 buckets.

    2. Application Services allows you to include ElastiCache clusters, Amazon SQS queues, Amazon SimpleDB domains, and Amazon SNS topics.

      System Configuration allows you to include Auto Scaling launch configurations, Amazon RDS subnet groups, ElastiCache parameter groups, and Amazon RDS parameter groups.

  7. The Security Groups page allows you include security groups. Before you started creating the template, you associated an Amazon EC2 security group with your Amazon EC2 instance, creating a dependent resource. When you reach Security Groups, CloudFormer automatically selects dependent security groups, so just ensure that your group is selected and click Continue.

    Note

    You can manually include additional security groups—including Amazon EC2 security groups, Amazon RDS security groups, and so on—as appropriate. If you don't want to include an automatically selected security group, just clear the check box.

  8. The Operational Resources page allows you to include Auto Scaling policies and CloudWatch alarms. This walkthrough uses neither, so just click Continue.

  9. The Summary page serves several purposes:

    • It allows you to review the resources you've added to your template.

      To modify your resources, click Back to return to the appropriate pages and modify your selections as needed.

    • It allows you to change your the auto-generated logical names that were assigned to your resources.

      To modify a logical name, click Modify and enter the name in the Logical Name field.

    • It allows you to specify outputs that provide necessary information, such as your site's IP address or URL.

      To modify an output, click Modify and select the appropriate output from the list.

    Examine the resources you've selected and make any necessary changes. You should have one Elastic IP Address, one Amazon EC2 instance, and one Amazon EC2 security group. When you are satisfied, click Continue to generate the template.

  10. The AWS CloudFormation Template page displays the generated template. You can use the template to deploy your resources as a combined set with AWS CloudFormation, or as a base template for further modification.

    Note

    In addition to the resources that you explicitly specified, the template includes values that are associated with those resources such as Amazon EC2 instances' Availability Zones.

    Select an Amazon S3 bucket from the S3 Bucket list and click Save Template to save the template to the bucket and add it to your accounts collection of stacks.

    Save Template gives you two options:

    • Launch Stack saves the template to the specified Amazon S3 bucket and also launches the stack immediately.

    • Create Template simply saves the template to the specified Amazon S3 bucket.

      You can launch the stack later just like you would with any other template, for example, by using the AWS CloudFormation console.

  11. Now that you have the template, you don't need the CloudFormer stack any more. To avoid unnecessary charges to your account, go to the Amazon EC2 console and delete the CloudFormer Amazon EC2 instance.