/
aws-blueprint.yaml
83 lines (75 loc) · 2.69 KB
/
aws-blueprint.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
tosca_definitions_version: cloudify_dsl_1_3
imports:
- https://cloudify.co/spec/cloudify/6.2.0/types.yaml
- plugin:cloudify-terraform-plugin?version= >=0.15.0
- https://raw.githubusercontent.com/cloudify-community/eaas-example/master/utils/custom_types.yaml
labels:
csys-obj-type:
values:
- service
inputs:
cloud_credentials:
type: cloud_credentials
resource_config:
type: dict
network_deployment_id:
type: string
default: ''
resource_prefix:
type: string
description: |
If not provided, it will be auto-generated.
default: ''
constraints:
- pattern: '(^ *$)|(^[a-zA-Z][a-zA-Z0-9]+$)'
data_types:
cloud_credentials:
properties:
aws_access_key_id:
type: string
default: { get_environment_capability: [cloud_credentials, aws_access_key_id] }
aws_keypair:
type: string
default: { get_environment_capability: [cloud_credentials, aws_keypair] }
aws_secret_access_key:
type: string
default: { get_environment_capability: [cloud_credentials, aws_secret_access_key] }
public_key_content:
type: string
default: { get_environment_capability: [cloud_credentials, public_key_content] }
private_key_content:
type: string
default: { get_environment_capability: [cloud_credentials, private_key_content] }
region_name:
type: string
default: { get_environment_capability: [cloud_credentials, region_name] }
node_templates:
prefix:
type: eaas.nodes.UniquePrefixGenerator
properties:
predefined_value: { get_input: resource_prefix }
terraform:
type: cloudify.nodes.terraform
properties:
resource_config:
installation_source: https://releases.hashicorp.com/terraform/0.14.3/terraform_0.14.3_linux_amd64.zip
terraform_module:
type: cloudify.nodes.terraform.Module
properties:
resource_config:
environment_variables:
AWS_ACCESS_KEY_ID: { get_input: [ cloud_credentials, aws_access_key_id ] }
AWS_SECRET_ACCESS_KEY: { get_input: [ cloud_credentials, aws_secret_access_key ] }
variables:
bucket_name: { concat: [ { get_attribute: [ prefix, value ] }, bucket ] }
bucket_region: { get_input: [cloud_credentials, region_name ] }
source:
location: templates/tf-bucket-master.zip
relationships:
- target: prefix
type: cloudify.relationships.depends_on
- target: terraform
type: cloudify.terraform.relationships.run_on_host
capabilities:
bucket_url:
value: { concat: [ 'https://', { get_attribute: [ terraform_module, resources, bucket, instances, 0, attributes, bucket_regional_domain_name ] } ] }