-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrustgrid_local_tf.yaml
204 lines (182 loc) · 6.3 KB
/
trustgrid_local_tf.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
tosca_definitions_version: cloudify_dsl_1_3
description: Trustgrid deployment using Terraform
imports:
- http://cloudify.co/spec/cloudify/6.3.0/types.yaml
- plugin:cloudify-terraform-plugin
inputs:
deployment_version:
type: string
display_label: Deployment version
default: trustgrid-dev
description: |
The version of Trustgrid deployment. Accepted values are:
trustgrid-dev,
trustgrid-prod.
constraints:
- valid_values:
- "trustgrid-dev"
- "trustgrid-prod"
aws_region:
type: string
display_label: AWS Region
default: "us-west-2"
description: AWS Region to deploy the infrastructure into.
constraints:
- valid_values:
- us-east-1
- us-east-2
- us-west-1
- us-west-2
- eu-central-1
- eu-west-1
- eu-west-2
- eu-south-1
- eu-west-3
- eu-north-1
- af-south-1
- ap-east-1
- ap-south-1
- ap-northeast-3
- ap-northeast-2
- ap-southeast-1
- ap-southeast-2
- ap-northeast-1
- ca-central-1
- cn-north-1
- cn-northwest-1
- me-south-1
- sa-east-1
certificate-private_key:
type: string
display_label: Certificate Private Key
default: { get_secret: certificate-private_key }
certificate-ssc:
type: string
display_label: Certificate SSC
default: { get_secret: certificate-ssc }
certificate-ca_bundle:
type: string
display_label: Certificate CA Bundle
default: { get_secret: certificate-ca_bundle }
aws_vpc_ssh_public_key_prod:
type: string
display_label: AWS VPC Public Key Prod
description: >
SSH Public Key for VPC in AWS. Valid only when 'trustgrid-prod'
deployment version chosen. Otherwise ignored.
default: { get_secret: aws_vpc_ssh_public_key_prod }
aws_vpc_ssh_public_key_dev:
type: string
display_label: AWS VPC Public Key Dev
description: >
SSH Public Key for VPC in AWS. Valid only when 'trustgrid-dev'
deployment version chosen. Otherwise ignored.
default: { get_secret: aws_vpc_ssh_public_key_dev }
node_license-prod-01:
type: string
display_label: Node License - Prod 01
description: >
Node license for production node. Valid only when 'trustgrid-prod'
deployment version chosen. Otherwise ignored.
default: { get_secret: node_license-prod }
node_license-prod-02:
type: string
display_label: Node License - Prod 02
description: >
Node license for production node. Valid only when 'trustgrid-prod'
deployment version chosen. Otherwise ignored.
default: { get_secret: node_license-prod }
node_license-dev-01:
type: string
display_label: Node License - Dev 01
description: >
Node license for development node. Valid only when 'trustgrid-dev'
deployment version chosen. Otherwise ignored.
default: { get_secret: node_license-dev }
node_license-dev-02:
type: string
display_label: Node License - Dev 02
description: >
Node license for development node. Valid only when 'trustgrid-dev'
deployment version chosen. Otherwise ignored.
default: { get_secret: node_license-dev }
aws_access_key_id:
type: string
hidden: true
default: { get_secret: aws_access_key_id }
aws_secret_access_key:
type: string
hidden: true
default: { get_secret: aws_secret_access_key }
node_templates:
terraform:
type: cloudify.nodes.terraform
properties:
resource_config:
use_existing_resource: false
# terraform_login_token:
# type: cloudify.nodes.Root
# interfaces:
# cloudify.interfaces.lifecycle:
# start:
# implementation: trustgrid/scripts/store_terraform_token.sh
# executor: central_deployment_agent
# inputs:
# terraform_token: { get_secret: terraform_token }
# stop:
# implementation: trustgrid/scripts/remove_terraform_token.sh
# executor: central_deployment_agent
# relationships:
# - type: cloudify.relationships.depends_on
# target: terraform
trustgrid:
type: cloudify.nodes.terraform.Module
properties:
resource_config:
source:
location: trustgrid/resources/iac-private_cloud-main.zip
source_path:
concat:
- "iac-private_cloud-main/"
- { get_input: deployment_version }
environment_variables:
AWS_ACCESS_KEY_ID: { get_input: aws_access_key_id }
AWS_SECRET_ACCESS_KEY: { get_input: aws_secret_access_key }
AWS_DEFAULT_REGION: { get_input: aws_region }
variables:
aws_region: { get_input: aws_region }
certificate-private_key: { get_input: certificate-private_key }
certificate-ssc: { get_input: certificate-ssc }
certificate-ca_bundle: { get_input: certificate-ca_bundle }
aws_vpc_ssh_public_key_prod: { get_input: aws_vpc_ssh_public_key_prod }
aws_vpc_ssh_public_key_dev: { get_input: aws_vpc_ssh_public_key_dev }
node_license-prod-01: { get_input: node_license-prod-01 }
node_license-prod-02: { get_input: node_license-prod-02 }
node_license-dev-01: { get_input: node_license-dev-01 }
node_license-dev-02: { get_input: node_license-dev-02 }
relationships:
- target: terraform
type: cloudify.terraform.relationships.run_on_host
# - target: terraform_login_token
# type: cloudify.relationships.depends_on
# trustgrid_api:
# type: cloudify.nodes.ServiceComponent
# properties:
# resource_config:
# blueprint:
# external_resource: false
# id: trustgrid_api
# blueprint_archive: https://github.com/Cloudify-PS/level3av-poc/archive/refs/heads/main.zip
# main_file_name: trustgrid_api.yaml
# deployment:
# id: trustgrid_api
# auto_inc_suffix: false
# inputs:
# rest_endpoint: { get_input: rest_endpoint }
# user_id: { get_input: user_id }
# new_user: { get_input: new_user }
# new_user_name: { get_input: new_user_name }
# new_user_email: { get_input: new_user_email }
# relationships:
# - type: cloudify.relationships.depends_on
# target: trustgrid