-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathssm_documents.yml
77 lines (77 loc) · 3.67 KB
/
ssm_documents.yml
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
---
AWSTemplateFormatVersion: '2010-09-09'
Description: |
SSM sample
Resources:
CustomApplications:
Type: "AWS::SSM::Document"
Properties:
DocumentType: "Command"
Content:
schemaVersion: "1.2"
description: "Additional Packages"
runtimeConfig:
aws:runShellScript:
properties:
- id: 0.aws:runShellScript
runCommand:
- REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e "s/.$//g")
- INSTANCEID=$(/usr/bin/curl -s http://169.254.169.254/latest/meta-data/instance-id)
- ITEMS=$(curl https://raw.githubusercontent.com/amimoto-ami/ssm_inventry_resources/master/packages.sh | bash)
- aws ssm put-inventory --instance-id "${INSTANCEID}" --items "$(echo ${ITEMS})" --region "${REGION}"
workingDirectory: "/"
timeoutSeconds: "300"
GetAllWpVersion:
Type: "AWS::SSM::Document"
Properties:
DocumentType: "Command"
Content:
schemaVersion: "1.2"
description: "List Installed WordPress Versions"
runtimeConfig:
aws:runShellScript:
properties:
- id: 0.aws:runShellScript
runCommand:
- REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e "s/.$//g")
- INSTANCEID=$(/usr/bin/curl -s http://169.254.169.254/latest/meta-data/instance-id)
- ITEMS=$(curl https://raw.githubusercontent.com/amimoto-ami/ssm_inventry_resources/master/wordpress_versions.sh | bash)
- aws ssm put-inventory --instance-id "${INSTANCEID}" --items "$(echo ${ITEMS})" --region "${REGION}"
workingDirectory: "/var/www/vhosts/"
timeoutSeconds: "300"
ListNginxDomains:
Type: "AWS::SSM::Document"
Properties:
DocumentType: "Command"
Content:
schemaVersion: "1.2"
description: "List nginx defined domain lists"
runtimeConfig:
aws:runShellScript:
properties:
- id: 0.aws:runShellScript
runCommand:
- REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e "s/.$//g")
- INSTANCEID=$(/usr/bin/curl -s http://169.254.169.254/latest/meta-data/instance-id)
- ITEMS=$(curl https://raw.githubusercontent.com/amimoto-ami/ssm_inventry_resources/master/nginx_ssl_domains.sh | bash)
- aws ssm put-inventory --instance-id "${INSTANCEID}" --items "$(echo ${ITEMS})" --region "${REGION}"
workingDirectory: "/etc/nginx/conf.d/"
timeoutSeconds: "300"
WordPressDiskUsageAmount:
Type: "AWS::SSM::Document"
Properties:
DocumentType: "Command"
Content:
schemaVersion: "1.2"
description: "Get WordPress disk usage amount"
runtimeConfig:
aws:runShellScript:
properties:
- id: 0.aws:runShellScript
runCommand:
- REGION=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e "s/.$//g")
- INSTANCEID=$(/usr/bin/curl -s http://169.254.169.254/latest/meta-data/instance-id)
- ITEMS=$(curl https://raw.githubusercontent.com/amimoto-ami/ssm_inventry_resources/master/wordpress_disk_usage_amount.sh | bash)
- aws ssm put-inventory --instance-id "${INSTANCEID}" --items "$(echo ${ITEMS})" --region "${REGION}"
workingDirectory: "/var/www/vhosts/"
timeoutSeconds: "300"