Modifying Blueprints

Overview

For this tutorial we will modify the number of virtual machines created by the tutorial blueprint, and convert some of the static properties like core count and memory size into variables. It is expected that you have completed the Deploying Infrastructure tutorial before you begin this tutorial.

To make these changes, we'll go through a typical modification workflow where we'll treat the environment you have just created as your PROD environment and from this clone a DEV environment

Goals

By completing this tutorial, you will learn to:

  • Create a Development Environment

  • Change the Blueprint

  • Test the Changes

  • Publish the Blueprint

  • Update your Production Environment

Clone your Tutorial Environment

Set up a development environment that is derived from your production environment:

Deploy the "development" Environment

You have not changed the blueprint yet, therefore when you apply this environment it will stand up another virtual machine environment. You typically want to apply the environment before you make changes because you can then use the "Preview" action after making changes to see what would happen.

Start Editing

To make a blueprint draft and begin editing:

Adding Variables

Paste in the following new variables just below the admin_public_key variable:

  vm_cores:
    description: Number of vCPUs for the VM(s).
    type: integer
    min: 1
    default: 2
  vm_memory:
    description: Amount of memory for the VM(s).
    type: string
    default: 4 GB
  vm_count:
    description: The number of VMs to provision.
    type: integer
    min: 1
    default: 1

In the compute.vm.example resource, make the following changes:

Once complete it should look like this:

Correct compute.vm.example changes

Notice that since we have modified the blueprint it is now considered a draft. The version at the top says 1.0 draft. If you click on that, a list of older versions appears. You can compare this draft with any older version using the compare action in this list.

Testing

Now that you have made some changes, you can preview those changes to see if they would effect any difference in your development environment:

Now try modifying the vm_count variable in the development environment, setting it to 2. After you do that:

Publishing

Assuming all jobs succeeded, we've made modifications and tested them, so we are ready to publish an update to this blueprint. Since the change is compatible with the previous version (all the variable defaults are the same as the static values from version 1.0), you can make the new version 1.1:

Now that a new version of the blueprint has been published, you can update the blueprint version used in your "production" environment:

Last updated

Was this helpful?