Skip to content
This repository was archived by the owner on Mar 1, 2020. It is now read-only.

Commit f24eeb5

Browse files
author
earthmant
committed
first commit
1 parent 7deb4b9 commit f24eeb5

3 files changed

Lines changed: 101 additions & 303 deletions

File tree

README.md

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11

2-
# VPC-Scenario2
3-
4-
Amazon's [VPC Scenario 2](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Scenario2.html) is the classic network architecture. It can support public-facing and private components.
2+
# Openstack Example Network
53

64
### Resources Created
75

8-
* A `vpc`.
9-
* An `internet_gateway`.
6+
* A `external_network`.
7+
* A `public_network`.
8+
* A `private_network`.
9+
* A `public_network_router`.
1010
* A `public_subnet`.
1111
* A `private_subnet`.
12-
* A `public_subnet_routetable`.
13-
* A `private_subnet_routetable`.
14-
* A `route_public_subnet_internet_gateway`.
15-
* A `nat_gateway_ip` - created with the `update-blueprint.yaml`.
16-
* A `nat_gateway` - created with the `update-blueprint.yaml`.
17-
* A `route_private_subnet_nat_gateway` - created with the `update-blueprint.yaml`.
1812

1913

2014
## Compatibility
@@ -27,38 +21,31 @@ Tested with:
2721

2822
Upload the required plugins:
2923

30-
* [AWSSDK Plugin](https://github.com/cloudify-incubator/cloudify-awssdk-plugin/releases).
24+
* [Openstack Plugin](https://github.com/cloudify-cosmo/cloudify-openstack-plugin/releases).
3125

3226
_Check the blueprint for the exact version of the plugin._
3327

3428

3529
If you do not provide your own `deployment inputs` below, you must add these secrets to your Cloudify Manager `tenant`:
3630

37-
* aws_access_key_id
38-
* aws_secret_access_key
39-
* ec2_region_name, such as `us-east-1`.
40-
* ec2_region_endpoint, such as `ec2.us-east-1.amazonaws.com`.
41-
* availability_zone, such as `us-east-1c`.
31+
* `keystone_username`
32+
* `keystone_password`
33+
* `keystone_tenant_name`
34+
* `keystone_url`
35+
* `region`, such as `RegionOne`.
4236

4337

4438
## Installation
4539

4640
On your Cloudify Manager, navigate to `Local Blueprints` select `Upload`.
4741

48-
[Right-click and copy URL](https://github.com/cloudify-examples/vpc-scenario2-blueprint/archive/master.zip). Paste where it says `Enter blueprint url`. Provide a blueprint name, such as `aws-vpc-scenario2` in the field labeled `blueprint name`. Select `simple-blueprint.yaml` from `Blueprint filename` menu.
42+
[Right-click and copy URL](https://github.com/cloudify-examples/openstack-example-network/archive/master.zip). Paste where it says `Enter blueprint url`. Provide a blueprint name, such as `examples-network` in the field labeled `blueprint name`. Select `simple-blueprint.yaml` from `Blueprint filename` menu.
4943

5044
After the new blueprint has been created, click the `Deploy` button.
5145

5246
Navigate to `Deployments`, find your new deployment, select `Install` from the `workflow`'s menu. At this stage, you may provide your own values for any of the default `deployment inputs`.
5347

5448

55-
## Update Deployment
56-
57-
In order to provide outbound internet access to the private subnet, you can update the deployment.
58-
59-
Navigate to `Deployments`, find your deployment, click on it. Once the deployment's page has loaded, click the `Update Deployment` button. [Right-click and copy URL](https://github.com/cloudify-examples/vpc-scenario2-blueprint/archive/master.zip). Paste where it says `Enter new blueprint url`. This time, select `update-blueprint.yaml` from `Blueprint filename` menu.
60-
61-
6249
## Uninstallation
6350

6451
Navigate to the deployment and select `Uninstall`. When the uninstall workflow is finished, select `Delete deployment`.

simple-blueprint.yaml

Lines changed: 89 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,145 +1,138 @@
11
tosca_definitions_version: cloudify_dsl_1_3
22

33
description: >
4-
Create an AWS VPC based on the Scenario 2 design.
4+
Create an Example Openstack Network.
55
66
imports:
77
- http://www.getcloudify.org/spec/cloudify/4.2/types.yaml
8-
- http://www.getcloudify.org/spec/awssdk-plugin/1.2.0.1/plugin.yaml
8+
- http://www.getcloudify.org/spec/openstack-plugin/2.5.2/plugin.yaml
99

1010
inputs:
1111

12-
aws_access_key_id:
13-
description: YOUR AWS ACCESS KEY ID
14-
default: { get_secret: aws_access_key_id }
12+
username:
13+
description: OS_USERNAME as specified in Openstack RC file.
14+
default: { get_secret: keystone_username }
1515

16-
aws_secret_access_key:
17-
description: YOUR AWS SECRET ACCESS KEY
18-
default: { get_secret: aws_secret_access_key }
16+
password:
17+
description: Openstack user password.
18+
default: { get_secret: keystone_password }
1919

20-
ec2_region_name:
21-
default: { get_secret: ec2_region_name }
20+
tenant_name:
21+
description: OS_TENANT_NAME as specified in Openstack RC file.
22+
default: { get_secret: keystone_tenant_name }
2223

23-
ec2_region_endpoint:
24-
default: { get_secret: ec2_region_endpoint }
24+
auth_url:
25+
description: OS_AUTH_URL as specified in Openstack RC file.
26+
default: { get_secret: keystone_url }
2527

26-
availability_zone:
27-
default: { get_secret: availability_zone }
28+
region:
29+
description: OS_REGION_NAME as specified in Openstack RC file.
30+
default: { get_secret: keystone_region }
2831

29-
vpc_cidr:
30-
default: 10.10.0.0/16
32+
external_network_name:
33+
description: Openstack tenant external network name.
34+
35+
nameservers:
36+
default: [8.8.4.4, 8.8.8.8]
3137

3238
public_subnet_cidr:
33-
default: 10.10.0.0/24
39+
default: 192.168.120.0/24
40+
41+
public_subnet_allocation_pools:
42+
default:
43+
- start: 192.168.120.2
44+
end: 192.168.120.254
3445

3546
private_subnet_cidr:
36-
default: 10.10.1.0/24
47+
default: 192.168.121.0/24
48+
49+
private_subnet_allocation_pools:
50+
default:
51+
- start: 192.168.121.2
52+
end: 192.168.121.254
3753

3854
dsl_definitions:
3955

40-
aws_config: &client_config
41-
aws_access_key_id: { get_input: aws_access_key_id }
42-
aws_secret_access_key: { get_input: aws_secret_access_key }
43-
region_name: { get_input: ec2_region_name }
56+
client_config: &client_config
57+
username: { get_input: username }
58+
password: { get_input: password }
59+
tenant_name: { get_input: tenant_name }
60+
auth_url: { get_input: auth_url }
61+
region: { get_input: region }
4462

4563
node_templates:
4664

47-
vpc:
48-
type: cloudify.nodes.aws.ec2.Vpc
65+
external_network:
66+
type: cloudify.openstack.nodes.Network
4967
properties:
50-
resource_config:
51-
kwargs:
52-
CidrBlock: { get_input: vpc_cidr }
53-
client_config: *client_config
68+
openstack_config: *client_config
69+
use_external_resource: true
70+
resource_id: { get_input: external_network_name }
5471

55-
internet_gateway:
56-
type: cloudify.nodes.aws.ec2.InternetGateway
72+
public_network:
73+
type: cloudify.openstack.nodes.Network
5774
properties:
58-
client_config: *client_config
59-
relationships:
60-
- type: cloudify.relationships.connected_to
61-
target: vpc
62-
63-
public_subnet:
64-
type: cloudify.nodes.aws.ec2.Subnet
65-
properties:
66-
resource_config:
67-
kwargs:
68-
CidrBlock: { get_input: public_subnet_cidr }
69-
AvailabilityZone: { get_input: availability_zone }
70-
client_config: *client_config
71-
relationships:
72-
- type: cloudify.relationships.depends_on
73-
target: vpc
74-
- type: cloudify.relationships.depends_on
75-
target: internet_gateway
75+
openstack_config: *client_config
7676

77-
private_subnet:
78-
type: cloudify.nodes.aws.ec2.Subnet
77+
private_network:
78+
type: cloudify.openstack.nodes.Network
7979
properties:
80-
resource_config:
81-
kwargs:
82-
CidrBlock: { get_input: private_subnet_cidr }
83-
AvailabilityZone: { get_input: availability_zone }
84-
client_config: *client_config
85-
relationships:
86-
- type: cloudify.relationships.depends_on
87-
target: vpc
88-
- type: cloudify.relationships.depends_on
89-
target: internet_gateway
80+
openstack_config: *client_config
9081

91-
public_subnet_routetable:
92-
type: cloudify.nodes.aws.ec2.RouteTable
82+
public_network_router:
83+
type: cloudify.openstack.nodes.Router
9384
properties:
94-
client_config: *client_config
85+
openstack_config: *client_config
9586
relationships:
96-
- type: cloudify.relationships.contained_in
97-
target: vpc
9887
- type: cloudify.relationships.connected_to
99-
target: public_subnet
88+
target: external_network
10089

101-
private_subnet_routetable:
102-
type: cloudify.nodes.aws.ec2.RouteTable
90+
public_subnet:
91+
type: cloudify.openstack.nodes.Subnet
10392
properties:
104-
client_config: *client_config
93+
openstack_config: *client_config
94+
subnet:
95+
ip_version: 4
96+
cidr: { get_input: public_subnet_cidr }
97+
dns_nameservers: { get_input: nameservers }
98+
allocation_pools: { get_input: public_subnet_allocation_pools }
10599
relationships:
106100
- type: cloudify.relationships.contained_in
107-
target: vpc
108-
- type: cloudify.relationships.connected_to
109-
target: private_subnet
101+
target: public_network
102+
- type: cloudify.openstack.subnet_connected_to_router
103+
target: public_network_router
110104

111-
route_public_subnet_internet_gateway:
112-
type: cloudify.nodes.aws.ec2.Route
105+
private_subnet:
106+
type: cloudify.openstack.nodes.Subnet
113107
properties:
114-
resource_config:
115-
kwargs:
116-
DestinationCidrBlock: '0.0.0.0/0'
117-
client_config: *client_config
108+
openstack_config: *client_config
109+
subnet:
110+
ip_version: 4
111+
cidr: { get_input: private_subnet_cidr }
112+
dns_nameservers: { get_input: nameservers }
113+
allocation_pools: { get_input: private_subnet_allocation_pools }
118114
relationships:
119115
- type: cloudify.relationships.contained_in
120-
target: public_subnet_routetable
121-
- type: cloudify.relationships.connected_to
122-
target: internet_gateway
123-
interfaces:
124-
cloudify.interfaces.lifecycle:
125-
stop: {}
116+
target: private_network
117+
- type: cloudify.openstack.subnet_connected_to_router
118+
target: public_network_router
126119

127120
outputs:
128121

129-
vpc_id:
130-
value: { get_attribute: [ vpc, aws_resource_id ] }
122+
external_network:
123+
value: { get_attribute: [ external_network, external_id ] }
131124

132-
public_subnet_id:
133-
value: { get_attribute: [ public_subnet, aws_resource_id ] }
125+
public_network_router:
126+
value: { get_attribute: [ public_network_router, external_id ] }
134127

135-
private_subnet_id:
136-
value: { get_attribute: [ private_subnet, aws_resource_id ] }
128+
public_network:
129+
value: { get_attribute: [ public_network, external_id ] }
137130

138-
ec2_region_name:
139-
value: { get_input: ec2_region_name }
131+
private_network:
132+
value: { get_attribute: [ private_network, external_id ] }
140133

141-
ec2_region_endpoint:
142-
value: { get_input: ec2_region_endpoint }
134+
public_subnet:
135+
value: { get_attribute: [ public_subnet, external_id ] }
143136

144-
availability_zone:
145-
value: { get_input: availability_zone }
137+
private_subnet:
138+
value: { get_attribute: [ private_subnet, external_id ] }

0 commit comments

Comments
 (0)