To model an Amazon Web Services (AWS) environment, log in with an AWS cloud project and
specify the AWS-specific information in a blueprint.
- Login to the Blueprint Designer.
- For Heat blueprints only:
-
Create the blueprint.
-
Add resources from the palette to the blueprint, such as virtual images.
-
Customize the blueprint source code for your configuration of AWS.
For example, you might have to change the mount points of volumes from defaults like
/dev/vdc
to specific locations like
/dev/xvdc
, as in the following
example:
linux_image_1_volume_1_attachment:
type: OS::Cinder::VolumeAttachment
properties:
volume_id: vol-4d4aaa04
instance_uuid: { get_resource: linux_image_1_volume_1_attachment }
mountpoint: /dev/xvdc
In another example, to ensure that nodes and volumes are created in the same zone, you
might need to update the
availability_zone
property to resources in the blueprint,
as in the following
example:
parameters:
availability_zone:
type: string
default: us-east-1d
description: Name of availability zone in which to create the instance
resources:
linux_image_A:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor }
image: "LinuxImageA"
key_name: { get_param: key_name }
name: "images/linux_image_A"
availability_zone: { get_param: availability_zone }
metadata:
ec2_properties:
access_id: ABC12345
secret_key: 67890DEF
linux_image_A_volumeA_attachment:
type: OS::Cinder::VolumeAttachment
properties:
volume_id: volumeA
instance_uuid: { get_resource: linux_image_A }
mountpoint: /dev/xvdc
metadata:
ec2_properties:
access_id: ABC12345
secret_key: 67890DEF
volumeA:
type: OS::Cinder::Volume
properties:
name: volumeA
availability_zone: { get_param: availability_zone }
size: 1
metadata:
ec2_properties:
access_id: ABC12345
secret_key: 67890DEF
For
more information, see the Amazon Web Services documentation.
- Optional:
In the blueprint source code, specify any additional core or extended properties for the
resources in the blueprint.
Specify core properties in the
properties
section of the resource code, as
in the following example:
linux_image_A:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor }
image: "LinuxImageA"
key_name: { get_param: key_name }
name: "images/linux_image_A"
availability_zone: { get_param: availability_zone }
Specify extended properties in the
metadata/ec2_properties
section of the
resource code, as in the following example. This example applies two tags to a virtual
image.
linux_image_A:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor }
image: "LinuxImageA"
key_name: { get_param: key_name }
name: "images/linux_image_A"
availability_zone: { get_param: availability_zone }
metadata:
ec2_properties:
cluster: blue
database_type: mysql
For information about the properties that are available for resource types, see
Heat resource types.
-
Create a configuration file and externalize properties to the file.
-
In the configuration file, ensure that the core OpenStack types are mapped to Amazon Elastic
Compute Cloud (EC2) types.
The configuration file must have mapping similar to the following
code:
resource_registry:
OS::Nova::Server : IBM::EC2::Server
OS::Cinder::Volume : IBM::EC2::Volume
OS::Cinder::VolumeAttachment : IBM::EC2::VolumeAttachment
OS::Neutron::Port : IBM::EC2::Port
OS::Neutron::Net : IBM::EC2::VPC
OS::Neutron::Subnet : IBM::EC2::Subnet
OS::Neutron::Router : IBM::EC2::RouteTable
OS::Neutron::RouterGateway : IBM::EC2::InternetGateway
OS::Neutron::RouterInterface : IBM::EC2::RouteTableAssociation
Add the components of your application to the blueprint. See Deploying components with blueprints.