-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcloudformation.yml.tpl
92 lines (92 loc) · 3 KB
/
cloudformation.yml.tpl
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
Resources:
distConfig:
Type: AWS::ImageBuilder::DistributionConfiguration
Properties:
Name: ${name} - Distribution Config
%{~ if description != null ~}
Description: ${description}
%{~ endif ~}
Distributions:
%{~ for region in regions ~}
- AmiDistributionConfiguration:
Name: '${image_name}-{{ imagebuilder:buildDate }}'
%{~ if description != null ~}
Description: ${description}
%{~ endif ~}
AmiTags:
${ indent(14, chomp(yamlencode(tags))) }
%{~ if public == true || chomp(yamlencode(shared_account_ids)) != "[]" ~}
LaunchPermissionConfiguration:
%{~ if public == false ~}
UserIds:
${ indent(16, chomp(yamlencode(shared_account_ids))) }
%{~ else ~}
UserGroups:
- all
%{~ endif ~}
%{~ endif ~}
%{~ if license_config_arns != null ~}
LicenseConfigurationArns:
${ indent(12, chomp(yamlencode(license_config_arns)))}
%{~ endif ~}
Region: ${region}
%{~ endfor ~}
Tags:
${ indent(8, chomp(yamlencode(tags))) }
infraConfig:
Type: AWS::ImageBuilder::InfrastructureConfiguration
Properties:
Name: ${name}-infrastructure-configuration
%{~ if description != null ~}
Description: ${description}
%{~ endif ~}
InstanceProfileName: ${instance_profile}
%{~ if instance_types != null ~}
InstanceTypes:
${ indent(8, chomp(yamlencode(instance_types))) }
%{~ endif ~}
%{~ if key_pair != null ~}
KeyPair: ${key_pair}
%{~ endif ~}
%{~ if log_bucket != null ~}
Logging:
S3Logs:
S3BucketName: ${log_bucket}
%{~ if log_prefix != null ~}
S3KeyPrefix: ${log_prefix}
%{~ endif ~}
%{~ endif ~}
%{~ if security_group_ids != null ~}
SecurityGroupIds:
${ indent(8, chomp(yamlencode(security_group_ids))) }
%{~ endif ~}
%{~ if sns_topic_arn != null ~}
SnsTopicArn: ${sns_topic_arn}
%{~ endif ~}
%{~ if subnet != null ~}
SubnetId: ${subnet}
%{~ endif ~}
Tags:
${ indent(8, chomp(yamlencode(tags))) }
TerminateInstanceOnFailure: ${terminate_on_failure}
imageBuildPipeline:
Type: AWS::ImageBuilder::ImagePipeline
Properties:
Name: ${name}
%{~ if description != null ~}
Description: ${description}
%{~ endif ~}
DistributionConfigurationArn: !Ref "distConfig"
ImageRecipeArn: ${recipe_arn}
ImageTestsConfiguration:
${ indent(8, chomp(yamlencode(test_config))) }
InfrastructureConfigurationArn: !Ref "infraConfig"
Schedule:
${ indent(8, chomp(yamlencode(schedule))) }
Status: ${status}
Tags:
${ indent(8, chomp(yamlencode(tags))) }
Outputs:
PipelineArn:
Description: ARN of the created component
Value: !Ref "imageBuildPipeline"