This repository has been archived by the owner on Oct 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pillar.example
273 lines (257 loc) · 7.9 KB
/
pillar.example
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
aws:
## AWS authentication details
security:
accountid: XXXXXXXXXXXX
keyid: AKIAIXXXXXXXXXXXXXXX
key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
region: eu-west-1
## AWS services
services:
## Amazon S3 buckets
s3:
buckets:
my-salt-created-bucket:
LocationConstraint: EU
Policy:
Version: "2012-10-17"
Statement:
- Sid: "String"
Effect: "Allow"
Principal:
AWS: "arn:aws:iam::XXXXXXXXXXXX:root"
Action: "s3:PutObject"
Resource: "arn:aws:s3:::XXXXXXXXX/*"
Website:
ErrorDocument:
Key: "error.html"
IndexDocument:
Suffix: "index.html"
Tagging:
Environment: Acceptance
Service: 'Asset Storage'
ProvisionedBy: 'Salt'
## Amazon Elastic Compute
ec2:
# Available SSH keys
ssh_keys:
[email protected]: 'ssh-rsa XXXXXXXXXXXXXXX [email protected]'
# Available EC2 instances
instances:
webserver.example.com:
instance_type: t2.micro
image_id: ami-6f587e1c
key_name: [email protected]
vpc_id: vpc-aaa00000
subnet_id: subnet-12345678
private_ip_address: 192.168.1.25
disable_api_termination: True
allocate_eip: False
tags:
Environment: Acceptance
Service: 'Webserver'
ProvisionedBy: 'Salt'
security_group_ids:
- sg-1234567
block_device_map:
/dev/sda1:
volume_type: gp2
size: 15
delete_on_termination: True
tags:
Name: OS - %hostname%
DiskType: OS
/dev/sdf:
size: 20
volume_type: gp2
delete_on_termination: False
encrypted: True
tags:
Name: Data - %hostname%
DiskType: Data
## Amazon Relational Database Service (RDS)
rds:
instances:
my-rds-test-server:
region: eu-west-1
availability_zone: eu-west-1c
storage_type: gp2
engine: mariadb
engine_version: 10.1.19
storage_encrypted: False
kms_keyid: 11111111-2222-3333-4444-555555555555
copy_tags_to_snapshot: True
publicly_accessible: False
# Env specific settings
name: my-rds-test-server
allocated_storage: 5
db_instance_class: db.t2.micro
db_name: database_test
master_username: root
master_user_password: mastermaster
db_subnet_group_name: 'acc subnet group'
multi_az: False
backup_retention_period: 7
auto_minor_version_upgrade: True
option_group_name: acceptance-mariadb-10-1
tags:
Environment: Acceptance
Service: 'Database'
ProvisionedBy: 'Salt'
vpc_security_group_ids:
- 'rds acceptance'
## Amazon Elastic Loadbalancer
elb:
loadbalancers:
example-lb-acc:
instances_ids:
- i-111111
- i-222222
availability_zones:
- eu-west-1a
- eu-west-1b
- eu-west-1c
listeners:
- elb_port: 443
instance_port: 80
elb_protocol: HTTPS
instance_protocol: HTTP
certificate: 'arn:aws:iam::1234567891234:server-certificate/example-lb'
policies:
- my-ssl-policy
- cookie-policy
- elb_port: 80
instance_port: 80
elb_protocol: HTTP
policies:
- cookie-policy
backends:
- instance_port: 80
policies:
- enable-proxy-protocol
health_check:
target: 'HTTP:80/'
attributes:
cross_zone_load_balancing:
enabled: true
access_log:
enabled: true
s3_bucket_name: 'mybucket'
s3_bucket_prefix: 'my-logs'
emit_interval: 5
connecting_settings:
idle_timeout: 60
security_groups:
- Allow incoming web traffic
policies:
- policy_name: my-ssl-policy
policy_type: SSLNegotiationPolicyType
policy:
Protocol-TLSv1.2: true
Protocol-SSLv3: false
Server-Defined-Cipher-Order: true
ECDHE-ECDSA-AES128-GCM-SHA256: true
- policy_name: cookie-policy
policy_type: LBCookieStickinessPolicyType
- policy_name: enable-proxy-protocol
policy_type: ProxyProtocolPolicyType
policy:
ProxyProtocol: true
## Amazon lambda
functions:
example-function:
FunctionName: example-function
Runtime: python2.7
Role: run_example_function
Handler: main
ZipFile: salt://files/example-function.zip
Description: "Do some example stuff"
Timeout: 10
MemorySize: 128
Triggers:
- ScheduleExpression: 'cron(0 5,17 ? * MON-FRI *)'
State: 'ENABLED'
## Amazon IAM
iam:
users:
myuser:
- policies:
mypolicy: |
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "*",
"Resource": "*"}]
}
- password: NewPassword$$1
groups:
mygroup:
- users:
- myuser
- myuser1
- policies:
mypolicy: |
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "*",
"Resource": "*"}]
}
certificates:
MyCertificate:
- public_key: salt://base/mycert.crt
- private_key: salt://base/mycert.key
- cert_chain: salt://base/mycert_chain.crt
policies:
MyPolicy:
- policy_document: '{"MyPolicy": "Statement": [{"Action": ["sqs:*"], "Effect": "Allow", "Resource": ["arn:aws:sqs:*:*:*"], "Sid": "MyPolicySqs1"}]}'
## Amazon IAM Roles
iam_role:
roles:
MyRole:
policies:
MyPolicy:
Statement:
- Action:
- 'ec2:DescribeInstances'
- 'ec2:StopInstances'
- 'ec2:StartInstances'
Effect: Allow
Resource:
- '*'
Sid: Stmt1453628436000
Condition:
StringEquals:
"ec2:ResourceTag/Environment":
- Test
## Cloudwatch Events
cloudwatch_event:
events:
DoFunkyStuff:
ScheduleExpression: 'cron(0 9,17 ? * MON-FRI *)'
State: 'ENABLED'
Description: 'Does some funky stuff during business hours.'
Targets:
- Id: "DoFunkyStuff"
Arn: "arn:aws:lambda:eu-west-1:123456789000:function:DoFunkyStuff"
## Securitygroups
securitygroup:
groups:
AllowIncomingHTTP:
description: Allows incoming HTTP traffic
vpc_id: vpc-1234567
rules:
- ip_protocol: tcp
from_port: 80
to_port: 80
cidr_ip:
- 0.0.0.0/0
rules_egress:
- ip_protocol: all
from_port: -1
to_port: -1
cidr_ip:
- 0.0.0.0/0
tags:
Environment: Production