-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-instance.yaml
140 lines (118 loc) · 3.84 KB
/
test-instance.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
heat_template_version: 2021-04-16
parameters:
keypair:
type: string
constraints:
- custom_constraint: nova.keypair
flavor:
type: string
default: "t3.small"
constraints:
- custom_constraint: nova.flavor
image:
type: string
availability_zone:
type: string
host_port:
type: number
default: 80
description: Port used by hosts
api_branch:
type: string
description: Branch of traitecoevo/austraits_api to use for deployment
default: "master"
logstash_flavor:
type: string
constraints:
- custom_constraint: nova.flavor
default: "t3.xsmall"
logstash_image:
type: string
resources:
secgroup:
type: OS::Neutron::SecurityGroup
properties:
rules:
- remote_ip_prefix: 0.0.0.0/0
port_range_min: { get_param: host_port }
port_range_max: { get_param: host_port }
protocol: tcp
- remote_ip_prefix: 0.0.0.0/0
protocol: tcp
port_range_min: 22
port_range_max: 22
logstash_secgroup:
type: OS::Neutron::SecurityGroup
properties:
rules:
- remote_group_id: { get_resource: secgroup }
remote_mode: remote_group_id
protocol: tcp
port_range_min: 5044
port_range_max: 5044
- remote_ip_prefix: 0.0.0.0/0
protocol: tcp
port_range_min: 22
port_range_max: 22
wait_handle:
type: OS::Heat::WaitConditionHandle
wait_condition:
type: OS::Heat::WaitCondition
properties:
handle: { get_resource: wait_handle }
count: 2
timeout: 600
cloud_init:
type: cloud-init.yaml
properties:
logstash_host: { get_attr: [ logstash_server, first_address ] }
api_branch: { get_param: api_branch }
wc_notify: { get_attr: ["wait_handle", "curl_cli"] }
environment: { get_param: OS::stack_name }
server:
type: OS::Nova::Server
properties:
key_name: { get_param: keypair }
flavor: { get_param: flavor }
image: { get_param: image }
availability_zone: { get_param: availability_zone }
networks:
- allocate_network: auto
security_groups:
- { get_resource: secgroup }
user_data_format: SOFTWARE_CONFIG
user_data:
get_attr: [cloud_init, cloud_config]
logstash_cloud_init:
type: logstash/cloud-init.yaml
properties:
bucket: { get_resource: log_bucket }
wc_notify: { get_attr: ["wait_handle", "curl_cli"] }
logstash_server:
type: OS::Nova::Server
properties:
key_name: { get_param: keypair }
flavor: { get_param: logstash_flavor }
image: { get_param: logstash_image }
availability_zone: { get_param: availability_zone }
networks:
- allocate_network: auto
security_groups:
- { get_resource: logstash_secgroup }
user_data_format: SOFTWARE_CONFIG
user_data:
get_attr: [ logstash_cloud_init, cloud_config ]
random_string:
type: OS::Heat::RandomString
properties:
length: 16
log_bucket:
type: OS::Swift::Container
properties:
name: { list_join: ["-", ["austraits-api-logs", { get_param: OS::stack_name }, { get_resource: random_string }] ]}
outputs:
ip_address:
description: IP address of the deployed instance
value: { get_attr: [server, first_address] }
log_bucket:
value: { get_resource: log_bucket }