├── .gitignore
├── 1st-UserData_Linux.sh
├── 1st-UserData_WindowsServer.ps1
├── 2nd-Decision_Linux-Distribution.sh
├── 2nd-Decision_WindowsServer-Version.ps1
├── 3rd-Bootstrap_AlmaLinux-v8-HVM.sh
├── 3rd-Bootstrap_AlmaLinux-v9-HVM.sh
├── 3rd-Bootstrap_AmazonLinux-1-HVM.sh
├── 3rd-Bootstrap_AmazonLinux-2-LTS-HVM.sh
├── 3rd-Bootstrap_AmazonLinux-2023-HVM.sh
├── 3rd-Bootstrap_CentOS-v10-HVM.sh
├── 3rd-Bootstrap_CentOS-v6-HVM.sh
├── 3rd-Bootstrap_CentOS-v7-HVM.sh
├── 3rd-Bootstrap_CentOS-v8-HVM.sh
├── 3rd-Bootstrap_CentOS-v9-HVM.sh
├── 3rd-Bootstrap_Debian-10-HVM.sh
├── 3rd-Bootstrap_Debian-11-HVM.sh
├── 3rd-Bootstrap_Debian-12-HVM.sh
├── 3rd-Bootstrap_Debian-9-HVM.sh
├── 3rd-Bootstrap_Fedora-HVM.sh
├── 3rd-Bootstrap_Kali-Linux-HVM.sh
├── 3rd-Bootstrap_OpenSUSE-HVM.sh
├── 3rd-Bootstrap_OracleLinux-v6-HVM.sh
├── 3rd-Bootstrap_OracleLinux-v7-HVM.sh
├── 3rd-Bootstrap_OracleLinux-v8-HVM.sh
├── 3rd-Bootstrap_OracleLinux-v9-HVM.sh
├── 3rd-Bootstrap_Photon-3-HVM.sh
├── 3rd-Bootstrap_RHEL-v10-HVM.sh
├── 3rd-Bootstrap_RHEL-v6-HVM.sh
├── 3rd-Bootstrap_RHEL-v7-HVM.sh
├── 3rd-Bootstrap_RHEL-v8-HVM.sh
├── 3rd-Bootstrap_RHEL-v9-HVM.sh
├── 3rd-Bootstrap_RockyLinux-v8-HVM.sh
├── 3rd-Bootstrap_RockyLinux-v9-HVM.sh
├── 3rd-Bootstrap_SLES-v12-HVM.sh
├── 3rd-Bootstrap_SLES-v15-HVM.sh
├── 3rd-Bootstrap_Ubuntu-16.04-LTS-HVM.sh
├── 3rd-Bootstrap_Ubuntu-18.04-LTS-HVM.sh
├── 3rd-Bootstrap_Ubuntu-20.04-LTS-HVM.sh
├── 3rd-Bootstrap_Ubuntu-22.04-LTS-HVM.sh
├── 3rd-Bootstrap_Ubuntu-24.04-LTS-HVM.sh
├── 3rd-Bootstrap_WindowsServer-Modern.ps1
├── 3rd-Bootstrap_WindowsServer-Regacy.ps1
├── 4th-Cleanup_Linux.sh
├── 4th-Cleanup_WindowsServer.ps1
├── Config_AmazonCloudWatchAgent
├── AmazonCloudWatchAgent_AlmaLinux-v8-HVM.json
├── AmazonCloudWatchAgent_AlmaLinux-v9-HVM.json
├── AmazonCloudWatchAgent_AmazonLinux-1-HVM.json
├── AmazonCloudWatchAgent_AmazonLinux-2-LTS-HVM.json
├── AmazonCloudWatchAgent_AmazonLinux-2023-HVM.json
├── AmazonCloudWatchAgent_CentOS-v10-HVM.json
├── AmazonCloudWatchAgent_CentOS-v6-HVM.json
├── AmazonCloudWatchAgent_CentOS-v7-HVM.json
├── AmazonCloudWatchAgent_CentOS-v8-HVM.json
├── AmazonCloudWatchAgent_CentOS-v9-HVM.json
├── AmazonCloudWatchAgent_Debian-10-HVM.json
├── AmazonCloudWatchAgent_Debian-11-HVM.json
├── AmazonCloudWatchAgent_Debian-12-HVM.json
├── AmazonCloudWatchAgent_Debian-9-HVM.json
├── AmazonCloudWatchAgent_Kali-Linux-HVM.json
├── AmazonCloudWatchAgent_OpenSUSE-HVM.json
├── AmazonCloudWatchAgent_OracleLinux-v6-HVM.json
├── AmazonCloudWatchAgent_OracleLinux-v7-HVM.json
├── AmazonCloudWatchAgent_OracleLinux-v8-HVM.json
├── AmazonCloudWatchAgent_OracleLinux-v9-HVM.json
├── AmazonCloudWatchAgent_RHEL-v10-HVM.json
├── AmazonCloudWatchAgent_RHEL-v6-HVM.json
├── AmazonCloudWatchAgent_RHEL-v7-HVM.json
├── AmazonCloudWatchAgent_RHEL-v8-HVM.json
├── AmazonCloudWatchAgent_RHEL-v9-HVM.json
├── AmazonCloudWatchAgent_RockyLinux-v8-HVM.json
├── AmazonCloudWatchAgent_RockyLinux-v9-HVM.json
├── AmazonCloudWatchAgent_SLES-v12-HVM.json
├── AmazonCloudWatchAgent_SLES-v15-HVM.json
├── AmazonCloudWatchAgent_Ubuntu-16.04-LTS-HVM.json
├── AmazonCloudWatchAgent_Ubuntu-18.04-LTS-HVM.json
├── AmazonCloudWatchAgent_Ubuntu-20.04-LTS-HVM.json
├── AmazonCloudWatchAgent_Ubuntu-22.04-LTS-HVM.json
├── AmazonCloudWatchAgent_Ubuntu-24.04-LTS-HVM.json
├── AmazonCloudWatchAgent_WindowsServer-2008R2.json
├── AmazonCloudWatchAgent_WindowsServer-2012.json
├── AmazonCloudWatchAgent_WindowsServer-2012R2.json
├── AmazonCloudWatchAgent_WindowsServer-2016.json
├── AmazonCloudWatchAgent_WindowsServer-2019.json
├── AmazonCloudWatchAgent_WindowsServer-2022.json
└── AmazonCloudWatchAgent_WindowsServer-2025.json
├── LICENSE
├── Miscellaneous
├── Information
│ ├── [Infomation] Amazon Web Services - Discussion Forums - Forum Announcements - RSS-Feed.md
│ ├── [Infomation] Amazon Web Services - Service Status - RSS-Feed.md
│ └── [Infomation] Amazon WorkSpaces & Amazon AppStream 2.0.md
├── Work-bastion-server
│ ├── 1st-UserData_Linux.sh
│ ├── 2nd-Decision_Linux-Distribution.sh
│ ├── 3rd-Bootstrap_BastionServer_AmazonLinux-HVM.sh
│ ├── 3rd-Bootstrap_BastionServer_CentOS-v7-HVM.sh
│ ├── 3rd-Bootstrap_BastionServer_RHEL-v7-HVM.sh
│ └── 3rd-Bootstrap_BastionServer_Ubuntu-16.04-LTS-HVM.sh
├── Work-network-driver
│ ├── Install_Linux_NetworkDriver_AWS_ena.sh
│ └── Install_Linux_NetworkDriver_Intel_ixgbevf.sh
├── Work-reposync
│ └── reposync_RHEL-v6.sh
└── Workaround
│ ├── 20230506_3rd-Bootstrap_WindowsServer.ps1
│ ├── 3rd-Bootstrap_AmazonLinux-HVM.sh
│ ├── 3rd-Bootstrap_Fedora-HVM.sh
│ ├── AmazonLinux-HVM_Embulk-bootstrap.sh
│ ├── AmazonLinux-HVM_FreeRADIUS-Client-bootstrap.sh
│ ├── Bootstrap_AmazonLinux-HVM_Developer.sh
│ ├── Bootstrap_CentOS-v7-HVM_Developer.sh
│ ├── CentOS-v7-HVM_Custom_bootstrap.sh
│ ├── List-Application-Linux-yum.sh
│ ├── List-Application-Windows.ps1
│ ├── Package
│ └── rh-amazon-rhui-client-els-3.0.39-1.el6.noarch.rpm
│ ├── RHEL-v6-HVM_Custom_bootstrap.sh
│ ├── RHEL-v6-HVM_workaround-ExtendedDisk_bootstrap.sh
│ ├── RHEL-v7-HVM_Custom_bootstrap.sh
│ ├── RHEL-v7-HVM_workaround-ExtendedDisk_bootstrap.sh
│ └── WindowsServer2012R2-Base-Japan-HVM_Custom_bootstrap.ps1
├── README.md
└── Workloads
├── Archive
└── Dataiku-v12_on_Oracle-Linux-v8.sh
├── Dataiku-v13_on_Oracle-Linux-v9.sh
├── GitLab-v17_on_Oracle-Linux-v9.sh
├── Oracle-Database-23ai_on_Oracle-Linux-v9.sh
└── Zabbix-Server-v7_on_Oracle-Linux-v9.sh
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | .vscode/settings.json
3 |
--------------------------------------------------------------------------------
/1st-UserData_Linux.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -v
2 |
3 | # Logger
4 | exec > >(tee /var/log/user-data_1st-userdata.log || logger -t user-data -s 2> /dev/console) 2>&1
5 |
6 | #-------------------------------------------------------------------------------
7 | # Parameter Settings
8 | #-------------------------------------------------------------------------------
9 |
10 | # Parameter Settings(Script)
11 | DecisionScript="https://raw.githubusercontent.com/usui-tk/amazon-ec2-userdata/master/2nd-Decision_Linux-Distribution.sh"
12 |
13 | # Parameter file Settings
14 | cat > /tmp/userdata-parameter << __EOF__
15 | # Language [ja_JP.UTF-8],[en_US.UTF-8]
16 | Language="en_US.UTF-8"
17 |
18 | # Timezone [Asia/Tokyo],[UTC]
19 | Timezone="Asia/Tokyo"
20 |
21 | # VPC Network [IPv4],[IPv6]
22 | VpcNetwork="IPv4"
23 | __EOF__
24 |
25 | #-------------------------------------------------------------------------------
26 | # Select Script Execute
27 | #-------------------------------------------------------------------------------
28 |
29 | cd /tmp
30 |
31 | # Download Decision_Linux-Distribution.sh
32 | if [ $(compgen -ac | sort | uniq | grep -x curl) ]; then
33 | curl --retry 5 --output Decision_Linux-Distribution.sh ${DecisionScript}
34 | elif [ $(compgen -ac | sort | uniq | grep -x wget) ]; then
35 | wget --tries=5 --no-check-certificate --output-document=Decision_Linux-Distribution.sh ${DecisionScript}
36 | else
37 | echo "Unsupported curl/wget command"
38 | exit 1
39 | fi
40 |
41 | # Execute Decision_Linux-Distribution.sh
42 | chmod 700 Decision_Linux-Distribution.sh
43 |
44 | bash -x Decision_Linux-Distribution.sh
45 |
46 | #-------------------------------------------------------------------------------
47 | # End of File
48 | #-------------------------------------------------------------------------------
49 |
--------------------------------------------------------------------------------
/1st-UserData_WindowsServer.ps1:
--------------------------------------------------------------------------------
1 |
2 | # Parameter Settings(Script)
3 | Set-Variable -Name DecisionScript -Option Constant -Scope Script -Value "https://raw.githubusercontent.com/usui-tk/amazon-ec2-userdata/master/2nd-Decision_WindowsServer-Version.ps1"
4 |
5 | # Bootstrap Script Executite
6 |
7 | Set-Location -Path "$Env:SystemRoot\Temp"
8 |
9 | Invoke-WebRequest -Uri $DecisionScript -UseBasicParsing -OutFile 2nd-Decision_WindowsServer-Version.ps1
10 |
11 | powershell.exe -ExecutionPolicy Bypass .\2nd-Decision_WindowsServer-Version.ps1 -SkipNetworkProfileCheck
12 |
13 |
--------------------------------------------------------------------------------
/2nd-Decision_WindowsServer-Version.ps1:
--------------------------------------------------------------------------------
1 | ########################################################################################################################
2 | #.SYNOPSIS
3 | #
4 | # Amazon EC2 Decision Script - 2nd Decision
5 | #
6 | #.DESCRIPTION
7 | #
8 | # Uses option settings to Windows Server Configuration
9 | #
10 | #.NOTES
11 | #
12 | # Target Windows Server OS Version and Processor Architecture (64bit Only)
13 | #
14 | # - 6.1 : Windows Server 2008 R2 (Microsoft Windows Server 2008 R2 SP1 [Datacenter Edition])
15 | # [Windows_Server-2008-R2_SP1-Japanese-64Bit-Base-YYYY.MM.DD]
16 | # [Windows_Server-2008-R2_SP1-English-64Bit-Base-YYYY.MM.DD]
17 | #
18 | # - 6.2 : Windows Server 2012 (Microsoft Windows Server 2012 [Standard Edition])
19 | # [Windows_Server-2012-RTM-Japanese-64Bit-Base-YYYY.MM.DD]
20 | # [Windows_Server-2012-RTM-English-64Bit-Base-YYYY.MM.DD]
21 | #
22 | # - 6.3 : Windows Server 2012 R2 (Microsoft Windows Server 2012 R2 [Standard Edition])
23 | # [Windows_Server-2012-R2_RTM-Japanese-64Bit-Base-YYYY.MM.DD]
24 | # [Windows_Server-2012-R2_RTM-English-64Bit-Base-YYYY.MM.DD]
25 | #
26 | # - 10.0 : Windows Server 2016 (Microsoft Windows Server 2016 [Datacenter Edition])
27 | # [Windows_Server-2016-Japanese-Full-Base-YYYY.MM.DD]
28 | # [Windows_Server-2016-English-Full-Base-YYYY.MM.DD]
29 | #
30 | # - 10.0 : Windows Server 2019 (Microsoft Windows Server 2019 [Datacenter Edition])
31 | # [Windows_Server-2019-Japanese-Full-Base-YYYY.MM.DD]
32 | # [Windows_Server-2019-English-Full-Base-YYYY.MM.DD]
33 | #
34 | # - 10.0 : Windows Server 2022 (Microsoft Windows Server 2022 [Datacenter Edition])
35 | # [Windows_Server-2022-Japanese-Full-Base-YYYY.MM.DD]
36 | # [Windows_Server-2022-English-Full-Base-YYYY.MM.DD]
37 | #
38 | # - 10.0 : Windows Server 2025 (Microsoft Windows Server 2025 [Datacenter Edition])
39 | # [Windows_Server-2025-Japanese-Full-Base-YYYY.MM.DD]
40 | # [Windows_Server-2025-English-Full-Base-YYYY.MM.DD]
41 | #
42 | ########################################################################################################################
43 |
44 |
45 | #-----------------------------------------------------------------------------------------------------------------------
46 | # User Define Parameter
47 | #-----------------------------------------------------------------------------------------------------------------------
48 |
49 | # Set Script Parameter for Directory Name (User Defined)
50 | Set-Variable -Name TEMP_DIR -Scope Script "$Env:SystemRoot\Temp"
51 |
52 | # Set Script Parameter for Log File Name (User Defined)
53 | Set-Variable -Name USERDATA_LOG -Scope Script "$TEMP_DIR\userdata.log"
54 |
55 | # Set Script Parameter for 3rd-Bootstrap Script (User Defined)
56 | Set-Variable -Name BOOTSTRAP_URL_MODERN -Scope Script -Value "https://raw.githubusercontent.com/usui-tk/amazon-ec2-userdata/master/3rd-Bootstrap_WindowsServer-Modern.ps1"
57 | Set-Variable -Name BOOTSTRAP_URL_LEGACY -Scope Script -Value "https://raw.githubusercontent.com/usui-tk/amazon-ec2-userdata/master/3rd-Bootstrap_WindowsServer-Regacy.ps1"
58 | Set-Variable -Name BOOTSTRAP_SCRIPT -Scope Script -Value "3rd-Bootstrap_WindowsServer.ps1"
59 |
60 |
61 | ########################################################################################################################
62 | #
63 | # Windows Bootstrap Common function
64 | #
65 | ########################################################################################################################
66 |
67 |
68 | function Format-Message {
69 | param([string]$message)
70 |
71 | $timestamp = Get-Date -Format "yyyy/MM/dd HH:mm:ss.fffffff zzz"
72 | "$timestamp - $message"
73 | } # end function Format-Message
74 |
75 |
76 | function Write-Log {
77 | param([string]$message, $log = $USERDATA_LOG)
78 |
79 | Format-Message $message | Out-File $log -Append -Force
80 | } # end function Write-Log
81 |
82 |
83 | function Write-LogSeparator {
84 | param([string]$message)
85 | Write-Log "#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
86 | Write-Log ("# Script Executetion Step : " + $message)
87 | Write-Log "#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
88 | } # end function Write-LogSeparator
89 |
90 |
91 | ########################################################################################################################
92 | #
93 | # Start of script
94 | #
95 | ########################################################################################################################
96 |
97 | #-----------------------------------------------------------------------------------------------------------------------
98 | # Preparation for script execution
99 | #-----------------------------------------------------------------------------------------------------------------------
100 |
101 | Set-Variable -Name ScriptFullPath -Scope Script -Value ($MyInvocation.InvocationName)
102 | Write-Log "# Script Execution 2nd-Decision Script [START] : $ScriptFullPath"
103 |
104 | Set-Location -Path $TEMP_DIR
105 |
106 | #-----------------------------------------------------------------------------------------------------------------------
107 | # Windows Server OS Decision
108 | #-----------------------------------------------------------------------------------------------------------------------
109 |
110 | # Log Separator
111 | Write-LogSeparator "Windows Server OS Decision"
112 |
113 | #Get OS Infomation & Language
114 | $Local:OSLanguage = ([CultureInfo]::CurrentCulture).IetfLanguageTag
115 | $Local:OSversion = (Get-CimInstance Win32_OperatingSystem | Select-Object Version).Version
116 | $Local:OSBuildNumber = (Get-CimInstance Win32_OperatingSystem | Select-Object BuildNumber).BuildNumber
117 |
118 | Write-Log ("# [Windows Infomation] OS Version : " + ($OSversion) + " - OS Language : " + ($OSLanguage))
119 |
120 | # Bootstrap Script Executite
121 | if ($OSversion -match "^6.1.*") {
122 | # Log Separator
123 | Write-LogSeparator "# [Bootstrap Script] : Microsoft Windows Server 2008 R2"
124 | Write-Log ("# [Bootstrap Script] : " + ($BOOTSTRAP_URL_LEGACY))
125 | Invoke-WebRequest -Uri $BOOTSTRAP_URL_LEGACY -OutFile $BOOTSTRAP_SCRIPT
126 | Write-Log "# Script Execution 2nd-Decision Script [COMPLETE] : $ScriptFullPath"
127 | powershell.exe -ExecutionPolicy Bypass "$TEMP_DIR\$BOOTSTRAP_SCRIPT" -SkipNetworkProfileCheck
128 | }
129 | elseif ($OSversion -match "^6.2.*") {
130 | # Log Separator
131 | Write-LogSeparator "# [Bootstrap Script] : Microsoft Windows Server 2012"
132 | Write-Log ("# [Bootstrap Script] : " + ($BOOTSTRAP_URL_LEGACY))
133 | Invoke-WebRequest -Uri $BOOTSTRAP_URL_LEGACY -UseBasicParsing -OutFile $BOOTSTRAP_SCRIPT
134 | Write-Log "# Script Execution 2nd-Decision Script [COMPLETE] : $ScriptFullPath"
135 | powershell.exe -ExecutionPolicy Bypass "$TEMP_DIR\$BOOTSTRAP_SCRIPT" -SkipNetworkProfileCheck
136 | }
137 | elseif ($OSversion -match "^6.3.*") {
138 | # Log Separator
139 | Write-LogSeparator "# [Bootstrap Script] : Microsoft Windows Server 2012 R2"
140 | Write-Log ("# [Bootstrap Script] : " + ($BOOTSTRAP_URL_LEGACY))
141 | Invoke-WebRequest -Uri $BOOTSTRAP_URL_LEGACY -UseBasicParsing -OutFile $BOOTSTRAP_SCRIPT
142 | Write-Log "# Script Execution 2nd-Decision Script [COMPLETE] : $ScriptFullPath"
143 | powershell.exe -ExecutionPolicy Bypass "$TEMP_DIR\$BOOTSTRAP_SCRIPT" -SkipNetworkProfileCheck
144 | }
145 | elseif ($OSversion -match "^10.0.*") {
146 | switch ($OSBuildNumber) {
147 | '14393' {
148 | # Log Separator
149 | Write-LogSeparator "# [Bootstrap Script] : Microsoft Windows Server 2016"
150 | Write-Log ("# [Bootstrap Script] : " + ($BOOTSTRAP_URL_MODERN))
151 | Invoke-WebRequest -Uri $BOOTSTRAP_URL_MODERN -UseBasicParsing -OutFile $BOOTSTRAP_SCRIPT
152 | Write-Log "# Script Execution 2nd-Decision Script [COMPLETE] : $ScriptFullPath"
153 | powershell.exe -ExecutionPolicy Bypass "$TEMP_DIR\$BOOTSTRAP_SCRIPT" -SkipNetworkProfileCheck
154 | }
155 | '17763' {
156 | # Log Separator
157 | Write-LogSeparator "# [Bootstrap Script] : Microsoft Windows Server 2019"
158 | Write-Log ("# [Bootstrap Script] : " + ($BOOTSTRAP_URL_MODERN))
159 | Invoke-WebRequest -Uri $BOOTSTRAP_URL_MODERN -UseBasicParsing -OutFile $BOOTSTRAP_SCRIPT
160 | Write-Log "# Script Execution 2nd-Decision Script [COMPLETE] : $ScriptFullPath"
161 | powershell.exe -ExecutionPolicy Bypass "$TEMP_DIR\$BOOTSTRAP_SCRIPT" -SkipNetworkProfileCheck
162 | }
163 | '20348' {
164 | # Log Separator
165 | Write-LogSeparator "# [Bootstrap Script] : Microsoft Windows Server 2022"
166 | Write-Log ("# [Bootstrap Script] : " + ($BOOTSTRAP_URL_MODERN))
167 | Invoke-WebRequest -Uri $BOOTSTRAP_URL_MODERN -UseBasicParsing -OutFile $BOOTSTRAP_SCRIPT
168 | Write-Log "# Script Execution 2nd-Decision Script [COMPLETE] : $ScriptFullPath"
169 | powershell.exe -ExecutionPolicy Bypass "$TEMP_DIR\$BOOTSTRAP_SCRIPT" -SkipNetworkProfileCheck
170 | }
171 | '26100' {
172 | # Log Separator
173 | Write-LogSeparator "# [Bootstrap Script] : Microsoft Windows Server 2025"
174 | Write-Log ("# [Bootstrap Script] : " + ($BOOTSTRAP_URL_MODERN))
175 | Invoke-WebRequest -Uri $BOOTSTRAP_URL_MODERN -UseBasicParsing -OutFile $BOOTSTRAP_SCRIPT
176 | Write-Log "# Script Execution 2nd-Decision Script [COMPLETE] : $ScriptFullPath"
177 | powershell.exe -ExecutionPolicy Bypass "$TEMP_DIR\$BOOTSTRAP_SCRIPT" -SkipNetworkProfileCheck
178 | }
179 | default {
180 | # Log Separator
181 | Write-LogSeparator "# [Bootstrap Script] : Microsoft Windows Server (UnKnown Modern OS)"
182 | Write-Log ("# [Bootstrap Script] : " + ($BOOTSTRAP_URL_MODERN))
183 | Invoke-WebRequest -Uri $BOOTSTRAP_URL_MODERN -UseBasicParsing -OutFile $BOOTSTRAP_SCRIPT
184 | Write-Log "# Script Execution 2nd-Decision Script [COMPLETE] : $ScriptFullPath"
185 | powershell.exe -ExecutionPolicy Bypass "$TEMP_DIR\$BOOTSTRAP_SCRIPT" -SkipNetworkProfileCheck
186 | }
187 | }
188 | }
189 | else {
190 | Write-Log ("# [Warning] No Target - Windows NT Version Information : " + $OSversion)
191 | }
192 |
--------------------------------------------------------------------------------
/4th-Cleanup_WindowsServer.ps1:
--------------------------------------------------------------------------------
1 | # Parameter
2 | Set-Variable -Name BASE_DIR -Value "$Env:SystemDrive\EC2-Bootstrap"
3 | Set-Variable -Name TEMP_DIR -Value "$Env:SystemRoot\Temp\*"
4 |
5 | # Function
6 | function Format-Message {
7 | param([string]$message)
8 |
9 | $timestamp = Get-Date -Format "yyyy/MM/dd HH:mm:ss.fffffff zzz"
10 | "$timestamp - $message"
11 | }
12 |
13 | function Write-Message {
14 | param([string]$message)
15 |
16 | Format-Message $message
17 | }
18 |
19 | function Write-MessageSeparator {
20 | param([string]$message)
21 | Write-Message "#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
22 | Write-Message ("# Script Executetion Step : " + $message)
23 | Write-Message "#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
24 | }
25 |
26 | #---------------------------------------------------------------------------------------------------------------------------
27 |
28 | # Start of script
29 | Write-MessageSeparator "Start Script Execution Cleanup Script"
30 |
31 | # Delete Bootstrap working directory
32 | if (Test-Path -Path $BASE_DIR) {
33 | Write-Message ("# Delete directory [" + $BASE_DIR + "]")
34 | Remove-Item -Path $BASE_DIR -Recurse -Force -ErrorAction SilentlyContinue
35 | Start-Sleep -Seconds 5
36 | }
37 |
38 | # Delete Windows TEMP directory
39 | if (Test-Path -Path $TEMP_DIR) {
40 | Write-Message ("# Delete directory [" + $TEMP_DIR + "]")
41 | Remove-Item -Path $TEMP_DIR -Recurse -Force -ErrorAction SilentlyContinue
42 | Start-Sleep -Seconds 5
43 | }
44 |
45 | # Delete RecycleBin's files
46 | if (Get-Command -CommandType Cmdlet | Where-Object { $_.Name -eq "Clear-RecycleBin" }) {
47 | Write-Message "# Delete RecycleBin's files [Clear-RecycleBin]"
48 | Clear-RecycleBin -DriveLetter "C" -Force -ErrorAction SilentlyContinue
49 | Start-Sleep -Seconds 5
50 | }
51 | else {
52 | Write-Message "# Delete RecycleBin's files [Remove-Item]"
53 | Get-ChildItem -Path 'C:\$Recycle.Bin' -Force | Remove-Item -Recurse -ErrorAction SilentlyContinue
54 | Start-Sleep -Seconds 5
55 | }
56 |
57 | # Clear AWS Utility and Tool Log
58 | Set-Variable -Name Ec2LaunchV2LogFile -Value "C:\ProgramData\Amazon\EC2Launch\log\agent.log"
59 | if (Test-Path -Path $Ec2LaunchV2LogFile) {
60 | Set-Variable -Name EC2LAUNCH_V2_LOG_DIR -Value "C:\ProgramData\Amazon\EC2Launch\log\*"
61 |
62 | Write-Message ("# Delete directory [" + $EC2LAUNCH_V2_LOG_DIR + "]")
63 | Remove-Item -Path $EC2LAUNCH_V2_LOG_DIR -Recurse -Force -ErrorAction SilentlyContinue
64 | Start-Sleep -Seconds 5
65 | }
66 |
67 | Set-Variable -Name Ec2LaunchLogFile -Value "C:\ProgramData\Amazon\EC2-Windows\Launch\Log\Ec2Launch.log"
68 | if (Test-Path -Path $Ec2LaunchLogFile) {
69 | Write-Message ("# Clear file [" + $Ec2LaunchLogFile + "]")
70 | Clear-Content -Path $Ec2LaunchLogFile -Force -ErrorAction SilentlyContinue
71 | }
72 |
73 | Set-Variable -Name Ec2ConfigLogFile -Value "C:\Program Files\Amazon\Ec2ConfigService\Logs\Ec2ConfigLog.txt"
74 | if (Test-Path -Path $Ec2ConfigLogFile) {
75 | Write-Message ("# Clear file [" + $Ec2ConfigLogFile + "]")
76 | Clear-Content -Path $Ec2ConfigLogFile -Force -ErrorAction SilentlyContinue
77 | }
78 |
79 | Set-Variable -Name SSMAgentLogFile -Value "C:\ProgramData\Amazon\SSM\Logs\amazon-ssm-agent.log"
80 | if (Test-Path -Path $SSMAgentLogFile) {
81 | Write-Message ("# Clear file [" + $SSMAgentLogFile + "]")
82 | Clear-Content -Path $SSMAgentLogFile -Force -ErrorAction SilentlyContinue
83 | }
84 |
85 | Set-Variable -Name CWAgentLogFile -Value "C:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log"
86 | if (Test-Path -Path $CWAgentLogFile) {
87 | Write-Message ("# Clear file [" + $CWAgentLogFile + "]")
88 | Clear-Content -Path $CWAgentLogFile -Force -ErrorAction SilentlyContinue
89 | }
90 |
91 | # Clear Windows Event Log
92 | if (Get-Command -CommandType Cmdlet | Where-Object { $_.Name -eq "Clear-EventLog" }) {
93 | Write-Message "# Clear Windows Event Log [Get-EventLog (Before Cleanup EventLog)]"
94 | Get-EventLog -List
95 | Write-Message "# Clear Windows Event Log [Clear-EventLog]"
96 | Get-EventLog -LogName * | ForEach-Object -Process { Clear-EventLog $_.Log -ErrorAction SilentlyContinue }
97 | Start-Sleep -Seconds 5
98 | Write-Message "# Clear Windows Event Log [Get-EventLog (After Cleanup EventLog)]"
99 | Get-EventLog -List
100 | }
101 | else {
102 | Write-Message "# Clear Windows Event Log [Get-EventLog (Before Cleanup EventLog)]"
103 | Get-EventLog -List
104 | Write-Message "# Clear Windows Event Log [GlobalSession.ClearLog]"
105 | Get-WinEvent -ListLog * | ForEach-Object -Process { [System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog($_.LogName) }
106 | Start-Sleep -Seconds 5
107 | Write-Message "# Clear Windows Event Log [Get-EventLog (After Cleanup EventLog)]"
108 | Get-EventLog -List
109 | }
110 |
111 | # Clear PowerShell history
112 | Get-History
113 | Start-Sleep -Seconds 10
114 | Clear-History -ErrorAction SilentlyContinue
115 |
116 | Write-MessageSeparator "Complete Script Execution Cleanup Script"
117 |
118 | # Waiting time
119 | Start-Sleep -Seconds 30
120 |
121 | #---------------------------------------------------------------------------------------------------------------------------
122 |
123 | Write-MessageSeparator "# Execution of Sysprep processing"
124 |
125 | # Checking the existence of the sysprep file
126 | Set-Variable -Name EC2Launchv2SysprepFile -Option Constant -Scope Script -Value "C:\ProgramData\Amazon\EC2Launch\sysprep\unattend.xml"
127 | Set-Variable -Name EC2LaunchSysprepFile -Option Constant -Scope Script -Value "C:\ProgramData\Amazon\EC2-Windows\Launch\Sysprep\Unattend.xml"
128 | Set-Variable -Name EC2ConfigSysprepFile -Option Constant -Scope Script -Value "C:\Program Files\Amazon\Ec2ConfigService\sysprep2008.xml"
129 |
130 | Write-Message "# [Windows - OS Settings] Checking the existence of the sysprep file"
131 |
132 | if (Test-Path $EC2Launchv2SysprepFile) {
133 | Set-Variable -Name SysprepFile -Value $EC2Launchv2SysprepFile
134 | Write-Message ("# [Windows - OS Settings] Found sysprep file [EC2Launch v2] : " + $SysprepFile)
135 |
136 | #-------------------------------------------------------------------------------------
137 | # Execution of Sysprep processing (EC2Launch v2)
138 | #-------------------------------------------------------------------------------------
139 | Set-Variable -Name EC2LaunchV2ExeFile -Value "C:\Program Files\Amazon\EC2Launch\EC2Launch.exe"
140 | if (Test-Path -Path $EC2LaunchV2ExeFile) {
141 | Write-Message ("# Execution for sysprep [" + $EC2LaunchV2ExeFile + "]")
142 | Start-Process $EC2LaunchV2ExeFile -Verb runas -Wait -ArgumentList @("sysprep", "--clean", "--shutdown")
143 | Start-Sleep -Seconds 5
144 | }
145 | else {
146 | Write-Message ("# [Error] Not Found - Execution file : " + $EC2LaunchV2ExeFile)
147 | exit 1
148 | }
149 | }
150 | elseif (Test-Path $EC2LaunchSysprepFile) {
151 | Set-Variable -Name SysprepFile -Value $EC2LaunchSysprepFile
152 | Write-Message ("# [Windows - OS Settings] Found sysprep file [EC2Launch] : " + $SysprepFile)
153 |
154 | #-------------------------------------------------------------------------------------
155 | # Execution of Sysprep processing (EC2Launch)
156 | #-------------------------------------------------------------------------------------
157 | Set-Variable -Name EC2LaunchExeFile1 -Value "C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1"
158 | Set-Variable -Name EC2LaunchExeFile2 -Value "C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\SysprepInstance.ps1"
159 |
160 | if (Test-Path -Path $EC2LaunchExeFile1) {
161 | Write-Message ("# Execution for sysprep [" + $EC2LaunchExeFile1 + "]")
162 | Start-Process "powershell.exe" -Verb runas -Wait -ArgumentList @("-File $EC2LaunchExeFile1", "-Schedule")
163 | Start-Sleep -Seconds 10
164 | }
165 | else {
166 | Write-Message ("# [Error] Not Found - Execution file : " + $EC2LaunchExeFile1)
167 | exit 1
168 | }
169 |
170 | if (Test-Path -Path $EC2LaunchExeFile2) {
171 | Write-Message ("# Execution for sysprep [" + $EC2LaunchExeFile2 + "]")
172 | Start-Process "powershell.exe" -Verb runas -Wait -ArgumentList @("-File $EC2LaunchExeFile2")
173 | Start-Sleep -Seconds 10
174 | }
175 | else {
176 | Write-Message ("# [Error] Not Found - Execution file : " + $EC2LaunchExeFile2)
177 | exit 1
178 | }
179 | }
180 | elseif (Test-Path $EC2ConfigSysprepFile) {
181 | Set-Variable -Name SysprepFile -Value $EC2ConfigSysprepFile
182 | Write-Message ("# [Windows - OS Settings] Found sysprep file [EC2Config] : " + $SysprepFile)
183 |
184 | #-------------------------------------------------------------------------------------
185 | # Execution of Sysprep processing (EC2Config) - #1
186 | #-------------------------------------------------------------------------------------
187 | Set-Variable -Name EC2SettingsFile -Value "C:\Program Files\Amazon\Ec2ConfigService\Settings\Config.xml"
188 | if (Test-Path -Path $EC2SettingsFile) {
189 | Write-Message ("# Settings EC2Config files [" + $EC2SettingsFile + "]")
190 |
191 | $xml = [xml](get-content $EC2SettingsFile)
192 | $xmlElement = $xml.get_DocumentElement()
193 | $xmlElementToModify = $xmlElement.Plugins
194 |
195 | foreach ($element in $xmlElementToModify.Plugin) {
196 | if ($element.name -eq "Ec2SetPassword") {
197 | $element.State = "Enabled"
198 | }
199 | elseif ($element.name -eq "Ec2DynamicBootVolumeSize") {
200 | $element.State = "Enabled"
201 | }
202 | elseif ($element.name -eq "Ec2HandleUserData") {
203 | $element.State = "Enabled"
204 | }
205 | }
206 | $xml.Save($EC2SettingsFile)
207 |
208 | Start-Sleep -Seconds 5
209 | }
210 |
211 | #-------------------------------------------------------------------------------------
212 | # Execution of Sysprep processing (EC2Config) - #2
213 | #-------------------------------------------------------------------------------------
214 | Set-Variable -Name EC2ConfigExeFile -Value "C:\Program Files\Amazon\Ec2ConfigService\Ec2Config.exe"
215 | if (Test-Path -Path $EC2ConfigExeFile) {
216 | Write-Message ("# Execution for sysprep [" + $EC2ConfigExeFile + "]")
217 |
218 | Start-Process $EC2ConfigExeFile -Verb runas -Wait -ArgumentList @("-sysprep")
219 | Start-Sleep -Seconds 5
220 | }
221 | else {
222 | Write-Message ("# [Error] Not Found - Execution file : " + $EC2ConfigExeFile)
223 | exit 1
224 | }
225 | }
226 | else {
227 | Write-Message "# [Error] Not Found - Sysprep files"
228 | exit 1
229 | }
230 |
231 | #-------------------------------------------------------------------------------
232 | # For normal termination of SSM "Run Command"
233 | #-------------------------------------------------------------------------------
234 |
235 | # exit 0
236 |
237 | #-------------------------------------------------------------------------------
238 | # End of File
239 | #-------------------------------------------------------------------------------
240 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_AlmaLinux-v8-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/almalinux-v8/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/almalinux-v8/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/almalinux-v8/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/almalinux-v8/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/almalinux-v8/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_AlmaLinux-v9-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/almalinux-v9/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/almalinux-v9/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/almalinux-v9/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/almalinux-v9/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/almalinux-v9/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_AmazonLinux-1-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/amazonlinux/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/amazonlinux/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/yum.log",
24 | "log_group_name": "/aws/ec2/amazonlinux/var-log-yum.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/amazonlinux/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/amazonlinux/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_AmazonLinux-2-LTS-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/amazonlinux2/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/amazonlinux2/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/yum.log",
24 | "log_group_name": "/aws/ec2/amazonlinux2/var-log-yum.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/amazonlinux2/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/amazonlinux2/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_AmazonLinux-2023-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/amazonlinux-2023/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/amazonlinux-2023/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/amazonlinux-2023/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/amazonlinux-2023/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/amazonlinux-2023/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_CentOS-v10-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/centos-v10/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/centos-v10/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/centos-v10/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/centos-v10/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/centos-v10/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_CentOS-v6-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/centos-v6/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/centos-v6/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/yum.log",
24 | "log_group_name": "/aws/ec2/centos-v6/var-log-yum.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/centos-v6/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/centos-v6/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_CentOS-v7-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/centos-v7/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/centos-v7/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/yum.log",
24 | "log_group_name": "/aws/ec2/centos-v7/var-log-yum.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/centos-v7/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/centos-v7/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_CentOS-v8-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/centos-v8/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/centos-v8/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/centos-v8/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/centos-v8/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/centos-v8/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_CentOS-v9-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/centos-v9/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/centos-v9/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/centos-v9/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/centos-v9/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/centos-v9/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_Debian-10-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/syslog",
12 | "log_group_name": "/aws/ec2/debian-10/var-log-syslog",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/auth.log",
18 | "log_group_name": "/aws/ec2/debian-10/var-log-auth.log",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dpkg.log",
24 | "log_group_name": "/aws/ec2/debian-10/var-log-dpkg.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/debian-10/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/debian-10/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_Debian-11-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/syslog",
12 | "log_group_name": "/aws/ec2/debian-11/var-log-syslog",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/auth.log",
18 | "log_group_name": "/aws/ec2/debian-11/var-log-auth.log",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dpkg.log",
24 | "log_group_name": "/aws/ec2/debian-11/var-log-dpkg.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/debian-11/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/debian-11/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_Debian-12-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/syslog",
12 | "log_group_name": "/aws/ec2/debian-12/var-log-syslog",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/auth.log",
18 | "log_group_name": "/aws/ec2/debian-12/var-log-auth.log",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dpkg.log",
24 | "log_group_name": "/aws/ec2/debian-12/var-log-dpkg.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/debian-12/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/debian-12/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_Debian-9-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/syslog",
12 | "log_group_name": "/aws/ec2/debian-9/var-log-syslog",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/auth.log",
18 | "log_group_name": "/aws/ec2/debian-9/var-log-auth.log",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dpkg.log",
24 | "log_group_name": "/aws/ec2/debian-9/var-log-dpkg.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/debian-9/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/debian-9/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_Kali-Linux-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/syslog",
12 | "log_group_name": "/aws/ec2/kali-linux/var-log-syslog",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/auth.log",
18 | "log_group_name": "/aws/ec2/kali-linux/var-log-auth.log",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dpkg.log",
24 | "log_group_name": "/aws/ec2/kali-linux/var-log-dpkg.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/kali-linux/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/kali-linux/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_OpenSUSE-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/opensuse/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/zypper.log",
18 | "log_group_name": "/aws/ec2/opensuse/var-log-zypper.log",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
24 | "log_group_name": "/aws/ec2/opensuse/var-log-amazon-ssm-agent.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
30 | "log_group_name": "/aws/ec2/opensuse/opt/aws/amazon-cloudwatch-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | }
34 | ]
35 | }
36 | }
37 | },
38 | "metrics": {
39 | "aggregation_dimensions": [
40 | [
41 | "InstanceId"
42 | ]
43 | ],
44 | "append_dimensions": {
45 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
46 | "ImageId": "${aws:ImageId}",
47 | "InstanceId": "${aws:InstanceId}",
48 | "InstanceType": "${aws:InstanceType}"
49 | },
50 | "metrics_collected": {
51 | "collectd": {
52 | "metrics_aggregation_interval": 60
53 | },
54 | "cpu": {
55 | "measurement": [
56 | "cpu_usage_idle",
57 | "cpu_usage_iowait",
58 | "cpu_usage_user",
59 | "cpu_usage_system"
60 | ],
61 | "metrics_collection_interval": 10,
62 | "resources": [
63 | "*"
64 | ],
65 | "totalcpu": false
66 | },
67 | "disk": {
68 | "measurement": [
69 | "used_percent",
70 | "inodes_free"
71 | ],
72 | "metrics_collection_interval": 10,
73 | "resources": [
74 | "*"
75 | ]
76 | },
77 | "diskio": {
78 | "measurement": [
79 | "io_time",
80 | "write_bytes",
81 | "read_bytes",
82 | "writes",
83 | "reads"
84 | ],
85 | "metrics_collection_interval": 10,
86 | "resources": [
87 | "*"
88 | ]
89 | },
90 | "mem": {
91 | "measurement": [
92 | "mem_used_percent"
93 | ],
94 | "metrics_collection_interval": 10
95 | },
96 | "netstat": {
97 | "measurement": [
98 | "tcp_established",
99 | "tcp_time_wait"
100 | ],
101 | "metrics_collection_interval": 10
102 | },
103 | "statsd": {
104 | "metrics_aggregation_interval": 60,
105 | "metrics_collection_interval": 10,
106 | "service_address": ":8125"
107 | },
108 | "swap": {
109 | "measurement": [
110 | "swap_used_percent"
111 | ],
112 | "metrics_collection_interval": 10
113 | }
114 | }
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_OracleLinux-v6-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/oraclelinux-v6/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/oraclelinux-v6/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/yum.log",
24 | "log_group_name": "/aws/ec2/oraclelinux-v6/var-log-yum.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/oraclelinux-v6/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/oraclelinux-v6/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_OracleLinux-v7-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/oraclelinux-v7/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/oraclelinux-v7/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/yum.log",
24 | "log_group_name": "/aws/ec2/oraclelinux-v7/var-log-yum.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/oraclelinux-v7/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/oraclelinux-v7/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_OracleLinux-v8-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/oraclelinux-v8/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/oraclelinux-v8/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/oraclelinux-v8/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/oraclelinux-v8/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/oraclelinux-v8/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_OracleLinux-v9-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/oraclelinux-v9/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/oraclelinux-v9/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/oraclelinux-v9/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/oraclelinux-v9/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/oraclelinux-v9/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_RHEL-v10-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/rhel-v10/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/rhel-v10/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/rhel-v10/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/rhel-v10/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/rhel-v10/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_RHEL-v6-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/rhel-v6/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/rhel-v6/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/yum.log",
24 | "log_group_name": "/aws/ec2/rhel-v6/var-log-yum.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/rhel-v6/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/rhel-v6/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_RHEL-v7-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/rhel-v7/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/rhel-v7/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/yum.log",
24 | "log_group_name": "/aws/ec2/rhel-v7/var-log-yum.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/rhel-v7/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/rhel-v7/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_RHEL-v8-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/rhel-v8/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/rhel-v8/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/rhel-v8/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/rhel-v8/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/rhel-v8/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_RHEL-v9-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/rhel-v9/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/rhel-v9/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/rhel-v9/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/rhel-v9/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/rhel-v9/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_RockyLinux-v8-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/rockylinux-v8/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/rockylinux-v8/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/rockylinux-v8/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/rockylinux-v8/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/rockylinux-v8/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_RockyLinux-v9-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/rockylinux-v9/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/secure",
18 | "log_group_name": "/aws/ec2/rockylinux-v9/var-log-secure",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dnf.log",
24 | "log_group_name": "/aws/ec2/rockylinux-v9/var-log-dnf.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/rockylinux-v9/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/rockylinux-v9/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_SLES-v12-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/sles-v12/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/localmessages",
18 | "log_group_name": "/aws/ec2/sles-v12/var-log-localmessages",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/zypper.log",
24 | "log_group_name": "/aws/ec2/sles-v12/var-log-zypper.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/sles-v12/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/sles-v12/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "cpu": {
58 | "measurement": [
59 | "cpu_usage_idle",
60 | "cpu_usage_iowait",
61 | "cpu_usage_user",
62 | "cpu_usage_system"
63 | ],
64 | "metrics_collection_interval": 10,
65 | "resources": [
66 | "*"
67 | ],
68 | "totalcpu": false
69 | },
70 | "disk": {
71 | "measurement": [
72 | "used_percent",
73 | "inodes_free"
74 | ],
75 | "metrics_collection_interval": 10,
76 | "resources": [
77 | "*"
78 | ]
79 | },
80 | "diskio": {
81 | "measurement": [
82 | "io_time",
83 | "write_bytes",
84 | "read_bytes",
85 | "writes",
86 | "reads"
87 | ],
88 | "metrics_collection_interval": 10,
89 | "resources": [
90 | "*"
91 | ]
92 | },
93 | "mem": {
94 | "measurement": [
95 | "mem_used_percent"
96 | ],
97 | "metrics_collection_interval": 10
98 | },
99 | "netstat": {
100 | "measurement": [
101 | "tcp_established",
102 | "tcp_time_wait"
103 | ],
104 | "metrics_collection_interval": 10
105 | },
106 | "statsd": {
107 | "metrics_aggregation_interval": 60,
108 | "metrics_collection_interval": 10,
109 | "service_address": ":8125"
110 | },
111 | "swap": {
112 | "measurement": [
113 | "swap_used_percent"
114 | ],
115 | "metrics_collection_interval": 10
116 | }
117 | }
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_SLES-v15-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/messages",
12 | "log_group_name": "/aws/ec2/sles-v15/var-log-message",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/localmessages",
18 | "log_group_name": "/aws/ec2/sles-v15/var-log-localmessages",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/zypper.log",
24 | "log_group_name": "/aws/ec2/sles-v15/var-log-zypper.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/sles-v15/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/sles-v15/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_Ubuntu-16.04-LTS-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/syslog",
12 | "log_group_name": "/aws/ec2/ubuntu-1604-lts/var-log-syslog",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/auth.log",
18 | "log_group_name": "/aws/ec2/ubuntu-1604-lts/var-log-auth.log",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dpkg.log",
24 | "log_group_name": "/aws/ec2/ubuntu-1604-lts/var-log-dpkg.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/ubuntu-1604-lts/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/ubuntu-1604-lts/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_Ubuntu-18.04-LTS-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/syslog",
12 | "log_group_name": "/aws/ec2/ubuntu-1804-lts/var-log-syslog",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/auth.log",
18 | "log_group_name": "/aws/ec2/ubuntu-1804-lts/var-log-auth.log",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dpkg.log",
24 | "log_group_name": "/aws/ec2/ubuntu-1804-lts/var-log-dpkg.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/ubuntu-1804-lts/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/ubuntu-1804-lts/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_Ubuntu-20.04-LTS-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/syslog",
12 | "log_group_name": "/aws/ec2/ubuntu-2004-lts/var-log-syslog",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/auth.log",
18 | "log_group_name": "/aws/ec2/ubuntu-2004-lts/var-log-auth.log",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dpkg.log",
24 | "log_group_name": "/aws/ec2/ubuntu-2004-lts/var-log-dpkg.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/ubuntu-2004-lts/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/ubuntu-2004-lts/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_Ubuntu-22.04-LTS-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/syslog",
12 | "log_group_name": "/aws/ec2/ubuntu-2204-lts/var-log-syslog",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/auth.log",
18 | "log_group_name": "/aws/ec2/ubuntu-2204-lts/var-log-auth.log",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dpkg.log",
24 | "log_group_name": "/aws/ec2/ubuntu-2204-lts/var-log-dpkg.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/ubuntu-2204-lts/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/ubuntu-2204-lts/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_Ubuntu-24.04-LTS-HVM.json:
--------------------------------------------------------------------------------
1 | {
2 | "agent": {
3 | "metrics_collection_interval": 10,
4 | "run_as_user": "root"
5 | },
6 | "logs": {
7 | "logs_collected": {
8 | "files": {
9 | "collect_list": [
10 | {
11 | "file_path": "/var/log/syslog",
12 | "log_group_name": "/aws/ec2/ubuntu-2404-lts/var-log-syslog",
13 | "log_stream_name": "{instance_id}",
14 | "retention_in_days": 7
15 | },
16 | {
17 | "file_path": "/var/log/auth.log",
18 | "log_group_name": "/aws/ec2/ubuntu-2404-lts/var-log-auth.log",
19 | "log_stream_name": "{instance_id}",
20 | "retention_in_days": 7
21 | },
22 | {
23 | "file_path": "/var/log/dpkg.log",
24 | "log_group_name": "/aws/ec2/ubuntu-2404-lts/var-log-dpkg.log",
25 | "log_stream_name": "{instance_id}",
26 | "retention_in_days": 7
27 | },
28 | {
29 | "file_path": "/var/log/amazon/ssm/amazon-ssm-agent.log",
30 | "log_group_name": "/aws/ec2/ubuntu-2404-lts/var-log-amazon-ssm-agent.log",
31 | "log_stream_name": "{instance_id}",
32 | "retention_in_days": 7
33 | },
34 | {
35 | "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
36 | "log_group_name": "/aws/ec2/ubuntu-2404-lts/opt/aws/amazon-cloudwatch-agent.log",
37 | "log_stream_name": "{instance_id}",
38 | "retention_in_days": 7
39 | }
40 | ]
41 | }
42 | }
43 | },
44 | "metrics": {
45 | "aggregation_dimensions": [
46 | [
47 | "InstanceId"
48 | ]
49 | ],
50 | "append_dimensions": {
51 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
52 | "ImageId": "${aws:ImageId}",
53 | "InstanceId": "${aws:InstanceId}",
54 | "InstanceType": "${aws:InstanceType}"
55 | },
56 | "metrics_collected": {
57 | "collectd": {
58 | "metrics_aggregation_interval": 60
59 | },
60 | "cpu": {
61 | "measurement": [
62 | "cpu_usage_idle",
63 | "cpu_usage_iowait",
64 | "cpu_usage_user",
65 | "cpu_usage_system"
66 | ],
67 | "metrics_collection_interval": 10,
68 | "resources": [
69 | "*"
70 | ],
71 | "totalcpu": false
72 | },
73 | "disk": {
74 | "measurement": [
75 | "used_percent",
76 | "inodes_free"
77 | ],
78 | "metrics_collection_interval": 10,
79 | "resources": [
80 | "*"
81 | ]
82 | },
83 | "diskio": {
84 | "measurement": [
85 | "io_time",
86 | "write_bytes",
87 | "read_bytes",
88 | "writes",
89 | "reads"
90 | ],
91 | "metrics_collection_interval": 10,
92 | "resources": [
93 | "*"
94 | ]
95 | },
96 | "mem": {
97 | "measurement": [
98 | "mem_used_percent"
99 | ],
100 | "metrics_collection_interval": 10
101 | },
102 | "netstat": {
103 | "measurement": [
104 | "tcp_established",
105 | "tcp_time_wait"
106 | ],
107 | "metrics_collection_interval": 10
108 | },
109 | "statsd": {
110 | "metrics_aggregation_interval": 60,
111 | "metrics_collection_interval": 10,
112 | "service_address": ":8125"
113 | },
114 | "swap": {
115 | "measurement": [
116 | "swap_used_percent"
117 | ],
118 | "metrics_collection_interval": 10
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_WindowsServer-2008R2.json:
--------------------------------------------------------------------------------
1 | {
2 | "logs": {
3 | "logs_collected": {
4 | "files": {
5 | "collect_list": [
6 | {
7 | "file_path": "C:\\ProgramData\\Amazon\\SSM\\Logs\\amazon-ssm-agent.log",
8 | "log_group_name": "/aws/ec2/windows-server-2018R2/awslog-ssm-agent",
9 | "log_stream_name": "{instance_id}",
10 | "retention_in_days": 14
11 | },
12 | {
13 | "file_path": "C:\\ProgramData\\Amazon\\AmazonCloudWatchAgent\\Logs\\amazon-cloudwatch-agent.log",
14 | "log_group_name": "/aws/ec2/windows-server-2008R2/awslog-cloudwatch-agent",
15 | "log_stream_name": "{instance_id}",
16 | "retention_in_days": 14
17 | }
18 | ]
19 | },
20 | "windows_events": {
21 | "collect_list": [
22 | {
23 | "event_format": "xml",
24 | "event_levels": [
25 | "VERBOSE",
26 | "INFORMATION",
27 | "WARNING",
28 | "ERROR",
29 | "CRITICAL"
30 | ],
31 | "event_name": "System",
32 | "log_group_name": "/aws/ec2/windows-server-2008R2/WindowsEventLog-System",
33 | "log_stream_name": "{instance_id}",
34 | "retention_in_days": 14
35 | },
36 | {
37 | "event_format": "xml",
38 | "event_levels": [
39 | "VERBOSE",
40 | "INFORMATION",
41 | "WARNING",
42 | "ERROR",
43 | "CRITICAL"
44 | ],
45 | "event_name": "Application",
46 | "log_group_name": "/aws/ec2/windows-server-2008R2/WindowsEventLog-Application",
47 | "log_stream_name": "{instance_id}",
48 | "retention_in_days": 14
49 | },
50 | {
51 | "event_format": "xml",
52 | "event_levels": [
53 | "VERBOSE",
54 | "INFORMATION",
55 | "WARNING",
56 | "ERROR",
57 | "CRITICAL"
58 | ],
59 | "event_name": "Security",
60 | "log_group_name": "/aws/ec2/windows-server-2008R2/WindowsEventLog-Security",
61 | "log_stream_name": "{instance_id}",
62 | "retention_in_days": 14
63 | }
64 | ]
65 | }
66 | }
67 | },
68 | "metrics": {
69 | "aggregation_dimensions": [
70 | [
71 | "InstanceId"
72 | ]
73 | ],
74 | "append_dimensions": {
75 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
76 | "ImageId": "${aws:ImageId}",
77 | "InstanceId": "${aws:InstanceId}",
78 | "InstanceType": "${aws:InstanceType}"
79 | },
80 | "metrics_collected": {
81 | "LogicalDisk": {
82 | "measurement": [
83 | "% Free Space"
84 | ],
85 | "metrics_collection_interval": 10,
86 | "resources": [
87 | "*"
88 | ]
89 | },
90 | "Memory": {
91 | "measurement": [
92 | "% Committed Bytes In Use"
93 | ],
94 | "metrics_collection_interval": 10
95 | },
96 | "Paging File": {
97 | "measurement": [
98 | "% Usage"
99 | ],
100 | "metrics_collection_interval": 10,
101 | "resources": [
102 | "*"
103 | ]
104 | },
105 | "PhysicalDisk": {
106 | "measurement": [
107 | "% Disk Time"
108 | ],
109 | "metrics_collection_interval": 10,
110 | "resources": [
111 | "*"
112 | ]
113 | },
114 | "Processor": {
115 | "measurement": [
116 | "% User Time",
117 | "% Idle Time",
118 | "% Interrupt Time"
119 | ],
120 | "metrics_collection_interval": 10,
121 | "resources": [
122 | "*"
123 | ]
124 | }
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_WindowsServer-2012.json:
--------------------------------------------------------------------------------
1 | {
2 | "logs": {
3 | "logs_collected": {
4 | "files": {
5 | "collect_list": [
6 | {
7 | "file_path": "C:\\ProgramData\\Amazon\\SSM\\Logs\\amazon-ssm-agent.log",
8 | "log_group_name": "/aws/ec2/windows-server-2012/awslog-ssm-agent",
9 | "log_stream_name": "{instance_id}",
10 | "retention_in_days": 14
11 | },
12 | {
13 | "file_path": "C:\\ProgramData\\Amazon\\AmazonCloudWatchAgent\\Logs\\amazon-cloudwatch-agent.log",
14 | "log_group_name": "/aws/ec2/windows-server-2012/awslog-cloudwatch-agent",
15 | "log_stream_name": "{instance_id}",
16 | "retention_in_days": 14
17 | }
18 | ]
19 | },
20 | "windows_events": {
21 | "collect_list": [
22 | {
23 | "event_format": "xml",
24 | "event_levels": [
25 | "VERBOSE",
26 | "INFORMATION",
27 | "WARNING",
28 | "ERROR",
29 | "CRITICAL"
30 | ],
31 | "event_name": "System",
32 | "log_group_name": "/aws/ec2/windows-server-2012/WindowsEventLog-System",
33 | "log_stream_name": "{instance_id}",
34 | "retention_in_days": 14
35 | },
36 | {
37 | "event_format": "xml",
38 | "event_levels": [
39 | "VERBOSE",
40 | "INFORMATION",
41 | "WARNING",
42 | "ERROR",
43 | "CRITICAL"
44 | ],
45 | "event_name": "Application",
46 | "log_group_name": "/aws/ec2/windows-server-2012/WindowsEventLog-Application",
47 | "log_stream_name": "{instance_id}",
48 | "retention_in_days": 14
49 | },
50 | {
51 | "event_format": "xml",
52 | "event_levels": [
53 | "VERBOSE",
54 | "INFORMATION",
55 | "WARNING",
56 | "ERROR",
57 | "CRITICAL"
58 | ],
59 | "event_name": "Security",
60 | "log_group_name": "/aws/ec2/windows-server-2012/WindowsEventLog-Security",
61 | "log_stream_name": "{instance_id}",
62 | "retention_in_days": 14
63 | }
64 | ]
65 | }
66 | }
67 | },
68 | "metrics": {
69 | "aggregation_dimensions": [
70 | [
71 | "InstanceId"
72 | ]
73 | ],
74 | "append_dimensions": {
75 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
76 | "ImageId": "${aws:ImageId}",
77 | "InstanceId": "${aws:InstanceId}",
78 | "InstanceType": "${aws:InstanceType}"
79 | },
80 | "metrics_collected": {
81 | "LogicalDisk": {
82 | "measurement": [
83 | "% Free Space"
84 | ],
85 | "metrics_collection_interval": 10,
86 | "resources": [
87 | "*"
88 | ]
89 | },
90 | "Memory": {
91 | "measurement": [
92 | "% Committed Bytes In Use"
93 | ],
94 | "metrics_collection_interval": 10
95 | },
96 | "Paging File": {
97 | "measurement": [
98 | "% Usage"
99 | ],
100 | "metrics_collection_interval": 10,
101 | "resources": [
102 | "*"
103 | ]
104 | },
105 | "PhysicalDisk": {
106 | "measurement": [
107 | "% Disk Time"
108 | ],
109 | "metrics_collection_interval": 10,
110 | "resources": [
111 | "*"
112 | ]
113 | },
114 | "Processor": {
115 | "measurement": [
116 | "% User Time",
117 | "% Idle Time",
118 | "% Interrupt Time"
119 | ],
120 | "metrics_collection_interval": 10,
121 | "resources": [
122 | "*"
123 | ]
124 | }
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_WindowsServer-2012R2.json:
--------------------------------------------------------------------------------
1 | {
2 | "logs": {
3 | "logs_collected": {
4 | "files": {
5 | "collect_list": [
6 | {
7 | "file_path": "C:\\ProgramData\\Amazon\\SSM\\Logs\\amazon-ssm-agent.log",
8 | "log_group_name": "/aws/ec2/windows-server-2012R2/awslog-ssm-agent",
9 | "log_stream_name": "{instance_id}",
10 | "retention_in_days": 14
11 | },
12 | {
13 | "file_path": "C:\\ProgramData\\Amazon\\AmazonCloudWatchAgent\\Logs\\amazon-cloudwatch-agent.log",
14 | "log_group_name": "/aws/ec2/windows-server-2012R2/awslog-cloudwatch-agent",
15 | "log_stream_name": "{instance_id}",
16 | "retention_in_days": 14
17 | }
18 | ]
19 | },
20 | "windows_events": {
21 | "collect_list": [
22 | {
23 | "event_format": "xml",
24 | "event_levels": [
25 | "VERBOSE",
26 | "INFORMATION",
27 | "WARNING",
28 | "ERROR",
29 | "CRITICAL"
30 | ],
31 | "event_name": "System",
32 | "log_group_name": "/aws/ec2/windows-server-2012R2/WindowsEventLog-System",
33 | "log_stream_name": "{instance_id}",
34 | "retention_in_days": 14
35 | },
36 | {
37 | "event_format": "xml",
38 | "event_levels": [
39 | "VERBOSE",
40 | "INFORMATION",
41 | "WARNING",
42 | "ERROR",
43 | "CRITICAL"
44 | ],
45 | "event_name": "Application",
46 | "log_group_name": "/aws/ec2/windows-server-2012R2/WindowsEventLog-Application",
47 | "log_stream_name": "{instance_id}",
48 | "retention_in_days": 14
49 | },
50 | {
51 | "event_format": "xml",
52 | "event_levels": [
53 | "VERBOSE",
54 | "INFORMATION",
55 | "WARNING",
56 | "ERROR",
57 | "CRITICAL"
58 | ],
59 | "event_name": "Security",
60 | "log_group_name": "/aws/ec2/windows-server-2012R2/WindowsEventLog-Security",
61 | "log_stream_name": "{instance_id}",
62 | "retention_in_days": 14
63 | }
64 | ]
65 | }
66 | }
67 | },
68 | "metrics": {
69 | "aggregation_dimensions": [
70 | [
71 | "InstanceId"
72 | ]
73 | ],
74 | "append_dimensions": {
75 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
76 | "ImageId": "${aws:ImageId}",
77 | "InstanceId": "${aws:InstanceId}",
78 | "InstanceType": "${aws:InstanceType}"
79 | },
80 | "metrics_collected": {
81 | "LogicalDisk": {
82 | "measurement": [
83 | "% Free Space"
84 | ],
85 | "metrics_collection_interval": 10,
86 | "resources": [
87 | "*"
88 | ]
89 | },
90 | "Memory": {
91 | "measurement": [
92 | "% Committed Bytes In Use"
93 | ],
94 | "metrics_collection_interval": 10
95 | },
96 | "Paging File": {
97 | "measurement": [
98 | "% Usage"
99 | ],
100 | "metrics_collection_interval": 10,
101 | "resources": [
102 | "*"
103 | ]
104 | },
105 | "PhysicalDisk": {
106 | "measurement": [
107 | "% Disk Time"
108 | ],
109 | "metrics_collection_interval": 10,
110 | "resources": [
111 | "*"
112 | ]
113 | },
114 | "Processor": {
115 | "measurement": [
116 | "% User Time",
117 | "% Idle Time",
118 | "% Interrupt Time"
119 | ],
120 | "metrics_collection_interval": 10,
121 | "resources": [
122 | "*"
123 | ]
124 | }
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_WindowsServer-2016.json:
--------------------------------------------------------------------------------
1 | {
2 | "logs": {
3 | "logs_collected": {
4 | "files": {
5 | "collect_list": [
6 | {
7 | "file_path": "C:\\ProgramData\\Amazon\\SSM\\Logs\\amazon-ssm-agent.log",
8 | "log_group_name": "/aws/ec2/windows-server-2016/awslog-ssm-agent",
9 | "log_stream_name": "{instance_id}",
10 | "retention_in_days": 14
11 | },
12 | {
13 | "file_path": "C:\\ProgramData\\Amazon\\AmazonCloudWatchAgent\\Logs\\amazon-cloudwatch-agent.log",
14 | "log_group_name": "/aws/ec2/windows-server-2016/awslog-cloudwatch-agent",
15 | "log_stream_name": "{instance_id}",
16 | "retention_in_days": 14
17 | }
18 | ]
19 | },
20 | "windows_events": {
21 | "collect_list": [
22 | {
23 | "event_format": "xml",
24 | "event_levels": [
25 | "VERBOSE",
26 | "INFORMATION",
27 | "WARNING",
28 | "ERROR",
29 | "CRITICAL"
30 | ],
31 | "event_name": "System",
32 | "log_group_name": "/aws/ec2/windows-server-2016/WindowsEventLog-System",
33 | "log_stream_name": "{instance_id}",
34 | "retention_in_days": 14
35 | },
36 | {
37 | "event_format": "xml",
38 | "event_levels": [
39 | "VERBOSE",
40 | "INFORMATION",
41 | "WARNING",
42 | "ERROR",
43 | "CRITICAL"
44 | ],
45 | "event_name": "Application",
46 | "log_group_name": "/aws/ec2/windows-server-2016/WindowsEventLog-Application",
47 | "log_stream_name": "{instance_id}",
48 | "retention_in_days": 14
49 | },
50 | {
51 | "event_format": "xml",
52 | "event_levels": [
53 | "VERBOSE",
54 | "INFORMATION",
55 | "WARNING",
56 | "ERROR",
57 | "CRITICAL"
58 | ],
59 | "event_name": "Security",
60 | "log_group_name": "/aws/ec2/windows-server-2016/WindowsEventLog-Security",
61 | "log_stream_name": "{instance_id}",
62 | "retention_in_days": 14
63 | }
64 | ]
65 | }
66 | }
67 | },
68 | "metrics": {
69 | "aggregation_dimensions": [
70 | [
71 | "InstanceId"
72 | ]
73 | ],
74 | "append_dimensions": {
75 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
76 | "ImageId": "${aws:ImageId}",
77 | "InstanceId": "${aws:InstanceId}",
78 | "InstanceType": "${aws:InstanceType}"
79 | },
80 | "metrics_collected": {
81 | "LogicalDisk": {
82 | "measurement": [
83 | "% Free Space"
84 | ],
85 | "metrics_collection_interval": 10,
86 | "resources": [
87 | "*"
88 | ]
89 | },
90 | "Memory": {
91 | "measurement": [
92 | "% Committed Bytes In Use"
93 | ],
94 | "metrics_collection_interval": 10
95 | },
96 | "Paging File": {
97 | "measurement": [
98 | "% Usage"
99 | ],
100 | "metrics_collection_interval": 10,
101 | "resources": [
102 | "*"
103 | ]
104 | },
105 | "PhysicalDisk": {
106 | "measurement": [
107 | "% Disk Time"
108 | ],
109 | "metrics_collection_interval": 10,
110 | "resources": [
111 | "*"
112 | ]
113 | },
114 | "Processor": {
115 | "measurement": [
116 | "% User Time",
117 | "% Idle Time",
118 | "% Interrupt Time"
119 | ],
120 | "metrics_collection_interval": 10,
121 | "resources": [
122 | "*"
123 | ]
124 | }
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_WindowsServer-2019.json:
--------------------------------------------------------------------------------
1 | {
2 | "logs": {
3 | "logs_collected": {
4 | "files": {
5 | "collect_list": [
6 | {
7 | "file_path": "C:\\ProgramData\\Amazon\\SSM\\Logs\\amazon-ssm-agent.log",
8 | "log_group_name": "/aws/ec2/windows-server-2019/awslog-ssm-agent",
9 | "log_stream_name": "{instance_id}",
10 | "retention_in_days": 14
11 | },
12 | {
13 | "file_path": "C:\\ProgramData\\Amazon\\AmazonCloudWatchAgent\\Logs\\amazon-cloudwatch-agent.log",
14 | "log_group_name": "/aws/ec2/windows-server-2019/awslog-cloudwatch-agent",
15 | "log_stream_name": "{instance_id}",
16 | "retention_in_days": 14
17 | }
18 | ]
19 | },
20 | "windows_events": {
21 | "collect_list": [
22 | {
23 | "event_format": "xml",
24 | "event_levels": [
25 | "VERBOSE",
26 | "INFORMATION",
27 | "WARNING",
28 | "ERROR",
29 | "CRITICAL"
30 | ],
31 | "event_name": "System",
32 | "log_group_name": "/aws/ec2/windows-server-2019/WindowsEventLog-System",
33 | "log_stream_name": "{instance_id}",
34 | "retention_in_days": 14
35 | },
36 | {
37 | "event_format": "xml",
38 | "event_levels": [
39 | "VERBOSE",
40 | "INFORMATION",
41 | "WARNING",
42 | "ERROR",
43 | "CRITICAL"
44 | ],
45 | "event_name": "Application",
46 | "log_group_name": "/aws/ec2/windows-server-2019/WindowsEventLog-Application",
47 | "log_stream_name": "{instance_id}",
48 | "retention_in_days": 14
49 | },
50 | {
51 | "event_format": "xml",
52 | "event_levels": [
53 | "VERBOSE",
54 | "INFORMATION",
55 | "WARNING",
56 | "ERROR",
57 | "CRITICAL"
58 | ],
59 | "event_name": "Security",
60 | "log_group_name": "/aws/ec2/windows-server-2019/WindowsEventLog-Security",
61 | "log_stream_name": "{instance_id}",
62 | "retention_in_days": 14
63 | }
64 | ]
65 | }
66 | }
67 | },
68 | "metrics": {
69 | "aggregation_dimensions": [
70 | [
71 | "InstanceId"
72 | ]
73 | ],
74 | "append_dimensions": {
75 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
76 | "ImageId": "${aws:ImageId}",
77 | "InstanceId": "${aws:InstanceId}",
78 | "InstanceType": "${aws:InstanceType}"
79 | },
80 | "metrics_collected": {
81 | "LogicalDisk": {
82 | "measurement": [
83 | "% Free Space"
84 | ],
85 | "metrics_collection_interval": 10,
86 | "resources": [
87 | "*"
88 | ]
89 | },
90 | "Memory": {
91 | "measurement": [
92 | "% Committed Bytes In Use"
93 | ],
94 | "metrics_collection_interval": 10
95 | },
96 | "Paging File": {
97 | "measurement": [
98 | "% Usage"
99 | ],
100 | "metrics_collection_interval": 10,
101 | "resources": [
102 | "*"
103 | ]
104 | },
105 | "PhysicalDisk": {
106 | "measurement": [
107 | "% Disk Time"
108 | ],
109 | "metrics_collection_interval": 10,
110 | "resources": [
111 | "*"
112 | ]
113 | },
114 | "Processor": {
115 | "measurement": [
116 | "% User Time",
117 | "% Idle Time",
118 | "% Interrupt Time"
119 | ],
120 | "metrics_collection_interval": 10,
121 | "resources": [
122 | "*"
123 | ]
124 | }
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_WindowsServer-2022.json:
--------------------------------------------------------------------------------
1 | {
2 | "logs": {
3 | "logs_collected": {
4 | "files": {
5 | "collect_list": [
6 | {
7 | "file_path": "C:\\ProgramData\\Amazon\\SSM\\Logs\\amazon-ssm-agent.log",
8 | "log_group_name": "/aws/ec2/windows-server-2022/awslog-ssm-agent",
9 | "log_stream_name": "{instance_id}",
10 | "retention_in_days": 14
11 | },
12 | {
13 | "file_path": "C:\\ProgramData\\Amazon\\AmazonCloudWatchAgent\\Logs\\amazon-cloudwatch-agent.log",
14 | "log_group_name": "/aws/ec2/windows-server-2022/awslog-cloudwatch-agent",
15 | "log_stream_name": "{instance_id}",
16 | "retention_in_days": 14
17 | }
18 | ]
19 | },
20 | "windows_events": {
21 | "collect_list": [
22 | {
23 | "event_format": "xml",
24 | "event_levels": [
25 | "VERBOSE",
26 | "INFORMATION",
27 | "WARNING",
28 | "ERROR",
29 | "CRITICAL"
30 | ],
31 | "event_name": "System",
32 | "log_group_name": "/aws/ec2/windows-server-2022/WindowsEventLog-System",
33 | "log_stream_name": "{instance_id}",
34 | "retention_in_days": 14
35 | },
36 | {
37 | "event_format": "xml",
38 | "event_levels": [
39 | "VERBOSE",
40 | "INFORMATION",
41 | "WARNING",
42 | "ERROR",
43 | "CRITICAL"
44 | ],
45 | "event_name": "Application",
46 | "log_group_name": "/aws/ec2/windows-server-2022/WindowsEventLog-Application",
47 | "log_stream_name": "{instance_id}",
48 | "retention_in_days": 14
49 | },
50 | {
51 | "event_format": "xml",
52 | "event_levels": [
53 | "VERBOSE",
54 | "INFORMATION",
55 | "WARNING",
56 | "ERROR",
57 | "CRITICAL"
58 | ],
59 | "event_name": "Security",
60 | "log_group_name": "/aws/ec2/windows-server-2022/WindowsEventLog-Security",
61 | "log_stream_name": "{instance_id}",
62 | "retention_in_days": 14
63 | }
64 | ]
65 | }
66 | }
67 | },
68 | "metrics": {
69 | "aggregation_dimensions": [
70 | [
71 | "InstanceId"
72 | ]
73 | ],
74 | "append_dimensions": {
75 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
76 | "ImageId": "${aws:ImageId}",
77 | "InstanceId": "${aws:InstanceId}",
78 | "InstanceType": "${aws:InstanceType}"
79 | },
80 | "metrics_collected": {
81 | "LogicalDisk": {
82 | "measurement": [
83 | "% Free Space"
84 | ],
85 | "metrics_collection_interval": 10,
86 | "resources": [
87 | "*"
88 | ]
89 | },
90 | "Memory": {
91 | "measurement": [
92 | "% Committed Bytes In Use"
93 | ],
94 | "metrics_collection_interval": 10
95 | },
96 | "Paging File": {
97 | "measurement": [
98 | "% Usage"
99 | ],
100 | "metrics_collection_interval": 10,
101 | "resources": [
102 | "*"
103 | ]
104 | },
105 | "PhysicalDisk": {
106 | "measurement": [
107 | "% Disk Time"
108 | ],
109 | "metrics_collection_interval": 10,
110 | "resources": [
111 | "*"
112 | ]
113 | },
114 | "Processor": {
115 | "measurement": [
116 | "% User Time",
117 | "% Idle Time",
118 | "% Interrupt Time"
119 | ],
120 | "metrics_collection_interval": 10,
121 | "resources": [
122 | "*"
123 | ]
124 | }
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/Config_AmazonCloudWatchAgent/AmazonCloudWatchAgent_WindowsServer-2025.json:
--------------------------------------------------------------------------------
1 | {
2 | "logs": {
3 | "logs_collected": {
4 | "files": {
5 | "collect_list": [
6 | {
7 | "file_path": "C:\\ProgramData\\Amazon\\SSM\\Logs\\amazon-ssm-agent.log",
8 | "log_group_name": "/aws/ec2/windows-server-2025/awslog-ssm-agent",
9 | "log_stream_name": "{instance_id}",
10 | "retention_in_days": 14
11 | },
12 | {
13 | "file_path": "C:\\ProgramData\\Amazon\\AmazonCloudWatchAgent\\Logs\\amazon-cloudwatch-agent.log",
14 | "log_group_name": "/aws/ec2/windows-server-2025/awslog-cloudwatch-agent",
15 | "log_stream_name": "{instance_id}",
16 | "retention_in_days": 14
17 | }
18 | ]
19 | },
20 | "windows_events": {
21 | "collect_list": [
22 | {
23 | "event_format": "xml",
24 | "event_levels": [
25 | "VERBOSE",
26 | "INFORMATION",
27 | "WARNING",
28 | "ERROR",
29 | "CRITICAL"
30 | ],
31 | "event_name": "System",
32 | "log_group_name": "/aws/ec2/windows-server-2025/WindowsEventLog-System",
33 | "log_stream_name": "{instance_id}",
34 | "retention_in_days": 14
35 | },
36 | {
37 | "event_format": "xml",
38 | "event_levels": [
39 | "VERBOSE",
40 | "INFORMATION",
41 | "WARNING",
42 | "ERROR",
43 | "CRITICAL"
44 | ],
45 | "event_name": "Application",
46 | "log_group_name": "/aws/ec2/windows-server-2025/WindowsEventLog-Application",
47 | "log_stream_name": "{instance_id}",
48 | "retention_in_days": 14
49 | },
50 | {
51 | "event_format": "xml",
52 | "event_levels": [
53 | "VERBOSE",
54 | "INFORMATION",
55 | "WARNING",
56 | "ERROR",
57 | "CRITICAL"
58 | ],
59 | "event_name": "Security",
60 | "log_group_name": "/aws/ec2/windows-server-2025/WindowsEventLog-Security",
61 | "log_stream_name": "{instance_id}",
62 | "retention_in_days": 14
63 | }
64 | ]
65 | }
66 | }
67 | },
68 | "metrics": {
69 | "aggregation_dimensions": [
70 | [
71 | "InstanceId"
72 | ]
73 | ],
74 | "append_dimensions": {
75 | "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
76 | "ImageId": "${aws:ImageId}",
77 | "InstanceId": "${aws:InstanceId}",
78 | "InstanceType": "${aws:InstanceType}"
79 | },
80 | "metrics_collected": {
81 | "LogicalDisk": {
82 | "measurement": [
83 | "% Free Space"
84 | ],
85 | "metrics_collection_interval": 10,
86 | "resources": [
87 | "*"
88 | ]
89 | },
90 | "Memory": {
91 | "measurement": [
92 | "% Committed Bytes In Use"
93 | ],
94 | "metrics_collection_interval": 10
95 | },
96 | "Paging File": {
97 | "measurement": [
98 | "% Usage"
99 | ],
100 | "metrics_collection_interval": 10,
101 | "resources": [
102 | "*"
103 | ]
104 | },
105 | "PhysicalDisk": {
106 | "measurement": [
107 | "% Disk Time"
108 | ],
109 | "metrics_collection_interval": 10,
110 | "resources": [
111 | "*"
112 | ]
113 | },
114 | "Processor": {
115 | "measurement": [
116 | "% User Time",
117 | "% Idle Time",
118 | "% Interrupt Time"
119 | ],
120 | "metrics_collection_interval": 10,
121 | "resources": [
122 | "*"
123 | ]
124 | }
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/Miscellaneous/Information/[Infomation] Amazon Web Services - Service Status - RSS-Feed.md:
--------------------------------------------------------------------------------
1 | # [Infomation] - Amazon Web Services - Service Status - RSS-Feed
2 |
3 | ## Source Page
4 | - https://status.aws.amazon.com/
5 |
6 | ## RSS Feed [ap-northeast-1 / Tokyo]
7 |
8 | - Amazon API Gateway (Tokyo)
9 | - https://status.aws.amazon.com/rss/apigateway-ap-northeast-1.rss
10 |
11 | - Amazon AppStream 2.0 (Tokyo)
12 | - https://status.aws.amazon.com/rss/appstream2-ap-northeast-1.rss
13 |
14 | - Amazon Athena (Tokyo)
15 | - https://status.aws.amazon.com/rss/athena-ap-northeast-1.rss
16 |
17 | - Amazon Chime
18 | - https://status.aws.amazon.com/rss/chime.rss
19 |
20 | - Amazon CloudFront
21 | - https://status.aws.amazon.com/rss/cloudfront.rss
22 |
23 | - Amazon CloudSearch (Tokyo)
24 | - https://status.aws.amazon.com/rss/cloudsearch-ap-northeast-1.rss
25 |
26 | - Amazon CloudWatch (Tokyo)
27 | - https://status.aws.amazon.com/rss/cloudwatch-ap-northeast-1.rss
28 |
29 | - Amazon Cognito (Tokyo)
30 | - https://status.aws.amazon.com/rss/cognito-ap-northeast-1.rss
31 |
32 | - Amazon DynamoDB (Tokyo)
33 | - https://status.aws.amazon.com/rss/dynamodb-ap-northeast-1.rss
34 |
35 | - Amazon DynamoDB Accelerator (DAX) (Tokyo)
36 | - https://status.aws.amazon.com/rss/dynamodb-dax-ap-northeast-1.rss
37 |
38 | - Amazon EC2 Systems Manager (Tokyo)
39 | - https://status.aws.amazon.com/rss/ec2systemsmanager-ap-northeast-1.rss
40 |
41 | - Amazon Elastic Compute Cloud (Tokyo)
42 | - https://status.aws.amazon.com/rss/ec2-ap-northeast-1.rss
43 |
44 | - Amazon Elastic Container Registry (Tokyo)
45 | - https://status.aws.amazon.com/rss/ecr-ap-northeast-1.rss
46 |
47 | - Amazon Elastic Container Service (Tokyo)
48 | - https://status.aws.amazon.com/rss/ecs-ap-northeast-1.rss
49 |
50 | - Amazon Elastic Load Balancing (Tokyo)
51 | - https://status.aws.amazon.com/rss/elb-ap-northeast-1.rss
52 |
53 | - Amazon Elastic MapReduce (Tokyo)
54 | - https://status.aws.amazon.com/rss/emr-ap-northeast-1.rss
55 |
56 | - Amazon Elastic Transcoder (Tokyo)
57 | - https://status.aws.amazon.com/rss/elastictranscoder-ap-northeast-1.rss
58 |
59 | - Amazon ElastiCache (Tokyo)
60 | - https://status.aws.amazon.com/rss/elasticache-ap-northeast-1.rss
61 |
62 | - Amazon Elasticsearch Service (Tokyo)
63 | - https://status.aws.amazon.com/rss/elasticsearch-ap-northeast-1.rss
64 |
65 | - Amazon FreeRTOS (Tokyo)
66 | - https://status.aws.amazon.com/rss/freertos-ap-northeast-1.rss
67 |
68 | - Amazon GameLift (Tokyo)
69 | - https://status.aws.amazon.com/rss/gamelift-ap-northeast-1.rss
70 |
71 | - Amazon Glacier (Tokyo)
72 | - https://status.aws.amazon.com/rss/glacier-ap-northeast-1.rss
73 |
74 | - Amazon GuardDuty (Tokyo)
75 | - https://status.aws.amazon.com/rss/guardduty-ap-northeast-1.rss
76 |
77 | - Amazon Inspector (Tokyo)
78 | - https://status.aws.amazon.com/rss/inspector-ap-northeast-1.rss
79 |
80 | - Amazon Kinesis (Tokyo)
81 | - https://status.aws.amazon.com/rss/kinesis-ap-northeast-1.rss
82 |
83 | - Amazon Kinesis Firehose (Tokyo)
84 | - https://status.aws.amazon.com/rss/firehose-ap-northeast-1.rss
85 |
86 | - Amazon Kinesis Video Streams (Tokyo)
87 | - https://status.aws.amazon.com/rss/acuity-ap-northeast-1.rss
88 |
89 | - Amazon Lightsail (Tokyo)
90 | - https://status.aws.amazon.com/rss/lightsail-ap-northeast-1.rss
91 |
92 | - Amazon Polly (Tokyo)
93 | - https://status.aws.amazon.com/rss/polly-ap-northeast-1.rss
94 |
95 | - Amazon Redshift (Tokyo)
96 | - https://status.aws.amazon.com/rss/redshift-ap-northeast-1.rss
97 |
98 | - Amazon Rekognition (Tokyo)
99 | - https://status.aws.amazon.com/rss/rekognition-ap-northeast-1.rss
100 |
101 | - Amazon Relational Database Service (Tokyo)
102 | - https://status.aws.amazon.com/rss/rds-ap-northeast-1.rss
103 |
104 | - Amazon Route 53
105 | - https://status.aws.amazon.com/rss/route53.rss
106 |
107 | - Amazon Route 53 Private DNS (Tokyo)
108 | - https://status.aws.amazon.com/rss/route53-ap-northeast-1.rss
109 |
110 | - Amazon Simple Notification Service (Tokyo)
111 | - https://status.aws.amazon.com/rss/sns-ap-northeast-1.rss
112 |
113 | - Amazon Simple Queue Service (Tokyo)
114 | - https://status.aws.amazon.com/rss/sqs-ap-northeast-1.rss
115 |
116 | - Amazon Simple Storage Service (Tokyo)
117 | - https://status.aws.amazon.com/rss/s3-ap-northeast-1.rss
118 |
119 | - Amazon Simple Workflow Service (Tokyo)
120 | - https://status.aws.amazon.com/rss/swf-ap-northeast-1.rss
121 |
122 | - Amazon SimpleDB (Tokyo)
123 | - https://status.aws.amazon.com/rss/simpledb-ap-northeast-1.rss
124 |
125 | - Amazon Virtual Private Cloud (Tokyo)
126 | - https://status.aws.amazon.com/rss/vpc-ap-northeast-1.rss
127 |
128 | - Amazon WorkDocs (Tokyo)
129 | - https://status.aws.amazon.com/rss/workdocs-ap-northeast-1.rss
130 |
131 | - Amazon WorkSpaces (Tokyo)
132 | - https://status.aws.amazon.com/rss/workspaces-ap-northeast-1.rss
133 |
134 | - Auto Scaling (Tokyo)
135 | - https://status.aws.amazon.com/rss/autoscaling-ap-northeast-1.rss
136 |
137 | - AWS Batch (Tokyo)
138 | - https://status.aws.amazon.com/rss/batch-ap-northeast-1.rss
139 |
140 | - AWS Billing Console
141 | - https://status.aws.amazon.com/rss/billingconsole.rss
142 |
143 | - AWS Certificate Manager (Tokyo)
144 | - https://status.aws.amazon.com/rss/certificatemanager-ap-northeast-1.rss
145 |
146 | - AWS CloudFormation (Tokyo)
147 | - https://status.aws.amazon.com/rss/cloudformation-ap-northeast-1.rss
148 |
149 | - AWS CloudHSM (Tokyo)
150 | - https://status.aws.amazon.com/rss/cloudhsm-ap-northeast-1.rss
151 |
152 | - AWS CloudTrail (Tokyo)
153 | - https://status.aws.amazon.com/rss/cloudtrail-ap-northeast-1.rss
154 |
155 | - AWS CodeBuild (Tokyo)
156 | - https://status.aws.amazon.com/rss/codebuild-ap-northeast-1.rss
157 |
158 | - AWS CodeCommit (Tokyo)
159 | - https://status.aws.amazon.com/rss/codecommit-ap-northeast-1.rss
160 |
161 | - AWS CodeDeploy (Tokyo)
162 | - https://status.aws.amazon.com/rss/codedeploy-ap-northeast-1.rss
163 |
164 | - AWS CodePipeline (Tokyo)
165 | - https://status.aws.amazon.com/rss/codepipeline-ap-northeast-1.rss
166 |
167 | - AWS CodeStar (Tokyo)
168 | - https://status.aws.amazon.com/rss/codestar-ap-northeast-1.rss
169 |
170 | - AWS Config (Tokyo)
171 | - https://status.aws.amazon.com/rss/config-ap-northeast-1.rss
172 |
173 | - AWS Data Pipeline (Tokyo)
174 | - https://status.aws.amazon.com/rss/datapipeline-ap-northeast-1.rss
175 |
176 | - AWS Database Migration Service (Tokyo)
177 | - https://status.aws.amazon.com/rss/dms-ap-northeast-1.rss
178 |
179 | - AWS Direct Connect (Tokyo)
180 | - https://status.aws.amazon.com/rss/directconnect-ap-northeast-1.rss
181 |
182 | - AWS Directory Service (Tokyo)
183 | - https://status.aws.amazon.com/rss/directoryservice-ap-northeast-1.rss
184 |
185 | - AWS Elastic Beanstalk (Tokyo)
186 | - https://status.aws.amazon.com/rss/elasticbeanstalk-ap-northeast-1.rss
187 |
188 | - AWS Elemental MediaConvert (Tokyo)
189 | - https://status.aws.amazon.com/rss/mediaconvert-ap-northeast-1.rss
190 |
191 | - AWS Elemental MediaLive (Tokyo)
192 | - https://status.aws.amazon.com/rss/elementalmedialive-ap-northeast-1.rss
193 |
194 | - AWS Elemental MediaPackage (Tokyo)
195 | - https://status.aws.amazon.com/rss/elementalmediapackage-ap-northeast-1.rss
196 |
197 | - AWS Elemental MediaStore (Tokyo)
198 | - https://status.aws.amazon.com/rss/elementalmediastore-ap-northeast-1.rss
199 |
200 | - AWS Greengrass (Tokyo)
201 | - https://status.aws.amazon.com/rss/awsgreengrass-ap-northeast-1.rss
202 |
203 | - AWS Identity and Access Management (Tokyo)
204 | - https://status.aws.amazon.com/rss/iam-ap-northeast-1.rss
205 |
206 | - AWS Import/Export
207 | - https://status.aws.amazon.com/rss/import-export.rss
208 |
209 | - AWS Internet Connectivity (Tokyo)
210 | - https://status.aws.amazon.com/rss/internetconnectivity-ap-northeast-1.rss
211 |
212 | - AWS IoT (Tokyo)
213 | - https://status.aws.amazon.com/rss/awsiot-ap-northeast-1.rss
214 |
215 | - AWS IoT Device Management
216 | - https://status.aws.amazon.com/rss/awsiotdevicemanagement.rss
217 |
218 | - AWS Key Management Service (Tokyo)
219 | - https://status.aws.amazon.com/rss/kms-ap-northeast-1.rss
220 |
221 | - AWS Lambda (Tokyo)
222 | - https://status.aws.amazon.com/rss/lambda-ap-northeast-1.rss
223 |
224 | - AWS Management Console
225 | - https://status.aws.amazon.com/rss/management-console.rss
226 |
227 | - AWS Marketplace
228 | - https://status.aws.amazon.com/rss/marketplace.rss
229 |
230 | - AWS NAT Gateway (Tokyo)
231 | - https://status.aws.amazon.com/rss/natgateway-ap-northeast-1.rss
232 |
233 | - AWS OpsWorks for Chef Automate (Tokyo)
234 | - https://status.aws.amazon.com/rss/opsworkschef-ap-northeast-1.rss
235 |
236 | - AWS OpsWorks for Puppet Enterprise (Tokyo)
237 | - https://status.aws.amazon.com/rss/opsworkspuppet-ap-northeast-1.rss
238 |
239 | - AWS OpsWorks Stacks (Tokyo)
240 | - https://status.aws.amazon.com/rss/opsworks-ap-northeast-1.rss
241 |
242 | - AWS Organizations
243 | - https://status.aws.amazon.com/rss/organizations.rss
244 |
245 | - AWS Resource Groups
246 | - https://status.aws.amazon.com/rss/resourcegroups.rss
247 |
248 | - AWS Resource Groups Tagging API (Tokyo)
249 | - https://status.aws.amazon.com/rss/resourcegroupstaggingapi-ap-northeast-1.rss
250 |
251 | - AWS Serverless Application Repository (Tokyo)
252 | - https://status.aws.amazon.com/rss/serverlessrepo-ap-northeast-1.rss
253 |
254 | - AWS Service Catalog (Tokyo)
255 | - https://status.aws.amazon.com/rss/servicecatalog-ap-northeast-1.rss
256 |
257 | - AWS Step Functions (Tokyo)
258 | - https://status.aws.amazon.com/rss/state-ap-northeast-1.rss
259 |
260 | - AWS Storage Gateway (Tokyo)
261 | - https://status.aws.amazon.com/rss/storagegateway-ap-northeast-1.rss
262 |
263 | - AWS WAF
264 | - https://status.aws.amazon.com/rss/awswaf.rss
265 |
266 | - AWS X-Ray (Tokyo)
267 | - https://status.aws.amazon.com/rss/xray-ap-northeast-1.rss
268 |
269 |
270 |
271 | ## RSS Feed [ap-northeast-3 / Osaka-Local]
272 |
273 |
--------------------------------------------------------------------------------
/Miscellaneous/Information/[Infomation] Amazon WorkSpaces & Amazon AppStream 2.0.md:
--------------------------------------------------------------------------------
1 | # Amazon WorkSpaces, Amazon AppStream 2.0 Information
2 |
3 | ## Overview
4 |
5 | - Amazon WorkSpaces documentation
6 | - (https://aws.amazon.com/documentation/workspaces/)
7 |
8 | - Amazon Appstream 2.0 documentation
9 | - (https://aws.amazon.com/documentation/appstream/)
10 |
11 | ## Technical Information (Amazon WorkSpaces)
12 |
13 | - [Amazon WorkSpaces Bundle base on EC2 Instance]
14 | - (https://aws.amazon.com/jp/workspaces/details/#Amazon_WorkSpaces_Bundles)
15 |
16 |
17 | | Bundle Type | EC2 Instance Type |
18 | |:-----------|------------:|
19 | | Value Bundle | t2.small |
20 | | Standard Bundle | t2.medium |
21 | | Performance Bundle | m3.large -> t2.large |
22 | | Power Bundle | t2.xlarge |
23 | | Graphics Bundle | g2.2xlarge |
24 |
25 | Amazon WorkSpaces is enabled at T2 Unlimited
26 |
27 | - [Amazon WorkSpaces Management Interface IP Ranges (AWS Managed VPC)]
28 | - (http://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-port-requirements.html#network-interfaces)
29 |
30 |
31 | | Region | Code | AWS Managed VPC CIDR |
32 | |:-----------|------------:|:------------:|
33 | | US East (N. Virginia) | us-east-1 | 172.31.0.0/16, 192.168.0.0/16, and 198.19.0.0/16 |
34 | | US West (Oregon) | us-west-2 | 172.31.0.0/16 and 192.168.0.0/16 |
35 | | EU (Ireland) | eu-west-1 | 172.31.0.0/16 and 192.168.0.0/16 |
36 | | EU (Frankfurt) | eu-central-1 | 198.19.0.0/16 |
37 | | EU (London) | eu-west-2 | 198.19.0.0/16 |
38 | | Asia Pacific (Sydney) | ap-southeast-2 | 172.31.0.0/16 and 192.168.0.0/16 |
39 | | Asia Pacific (Tokyo) | ap-northeast-1 | 198.19.0.0/16 |
40 | | Asia Pacific (Singapore) | ap-southeast-1 | 198.19.0.0/16 |
41 |
42 |
43 | ## Technical Information (Amazon AppStream 2.0)
44 |
45 | - [Amazon AppStream 2.0 Instance Families base on EC2 Instance]
46 | - (http://docs.aws.amazon.com/appstream2/latest/developerguide/instance-types.html)
47 |
48 | | Instance Family | Instance Code-Types | EC2 instance-type Family |
49 | |:-----------|------------:|:------------:|
50 | | General Purpose | stream.standard | T2 Instance |
51 | | Memory Optimized | stream.memory | R3 Instance |
52 | | Compute Optimized | stream.compute | C4 Instance |
53 | | Graphics Design | stream.graphics-design | E3 Instance |
54 | | Graphics Desktop | stream.graphics-desktop | G2 Instance |
55 | | Graphics Pro | stream.graphics-pro | G3 Instance |
56 |
57 | - [Amazon AppStream 2.0 Management Interface IP Ranges (AWS Managed VPC)]
58 |
59 | | Region | Code | AWS Managed VPC CIDR |
60 | |:-----------|------------:|:------------:|
61 | | US East (N. Virginia) | us-east-1 | 198.19.0.0/16 |
62 | | US West (Oregon) | us-west-2 | |
63 | | EU (Ireland) | eu-west-1 | |
64 | | Asia Pacific (Tokyo) | ap-northeast-1 | 198.19.0.0/16 |
65 |
66 | - [Amazon AppStream 2.0 IAM Profile Information]
67 |
68 | | Bundle Type | IAM Profile Name | Meta-Data URL |
69 | |:-----------|------------:|:------------:|
70 | | Image Builder | PhotonImageBuilderInstance | http://169.254.169.254/latest/meta-data/iam/security-credentials/PhotonImageBuilderInstance |
71 |
--------------------------------------------------------------------------------
/Miscellaneous/Work-bastion-server/1st-UserData_Linux.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -v
2 |
3 | # Logger
4 | exec > >(tee /var/log/user-data_1st-userdata.log || logger -t user-data -s 2> /dev/console) 2>&1
5 |
6 | #-------------------------------------------------------------------------------
7 | # Parameter Settings
8 | #-------------------------------------------------------------------------------
9 |
10 | # Parameter Settings(Script)
11 | DecisionScript="https://raw.githubusercontent.com/usui-tk/amazon-ec2-userdata/master/Bastion/2nd-Decision_Linux-Distribution.sh"
12 |
13 | # Parameter file Settings
14 | cat > /tmp/userdata-parameter << __EOF__
15 | # Language [ja_JP.UTF-8],[en_US.UTF-8]
16 | Language="ja_JP.UTF-8"
17 |
18 | # Timezone [Asia/Tokyo],[UTC]
19 | Timezone="Asia/Tokyo"
20 |
21 | # VPC Network [IPv4],[IPv6]
22 | VpcNetwork="IPv4"
23 | __EOF__
24 |
25 | #-------------------------------------------------------------------------------
26 | # Select Script Execute
27 | #-------------------------------------------------------------------------------
28 |
29 | cd /tmp
30 |
31 | # Download Decision_Linux-Distribution.sh
32 | if [ $(command -v curl) ]; then
33 | curl --retry 5 --output Decision_Linux-Distribution.sh ${DecisionScript}
34 | else
35 | wget --tries=5 --no-check-certificate --output-document=Decision_Linux-Distribution.sh ${DecisionScript}
36 | fi
37 |
38 | # Execute Decision_Linux-Distribution.sh
39 | chmod 700 Decision_Linux-Distribution.sh
40 |
41 | bash -x Decision_Linux-Distribution.sh
42 |
--------------------------------------------------------------------------------
/Miscellaneous/Work-bastion-server/2nd-Decision_Linux-Distribution.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -v
2 |
3 | # Logger
4 | exec > >(tee /var/log/user-data_2nd-decision.log || logger -t user-data -s 2> /dev/console) 2>&1
5 |
6 | #-------------------------------------------------------------------------------
7 | # Parameter Settings
8 | #-------------------------------------------------------------------------------
9 |
10 | # Parameter Settings(BootstrapScript)
11 | ScriptForAmazonLinux="https://raw.githubusercontent.com/usui-tk/amazon-ec2-userdata/master/Bastion/3rd-Bootstrap_BastionServer_AmazonLinux-HVM.sh"
12 | ScriptForRHELv7="https://raw.githubusercontent.com/usui-tk/amazon-ec2-userdata/master/Bastion/3rd-Bootstrap_BastionServer_RHEL-v7-HVM.sh"
13 | ScriptForCentOSv7="https://raw.githubusercontent.com/usui-tk/amazon-ec2-userdata/master/Bastion/3rd-Bootstrap_BastionServer_CentOS-v7-HVM.sh"
14 | ScriptForUbuntu1604="https://raw.githubusercontent.com/usui-tk/amazon-ec2-userdata/master/Bastion/3rd-Bootstrap_BastionServer_Ubuntu-16.04-LTS-HVM.sh"
15 |
16 | #-------------------------------------------------------------------------------
17 | # Define Function
18 | #-------------------------------------------------------------------------------
19 |
20 | function lowercase(){
21 | echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
22 | }
23 |
24 | function uppercase(){
25 | echo "$1" | sed "y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/"
26 | }
27 |
28 | function get_os_info () {
29 | OS=`lowercase \`uname\``
30 | KERNEL=`uname -r`
31 | MACH=`uname -m`
32 | KERNEL_GROUP=$(echo $KERNEL | cut -f1-2 -d'.')
33 |
34 | if [ "${OS}" = "linux" ] ; then
35 | if [ -f /etc/os-release ]; then
36 | source /etc/os-release
37 | DIST_TYPE=$ID
38 | DIST=$NAME
39 | REV=$VERSION_ID
40 | elif [ -f /etc/centos-release ]; then
41 | DIST_TYPE='CentOS'
42 | DIST=`cat /etc/centos-release | sed s/\ release.*//`
43 | REV=`cat /etc/centos-release | sed s/.*release\ // | sed s/\ .*//`
44 | elif [ -f /etc/oracle-release ]; then
45 | DIST_TYPE='Oracle'
46 | DIST=`cat /etc/oracle-release | sed s/\ release.*//`
47 | REV=`cat /etc/oracle-release | sed s/.*release\ // | sed s/\ .*//`
48 | elif [ -f /etc/redhat-release ]; then
49 | DIST_TYPE='RHEL'
50 | DIST=`cat /etc/redhat-release | sed s/\ release.*//`
51 | REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
52 | elif [ -f /etc/system-release ]; then
53 | if grep "Amazon Linux AMI" /etc/system-release; then
54 | DIST_TYPE='Amazon'
55 | fi
56 | DIST=`cat /etc/system-release | sed s/\ release.*//`
57 | REV=`cat /etc/system-release | sed s/.*release\ // | sed s/\ .*//`
58 | else
59 | DIST_TYPE=""
60 | DIST=""
61 | REV=""
62 | fi
63 | fi
64 |
65 | if [[ -z "${DIST}" || -z "${DIST_TYPE}" ]]; then
66 | echo "Unsupported distribution: ${DIST} and distribution type: ${DIST_TYPE}"
67 | exit 1
68 | fi
69 |
70 | LOWERCASE_DIST_TYPE=`lowercase $DIST_TYPE`
71 | UNIQ_OS_ID="${LOWERCASE_DIST_TYPE}-${KERNEL}-${MACH}"
72 | UNIQ_PLATFORM_ID="${LOWERCASE_DIST_TYPE}-${KERNEL_GROUP}."
73 | }
74 |
75 | function get_bootstrap_script () {
76 | # Select a Bootstrap script
77 | if [ "${DIST}" = "Amazon Linux AMI" ] || [ "${DIST_TYPE}" = "amzn" ]; then
78 | # Bootstrap Script for Amazon Linux
79 | BootstrapScript=${ScriptForAmazonLinux}
80 | elif [ "${DIST}" = "RHEL" ] || [ "${DIST_TYPE}" = "rhel" ]; then
81 | if [ $(echo ${REV} | grep -e '7.') ]; then
82 | # Bootstrap Script for Red Hat Enterprise Linux v7.x
83 | BootstrapScript=${ScriptForRHELv7}
84 | else
85 | BootstrapScript=""
86 | fi
87 | elif [ "${DIST}" = "CentOS" ] || [ "${DIST_TYPE}" = "centos" ]; then
88 | if [ "${REV}" = "7" ]; then
89 | # Bootstrap Script for CentOS v7.x
90 | BootstrapScript=${ScriptForCentOSv7}
91 | else
92 | BootstrapScript=""
93 | fi
94 | elif [ "${DIST}" = "Ubuntu" ] || [ "${DIST_TYPE}" = "ubuntu" ]; then
95 | if [ $(echo ${REV} | grep -e '16.04') ]; then
96 | # Bootstrap Script for Ubuntu 16.04 LTS
97 | BootstrapScript=${ScriptForUbuntu1604}
98 | else
99 | BootstrapScript=""
100 | fi
101 | else
102 | BootstrapScript=""
103 | fi
104 |
105 | # Bootstrap script determination
106 | if [ -z "${BootstrapScript}" ]; then
107 | echo "Unsupported Bootstrap Script Linux distribution"
108 | exit 1
109 | fi
110 |
111 | }
112 |
113 | #-------------------------------------------------------------------------------
114 | # Main Routine
115 | #-------------------------------------------------------------------------------
116 |
117 | # call the os info function to get details
118 | get_os_info
119 |
120 | # call the bootstrap script function to get details
121 | get_bootstrap_script
122 |
123 | # Information Linux Distribution
124 | KERNEL_VERSION=$(uname -r )
125 | KERNEL_GROUP=$(echo "${KERNEL_VERSION}" | cut -f 1-2 -d'.')
126 | KERNEL_VERSION_WO_ARCH=$(basename ${KERNEL_VERSION} .x86_64)
127 |
128 | echo "Distribution of the machine is ${DIST}."
129 | echo "Distribution type of the machine is ${DIST_TYPE}."
130 | echo "Revision of the distro is ${REV}."
131 | echo "Kernel version of the machine is ${KERNEL_VERSION}."
132 |
133 | echo "BootstrapScript of the distro is ${BootstrapScript}."
134 |
135 | # Install curl Command
136 | if [ $(command -v curl) ]; then
137 | echo "Preinstalled curl command - Linux distribution: ${DIST} and distribution type: ${DIST_TYPE}"
138 | else
139 | if [ $(command -v yum) ]; then
140 | # Package Install curl Tools (Amazon Linux, Red Hat Enterprise Linux, CentOS, Oracle Linux)
141 | yum clean all
142 | yum install -y curl
143 | elif [ $(command -v apt-get) ]; then
144 | # Package Install curl Tools (Debian, Ubuntu)
145 | apt-get install -y curl
146 | elif [ $(command -v zypper) ]; then
147 | # Package Install curl Tools (SUSE Linux Enterprise Server)
148 | zypper --non-interactive install curl
149 | else
150 | echo "Unsupported distribution: ${DIST} and distribution type: ${DIST_TYPE}"
151 | exit 1
152 | fi
153 | fi
154 |
155 | #-------------------------------------------------------------------------------
156 | # Bootstrap Script Executite
157 | #-------------------------------------------------------------------------------
158 |
159 | bash -vc "$(curl -L ${BootstrapScript})"
160 |
--------------------------------------------------------------------------------
/Miscellaneous/Work-network-driver/Install_Linux_NetworkDriver_AWS_ena.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -v
2 |
3 | #-------------------------------------------------------------------------------
4 | # Custom Package Installation [Amazon Network Driver(ena)]
5 | #
6 | # Target Linux Distribution
7 | # - Red Hat Enterprise Linux v6.x
8 | # - CentOS v6.x
9 | #
10 | # Reference
11 | # http://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/enhanced-networking-ena.html
12 | # http://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/instance-types.html
13 | # https://github.com/amzn/amzn-drivers
14 | # https://github.com/amzn/amzn-drivers/releases
15 | # https://github.com/amzn/amzn-drivers/blob/master/kernel/linux/rpm/README-rpm.txt
16 | # https://github.com/amzn/amzn-drivers/blob/master/kernel/linux/ena/ENA_Linux_Best_Practices.rst
17 | #-------------------------------------------------------------------------------
18 |
19 | #-------------------------------------------------------------------------------
20 | # Parameter definition [Amazon Network Driver(ena)]
21 | #-------------------------------------------------------------------------------
22 |
23 | # Source code acquisition URL and definition of file name and version information
24 | SourceUrl="https://github.com/amzn/amzn-drivers/archive/refs/tags/ena_linux_2.5.0.tar.gz"
25 | SourceFile=$(echo ${SourceUrl##*/})
26 | SourceVersion=$(echo $SourceFile | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')
27 |
28 | #-------------------------------------------------------------------------------
29 | # Set AWS Instance MetaData
30 | #-------------------------------------------------------------------------------
31 |
32 | # Instance MetaData
33 | AZ=$(curl -s "http://169.254.169.254/latest/meta-data/placement/availability-zone")
34 | Region=$(echo $AZ | sed -e 's/.$//g')
35 | InstanceId=$(curl -s "http://169.254.169.254/latest/meta-data/instance-id")
36 | InstanceType=$(curl -s "http://169.254.169.254/latest/meta-data/instance-type")
37 | PrivateIp=$(curl -s "http://169.254.169.254/latest/meta-data/local-ipv4")
38 | AmiId=$(curl -s "http://169.254.169.254/latest/meta-data/ami-id")
39 |
40 | # IAM Role Information
41 | if [ $(compgen -ac | sort | uniq | grep -x jq) ]; then
42 | RoleArn=$(curl -s "http://169.254.169.254/latest/meta-data/iam/info" | jq -r '.InstanceProfileArn')
43 | RoleName=$(echo $RoleArn | cut -d '/' -f 2)
44 | fi
45 |
46 | #-------------------------------------------------------------------------------
47 | # Install Kernel module and Configure Dynamic Kernel Module Support (DKMS)
48 | #-------------------------------------------------------------------------------
49 |
50 | # Operating system support status of AWS Nitro Hypervisor (Before - Install ENA Kernel module)
51 | # https://github.com/awslabs/aws-support-tools/tree/master/EC2/NitroInstanceChecks
52 |
53 | TestScriptUrl="https://raw.githubusercontent.com/awslabs/aws-support-tools/master/EC2/NitroInstanceChecks/nitro_check_script.sh"
54 |
55 | Result=`curl -LI ${TestScriptUrl} -w '%{http_code}\n' -s -o /dev/null`
56 | if [ "${Result}" = 200 ]; then
57 | echo "Successful file existence check :" ${TestScriptUrl}
58 | curl -fsSL ${TestScriptUrl} | bash
59 | fi
60 |
61 | # Package Install Kernel Module
62 | eval $(grep ^DEFAULTKERNEL= /etc/sysconfig/kernel)
63 | if [ -n "$DEFAULTKERNEL" ]; then
64 | echo "Linux Kernel Package Name :" $DEFAULTKERNEL
65 | yum install -y ${DEFAULTKERNEL}-devel-$(uname -r) ${DEFAULTKERNEL}-headers-$(uname -r)
66 | else
67 | yum install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r)
68 | fi
69 |
70 | # Package Install Build Tool
71 | yum install -y gcc make rpm-build rpmdevtools
72 | # yum groupinstall -y "Development tools"
73 |
74 | # Package Install DKMS (from EPEL Repository)
75 | yum --enablerepo=epel install -y dkms
76 |
77 | # Set Grub2 Parameter for RHEL v7.x/CentOS v7.x
78 | if [ $(command -v grub2-mkconfig) ]; then
79 | rpm -qa | grep -e '^systemd-[0-9]\+\|^udev-[0-9]\+'
80 | sed -i '/^GRUB_CMDLINE_LINUX/s/"$/ net.ifnames=0"/' /etc/default/grub
81 | grub2-mkconfig -o /boot/grub2/grub.cfg
82 | fi
83 |
84 | # Get Amazon ENA Driver source code
85 | curl -LsS "${SourceUrl}" -o "/usr/src/${SourceFile}"
86 |
87 | cd /usr/src
88 | tar xzf ${SourceFile}
89 | rm -fr ${SourceFile}
90 |
91 | mv "amzn-drivers-ena_linux_${SourceVersion}" "amzn-drivers-${SourceVersion}"
92 | cd "amzn-drivers-${SourceVersion}"
93 |
94 | cat > dkms.conf << __EOF__
95 | PACKAGE_NAME="ena"
96 | PACKAGE_VERSION="TEMP-VERSION"
97 | CLEAN="make -C kernel/linux/ena clean"
98 | MAKE="make -C kernel/linux/ena/ BUILD_KERNEL=\${kernelver}"
99 | BUILT_MODULE_NAME[0]="ena"
100 | BUILT_MODULE_LOCATION="kernel/linux/ena"
101 | DEST_MODULE_LOCATION[0]="/updates"
102 | DEST_MODULE_NAME[0]="ena"
103 | AUTOINSTALL="yes"
104 | __EOF__
105 |
106 | sed -i 's/TEMP-VERSION/'${SourceVersion}'/g' dkms.conf
107 |
108 | # Make & Build & Install Amazon ENA Driver
109 | date; dkms add -m amzn-drivers -v ${SourceVersion}; date
110 |
111 | date; dkms build -m amzn-drivers -v ${SourceVersion}; date
112 |
113 | date; dkms install -m amzn-drivers -v ${SourceVersion}; date
114 |
115 | modinfo ena
116 |
117 | # Operating system support status of AWS Nitro Hypervisor (After - Install ENA Kernel module)
118 | # https://github.com/awslabs/aws-support-tools/tree/master/EC2/C5M5InstanceChecks
119 |
120 | # TestScriptUrl="https://raw.githubusercontent.com/awslabs/aws-support-tools/master/EC2/NitroInstanceChecks/nitro_check_script.sh"
121 |
122 | Result=`curl -LI ${TestScriptUrl} -w '%{http_code}\n' -s -o /dev/null`
123 | if [ "${Result}" = 200 ]; then
124 | echo "Successful file existence check :" ${TestScriptUrl}
125 | curl -fsSL ${TestScriptUrl} | bash
126 | fi
127 |
128 | #-------------------------------------------------------------------------------
129 | # Configure EC2 Instance Support for Amazon ENA Device
130 | #-------------------------------------------------------------------------------
131 |
132 | if [ -n "$RoleName" ]; then
133 | if [ $(command -v aws) ]; then
134 | # Get EC2 Instance Attribute(Elastic Network Adapter Status)
135 | aws ec2 describe-instances --instance-id ${InstanceId} --query "Reservations[].Instances[].EnaSupport" --output json --region ${Region}
136 |
137 | # Modify EC2 Instance Attribute(Elastic Network Adapter Status)
138 | # aws ec2 modify-instance-attribute --instance-id ${InstanceId} --ena-support
139 |
140 | # Get EC2 Instance Attribute(Elastic Network Adapter Status)
141 | # aws ec2 describe-instances --instance-id ${InstanceId} --query "Reservations[].Instances[].EnaSupport" --output json --region ${Region}
142 | fi
143 | fi
144 |
145 | #-------------------------------------------------------------------------------
146 | # Remove Network Persistent Rules
147 | #-------------------------------------------------------------------------------
148 | # [Important]
149 | # If your instance operating system contains an /etc/udev/rules.d/70-persistent-net.rules file, you must delete it before creating the AMI.
150 | # This file contains the MAC address for the Ethernet adapter of the original instance.
151 | # If another instance boots with this file, the operating system will be unable to find the device and eth0 might fail, causing boot issues.
152 | # This file is regenerated at the next boot cycle, and any instances launched from the AMI create their own version of the file.
153 | #-------------------------------------------------------------------------------
154 |
155 | if [ -f /etc/udev/rules.d/70-persistent-net.rules ]; then
156 | rm -fr /etc/udev/rules.d/70-persistent-net.rules
157 | fi
158 |
159 | #-------------------------------------------------------------------------------
160 | # For normal termination of SSM "Run Command"
161 | #-------------------------------------------------------------------------------
162 |
163 | exit 0
164 |
165 | #-------------------------------------------------------------------------------
166 | # End of File
167 | #-------------------------------------------------------------------------------
168 |
--------------------------------------------------------------------------------
/Miscellaneous/Work-network-driver/Install_Linux_NetworkDriver_Intel_ixgbevf.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -v
2 |
3 | #-------------------------------------------------------------------------------
4 | # Custom Package Installation [Intel Network Driver(ixgbevf)]
5 | #
6 | # Target Linux Distribution
7 | # - Red Hat Enterprise Linux v6.x
8 | # - CentOS v6.x
9 | #
10 | # Reference
11 | # http://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/enhanced-networking.html
12 | # http://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/instance-types.html
13 | # http://blog.father.gedow.net/2016/03/15/enhanced-networking/
14 | # https://sourceforge.net/projects/e1000/files/ixgbevf%20stable/
15 | #-------------------------------------------------------------------------------
16 |
17 | #-------------------------------------------------------------------------------
18 | # Parameter definition [Intel Network Driver(ixgbevf)]
19 | #-------------------------------------------------------------------------------
20 |
21 | # Source code acquisition URL and definition of file name and version information
22 | SourceUrl="https://downloads.sourceforge.net/project/e1000/ixgbevf%20stable/4.11.1/ixgbevf-4.11.1.tar.gz"
23 | SourceFile=$(echo ${SourceUrl##*/})
24 | SourceVersion=$(echo $SourceFile | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')
25 |
26 | #-------------------------------------------------------------------------------
27 | # Set AWS Instance MetaData
28 | #-------------------------------------------------------------------------------
29 |
30 | # Instance MetaData
31 | AZ=$(curl -s "http://169.254.169.254/latest/meta-data/placement/availability-zone")
32 | Region=$(echo $AZ | sed -e 's/.$//g')
33 | InstanceId=$(curl -s "http://169.254.169.254/latest/meta-data/instance-id")
34 | InstanceType=$(curl -s "http://169.254.169.254/latest/meta-data/instance-type")
35 | PrivateIp=$(curl -s "http://169.254.169.254/latest/meta-data/local-ipv4")
36 | AmiId=$(curl -s "http://169.254.169.254/latest/meta-data/ami-id")
37 |
38 | # IAM Role Information
39 | if [ $(compgen -ac | sort | uniq | grep -x jq) ]; then
40 | RoleArn=$(curl -s "http://169.254.169.254/latest/meta-data/iam/info" | jq -r '.InstanceProfileArn')
41 | RoleName=$(echo $RoleArn | cut -d '/' -f 2)
42 | fi
43 |
44 | #-------------------------------------------------------------------------------
45 | # Install Kernel module and Configure Dynamic Kernel Module Support (DKMS)
46 | #-------------------------------------------------------------------------------
47 |
48 | # Package Install Kernel Module
49 | eval $(grep ^DEFAULTKERNEL= /etc/sysconfig/kernel)
50 | if [ -n "$DEFAULTKERNEL" ]; then
51 | echo "Linux Kernel Package Name :" $DEFAULTKERNEL
52 | yum install -y ${DEFAULTKERNEL}-devel-$(uname -r) ${DEFAULTKERNEL}-headers-$(uname -r)
53 | else
54 | yum install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r)
55 | fi
56 |
57 | # Package Install Build Tool
58 | yum install -y gcc make rpm-build rpmdevtools
59 | # yum groupinstall -y "Development tools"
60 |
61 | # Package Install DKMS (from EPEL Repository)
62 | yum --enablerepo=epel install -y dkms
63 |
64 | # Set Grub2 Parameter for RHEL v7.x/CentOS v7.x
65 | if [ $(command -v grub2-mkconfig) ]; then
66 | rpm -qa | grep -e '^systemd-[0-9]\+\|^udev-[0-9]\+'
67 | sed -i '/^GRUB_CMDLINE_LINUX/s/"$/ net.ifnames=0"/' /etc/default/grub
68 | grub2-mkconfig -o /boot/grub2/grub.cfg
69 | fi
70 |
71 | # Get Intel Ethernet Driver source code
72 | curl -LsS "${SourceUrl}" -o "/usr/src/${SourceFile}"
73 |
74 | cd /usr/src
75 | tar xzf ${SourceFile}
76 | rm -fr ${SourceFile}
77 |
78 | cd "ixgbevf-${SourceVersion}"
79 |
80 | cat > dkms.conf << __EOF__
81 | PACKAGE_NAME="ixgbevf"
82 | PACKAGE_VERSION="TEMP-VERSION"
83 | CLEAN="cd src/; make clean"
84 | MAKE="cd src/; make BUILD_KERNEL=\${kernelver}"
85 | BUILT_MODULE_LOCATION[0]="src/"
86 | BUILT_MODULE_NAME[0]="ixgbevf"
87 | DEST_MODULE_LOCATION[0]="/updates"
88 | DEST_MODULE_NAME[0]="ixgbevf"
89 | AUTOINSTALL="yes"
90 | __EOF__
91 |
92 | sed -i 's/TEMP-VERSION/'${SourceVersion}'/g' dkms.conf
93 |
94 | # Make & Build & Install ixgbevf
95 | date; dkms add -m ixgbevf -v ${SourceVersion}; date
96 |
97 | date; dkms build -m ixgbevf -v ${SourceVersion}; date
98 |
99 | date; dkms install -m ixgbevf -v ${SourceVersion}; date
100 |
101 | modinfo ixgbevf
102 |
103 | #-------------------------------------------------------------------------------
104 | # Configure EC2 Instance Support for Amazon ENA Device
105 | #-------------------------------------------------------------------------------
106 |
107 | if [ -n "$RoleName" ]; then
108 | if [ $(command -v aws) ]; then
109 | # Get EC2 Instance Attribute(Single Root I/O Virtualization Status)
110 | aws ec2 describe-instance-attribute --instance-id ${InstanceId} --attribute sriovNetSupport --output json --region ${Region}
111 |
112 | # Modify EC2 Instance Attribute(Elastic Network Adapter Status)
113 | # aws ec2 modify-instance-attribute --instance-id ${InstanceId} --sriov-net-support simple
114 |
115 | # Get EC2 Instance Attribute(Single Root I/O Virtualization Status)
116 | # aws ec2 describe-instance-attribute --instance-id ${InstanceId} --attribute sriovNetSupport --output json --region ${Region}
117 | fi
118 | fi
119 |
120 | #-------------------------------------------------------------------------------
121 | # Remove Network Persistent Rules
122 | #-------------------------------------------------------------------------------
123 | # [Important]
124 | # If your instance operating system contains an /etc/udev/rules.d/70-persistent-net.rules file, you must delete it before creating the AMI.
125 | # This file contains the MAC address for the Ethernet adapter of the original instance.
126 | # If another instance boots with this file, the operating system will be unable to find the device and eth0 might fail, causing boot issues.
127 | # This file is regenerated at the next boot cycle, and any instances launched from the AMI create their own version of the file.
128 | #-------------------------------------------------------------------------------
129 |
130 | if [ -f /etc/udev/rules.d/70-persistent-net.rules ]; then
131 | rm -fr /etc/udev/rules.d/70-persistent-net.rules
132 | fi
133 |
134 | #-------------------------------------------------------------------------------
135 | # For normal termination of SSM "Run Command"
136 | #-------------------------------------------------------------------------------
137 |
138 | exit 0
139 |
140 | #-------------------------------------------------------------------------------
141 | # End of File
142 | #-------------------------------------------------------------------------------
143 |
--------------------------------------------------------------------------------
/Miscellaneous/Workaround/AmazonLinux-HVM_FreeRADIUS-Client-bootstrap.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -v
2 |
3 | # Logger
4 | exec > >(tee /var/log/user-data.log || logger -t user-data -s 2> /dev/console) 2>&1
5 |
6 | # Instance MetaData
7 | region=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/.$//g')
8 | instanceId=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
9 | instanceType=$(curl -s http://169.254.169.254/latest/meta-data/instance-type)
10 | iamRole=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/)
11 | privateIp=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
12 |
13 | #-------------------------------------------------------------------------------
14 | # Default Package Update
15 | #-------------------------------------------------------------------------------
16 |
17 | # yum repository metadata Clean up
18 | yum clean all
19 |
20 | # Default Package Update
21 | yum update -y
22 |
23 | #-------------------------------------------------------------------------------
24 | # Custom Package Installation
25 | #-------------------------------------------------------------------------------
26 |
27 | # Package Install Amazon Linux System Administration Tools (from Amazon Official Repository)
28 | yum install -y dstat git jq lzop iotop mtr sos yum-plugin-versionlock
29 | yum install -y aws-cli-plugin-cloudwatch-logs aws-cloudhsm-cli aws-kinesis-agent
30 |
31 | # Package Install Amazon Linux System Administration Tools (from EPEL Repository)
32 | yum --enablerepo=epel install -y bash-completion
33 |
34 | #-------------------------------------------------------------------------------
35 | # Custom Package Installation [FreeRADIUS Utility]
36 | #-------------------------------------------------------------------------------
37 | yum install -y freeradius-utils
38 |
39 | nodeFqdn=$(curl -s http://169.254.169.254/latest/meta-data/local-hostname)
40 | nodeShortName=${nodeFqdn%%.*}
41 |
42 | cat /etc/hosts
43 |
44 | echo "${privateIp} ${nodeFqdn} ${nodeShortName}" >> /etc/hosts
45 |
46 | cat /etc/hosts
47 |
48 | # [radtest command sample]
49 | # radtest -x -t
50 | # [radtest for OneLogin RADIUS Service]
51 | # radtest -x -t pap user password radius.us.onelogin.com 1812 secret
52 |
53 | #-------------------------------------------------------------------------------
54 | # Custom Package Clean up
55 | #-------------------------------------------------------------------------------
56 | yum clean all
57 |
58 | #-------------------------------------------------------------------------------
59 | # System Setting
60 | #-------------------------------------------------------------------------------
61 |
62 | # Setting SystemClock
63 | cat > /etc/sysconfig/clock << __EOF__
64 | ZONE="Asia/Tokyo"
65 | UTC=false
66 | __EOF__
67 |
68 | # Setting TimeZone
69 | date
70 | /bin/cp -fp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
71 | date
72 | ntpdate 0.amazon.pool.ntp.org
73 | date
74 |
75 | # Setting NTP Deamon
76 | sed -i 's/restrict -6/#restrict -6/g' /etc/ntp.conf
77 | service ntpd restart
78 | chkconfig ntpd on
79 |
80 | # Setting Language
81 | cat > /etc/sysconfig/i18n << __EOF__
82 | LANG=ja_JP.UTF-8
83 | __EOF__
84 |
85 | # Ephemeral-Disk Auto Mount Disabled (cloud-init)
86 | sed -i '/ephemeral0/d' /etc/cloud/cloud.cfg
87 |
88 | # Firewall Service Disabled (iptables/ip6tables)
89 | service iptables stop
90 | chkconfig --list iptables
91 | chkconfig iptables off
92 | chkconfig --list iptables
93 |
94 | service ip6tables stop
95 | chkconfig --list ip6tables
96 | chkconfig ip6tables off
97 | chkconfig --list ip6tables
98 |
99 | # Disable IPv6 Kernel Module
100 | echo "options ipv6 disable=1" >> /etc/modprobe.d/ipv6.conf
101 |
102 | # Disable IPv6 Kernel Parameter
103 | sysctl -a
104 |
105 | cat > /etc/sysctl.d/99-ipv6-disable.conf << __EOF__
106 | # Custom sysctl Parameter for ipv6 disable
107 | net.ipv6.conf.all.disable_ipv6 = 1
108 | net.ipv6.conf.default.disable_ipv6 = 1
109 | __EOF__
110 |
111 | sysctl -p
112 | sysctl -a | grep -ie "local_port" -ie "ipv6" | sort
113 |
114 | # Instance Reboot
115 | reboot
116 |
--------------------------------------------------------------------------------
/Miscellaneous/Workaround/List-Application-Linux-yum.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -v
2 |
3 | #-------------------------------------------------------------------------------
4 | # Custom Package Installation [Amazon EC2 Systems Manager (SM) agent]
5 | #-------------------------------------------------------------------------------
6 | # yum localinstall -y https://amazon-ssm-ap-northeast-1.s3.amazonaws.com/latest/linux_amd64/amazon-ssm-agent.rpm
7 |
8 | yum localinstall -y https://amazon-ssm-${Region}.s3.amazonaws.com/latest/linux_amd64/amazon-ssm-agent.rpm
9 |
10 |
11 | #-------------------------------------------------------------------------------
12 | # Custom Package Installation [AWS CloudWatchLogs Agent]
13 | #-------------------------------------------------------------------------------
14 | # yum --enablerepo=epel install -y python-pip
15 | # pip install --upgrade pip
16 |
17 | curl https://s3.amazonaws.com/aws-cloudwatch/downloads/latest/awslogs-agent-setup.py -o /tmp/awslogs-agent-setup.py
18 |
19 | cat > /tmp/awslogs.conf << __EOF__
20 | [general]
21 | state_file = /var/awslogs/state/agent-state
22 | use_gzip_http_content_encoding = true
23 |
24 | [SYSTEM-sample-Linux-OS-var-log-messages]
25 | log_group_name = SYSTEM-sample-Linux-OS-var-log-messages
26 | log_stream_name = {instance_id}
27 | datetime_format = %b %d %H:%M:%S
28 | time_zone = LOCAL
29 | file = /var/log/messages
30 | initial_position = start_of_file
31 | encoding = utf-8
32 | buffer_duration = 5000
33 |
34 | [SYSTEM-sample-Linux-OS-var-log-secure]
35 | log_group_name = SYSTEM-sample-Linux-OS-var-log-secure
36 | log_stream_name = {instance_id}
37 | datetime_format = %b %d %H:%M:%S
38 | time_zone = LOCAL
39 | file = /var/log/secure
40 | initial_position = start_of_file
41 | encoding = utf-8
42 | buffer_duration = 5000
43 |
44 | [SYSTEM-sample-Linux-SSM-Agent-Logs]
45 | log_group_name = SYSTEM-sample-Linux-SSM-Agent-Logs
46 | log_stream_name = {instance_id}
47 | datetime_format = %Y-%m-%d %H:%M:%S
48 | time_zone = LOCAL
49 | file = /var/log/amazon/ssm/amazon-ssm-agent.log
50 | initial_position = start_of_file
51 | encoding = ascii
52 | buffer_duration = 5000
53 |
54 | __EOF__
55 |
56 | python /tmp/awslogs-agent-setup.py --region ${Region} --configfile /tmp/awslogs.conf --non-interactive
57 |
58 | service awslogs status
59 | chkconfig --list awslogs
60 | chkconfig awslogs on
61 | chkconfig --list awslogs
62 | service awslogs restart
63 | service awslogs status
64 |
65 |
66 |
67 | #-------------------------------------------------------------------------------
68 | # Custom Package Installation [AWS CodeDeploy Agent]
69 | #-------------------------------------------------------------------------------
70 | yum install -y ruby
71 |
72 | # curl https://aws-codedeploy-ap-southeast-1.s3.amazonaws.com/latest/install -o /tmp/Install-AWS-CodeDeploy-Agent
73 | # curl https://aws-codedeploy-${Region}.s3.amazonaws.com/latest/install -o /tmp/Install-AWS-CodeDeploy-Agent
74 |
75 | curl https://aws-codedeploy-${Region}.s3.amazonaws.com/latest/install -o /tmp/Install-AWS-CodeDeploy-Agent
76 |
77 | chmod 744 /tmp/Install-AWS-CodeDeploy-Agent
78 |
79 | ruby /tmp/Install-AWS-CodeDeploy-Agent auto
80 |
81 | cat /opt/codedeploy-agent/.version
82 |
83 | chmod 644 /usr/lib/systemd/system/codedeploy-agent.service
84 |
85 | systemctl status codedeploy-agent
86 | systemctl enable codedeploy-agent
87 | systemctl is-enabled codedeploy-agent
88 |
89 | systemctl restart codedeploy-agent
90 | systemctl status codedeploy-agent
91 |
92 |
93 |
94 | #-------------------------------------------------------------------------------
95 | # Custom Package Installation [Amazon Inspector Agent]
96 | #-------------------------------------------------------------------------------
97 | curl https://d1wk0tztpsntt1.cloudfront.net/linux/latest/install -o /tmp/Install-Amazon-Inspector-Agent
98 |
99 | chmod 744 /tmp/Install-Amazon-Inspector-Agent
100 | bash /tmp/Install-Amazon-Inspector-Agent
101 |
102 | systemctl status awsagent
103 | systemctl enable awsagent
104 | systemctl is-enabled awsagent
105 |
106 | systemctl restart awsagent
107 | systemctl status awsagent
108 |
109 | /opt/aws/awsagent/bin/awsagent status
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | #-----------------------------------------------------------------------------------------------------------------------
123 | # Custom Package Download (Monitoring Service Agent)
124 | #-----------------------------------------------------------------------------------------------------------------------
125 |
126 | # Log Separator
127 | Write-LogSeparator "Custom Package Download (Monitoring Service Agent)"
128 |
129 | # Package Download Monitoring Service Agent (Zabbix Agent)
130 | # http://www.zabbix.com/download
131 |
132 |
133 |
134 | # Package Download Monitoring Service Agent (Datadog Agent)
135 | # http://docs.datadoghq.com/ja/guides/basic_agent_usage/amazonlinux/
136 | # http://docs.datadoghq.com/ja/guides/basic_agent_usage/centos/
137 | # http://docs.datadoghq.com/ja/guides/basic_agent_usage/redhat/
138 | # http://docs.datadoghq.com/ja/guides/basic_agent_usage/ubuntu/
139 |
140 |
141 | # Package Download Monitoring Service Agent (New Relic Infrastructure Agent)
142 | # https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/installation/install-infrastructure-linux
143 |
144 |
145 |
146 | #-----------------------------------------------------------------------------------------------------------------------
147 | # Custom Package Download (Security Service Agent)
148 | #-----------------------------------------------------------------------------------------------------------------------
149 |
150 |
151 | # Package Download Security Service Agent (Deep Security Agent)
152 | # http://esupport.trendmicro.com/ja-jp/enterprise/dsaas/top.aspx
153 | # https://help.deepsecurity.trendmicro.com/Get-Started/Install/install-dsa.html
154 | #
155 |
156 |
157 | # Package Download Security Service Agent (Alert Logic Universal Agent)
158 | # https://docs.alertlogic.com/requirements/system-requirements.htm#reqsAgent
159 | # https://scc.alertlogic.net/software/al-agent-LATEST-1.x86_64.rpm
160 |
161 |
162 |
163 |
164 |
165 |
166 |
--------------------------------------------------------------------------------
/Miscellaneous/Workaround/Package/rh-amazon-rhui-client-els-3.0.39-1.el6.noarch.rpm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/usui-tk/amazon-ec2-userdata/39d79250ce56b052470286f7df7fe25f41a9070a/Miscellaneous/Workaround/Package/rh-amazon-rhui-client-els-3.0.39-1.el6.noarch.rpm
--------------------------------------------------------------------------------
/Miscellaneous/Workaround/RHEL-v6-HVM_workaround-ExtendedDisk_bootstrap.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -v
2 |
3 | # Logger
4 | exec > >(tee /var/log/user-data.log || logger -t user-data -s 2> /dev/console) 2>&1
5 |
6 | # Instance MetaData
7 | region=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/.$//g')
8 | instanceId=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
9 | instanceType=$(curl -s http://169.254.169.254/latest/meta-data/instance-type)
10 | iamRole=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/)
11 | privateIp=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
12 |
13 | #-------------------------------------------------------------------------------
14 | # Default Package Update
15 | #-------------------------------------------------------------------------------
16 |
17 | # Red Hat Update Infrastructure Client Package Update
18 | yum clean all
19 | yum update -y rh-amazon-rhui-client
20 |
21 | # Enable Channnel (RHEL Server RPM) - [Default Enable]
22 | yum-config-manager --enable rhui-REGION-rhel-server-releases
23 | yum-config-manager --enable rhui-REGION-rhel-server-rh-common
24 | yum-config-manager --enable rhui-REGION-client-config-server-6
25 |
26 | # Enable Channnel (RHEL Server RPM) - [Default Disable]
27 | yum-config-manager --enable rhui-REGION-rhel-server-releases-optional
28 | yum-config-manager --enable rhui-REGION-rhel-server-supplementary
29 | # yum-config-manager --enable rhui-REGION-rhel-server-rhscl
30 |
31 | # Enable Channnel (RHEL Server Debug RPM)
32 | # yum-config-manager --enable rhui-REGION-rhel-server-debug-rh-common
33 | # yum-config-manager --enable rhui-REGION-rhel-server-debug-supplementary
34 | # yum-config-manager --enable rhui-REGION-rhel-server-debug-rhscl
35 |
36 | # Enable Channnel (RHEL Server Source RPM)
37 | # yum-config-manager --enable rhui-REGION-rhel-server-releases-source
38 | # yum-config-manager --enable rhui-REGION-rhel-server-source-rh-common
39 | # yum-config-manager --enable rhui-REGION-rhel-server-releases-optional-source
40 | # yum-config-manager --enable rhui-REGION-rhel-server-source-supplementary
41 | # yum-config-manager --enable rhui-REGION-rhel-server-source-rhscl
42 |
43 | # yum repository metadata Clean up
44 | yum clean all
45 |
46 | # Default Package Update
47 | yum update -y
48 |
49 | #-------------------------------------------------------------------------------
50 | # Custom Package Installation
51 | #-------------------------------------------------------------------------------
52 |
53 | # Package Install RHEL System Administration Tools (from Red Hat Official Repository)
54 | yum install -y git lzop yum-priorities yum-plugin-versionlock
55 | yum install -y redhat-access-insights redhat-support-tool
56 | yum install -y setroubleshoot-server
57 |
58 | # Package Install EPEL(Extra Packages for Enterprise Linux) Repository Package
59 | yum localinstall -y http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
60 | sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/epel.repo
61 | yum clean all
62 |
63 | # Package Install RHEL System Administration Tools (from EPEL Repository)
64 | yum --enablerepo=epel install -y bash-completion jq
65 |
66 | #-------------------------------------------------------------------------------
67 | # Custom Package Clean up
68 | #-------------------------------------------------------------------------------
69 | yum clean all
70 |
71 | #-------------------------------------------------------------------------------
72 | # System Setting
73 | #-------------------------------------------------------------------------------
74 |
75 | # Setting SystemClock
76 | cat > /etc/sysconfig/clock << __EOF__
77 | ZONE="Asia/Tokyo"
78 | UTC=false
79 | __EOF__
80 |
81 | # Setting TimeZone
82 | date
83 | /bin/cp -fp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
84 | date
85 | ntpdate 0.rhel.pool.ntp.org
86 | date
87 |
88 | # Setting NTP Deamon
89 | sed -i 's/restrict -6/#restrict -6/g' /etc/ntp.conf
90 | service ntpd start
91 | chkconfig ntpd on
92 |
93 | # Setting Language
94 | cat > /etc/sysconfig/i18n << __EOF__
95 | LANG=ja_JP.UTF-8
96 | __EOF__
97 |
98 | # Firewall Service Disabled (iptables/ip6tables)
99 | service iptables stop
100 | chkconfig --list iptables
101 | chkconfig iptables off
102 | chkconfig --list iptables
103 |
104 | service ip6tables stop
105 | chkconfig --list ip6tables
106 | chkconfig ip6tables off
107 | chkconfig --list ip6tables
108 |
109 | # Root Disk Partition Resize (GPT)
110 | # -- Use RHEL v6 HVM AMI (6.6_HVM_GA) --
111 | # HexCode:EF00 [EFI System]
112 | df -h
113 | gdisk -l /dev/xvda
114 |
115 | gdisk /dev/xvda << __EOF__
116 | p
117 | d
118 | p
119 | w
120 | Y
121 | Y
122 | __EOF__
123 |
124 | gdisk -l /dev/xvda
125 |
126 | gdisk /dev/xvda << __EOF__
127 | n
128 | 1
129 | 2048
130 |
131 | 0700
132 | p
133 | w
134 | Y
135 | Y
136 | __EOF__
137 |
138 | gdisk -l /dev/xvda
139 | df -h
140 |
141 | # Disable IPv6 Kernel Module
142 | echo "options ipv6 disable=1" >> /etc/modprobe.d/ipv6.conf
143 |
144 | # Disable IPv6 Kernel Parameter
145 | sysctl -a
146 |
147 | cat > /etc/sysctl.d/ipv6-disable.conf << __EOF__
148 | # Custom sysctl Parameter for ipv6 disable
149 | net.ipv6.conf.all.disable_ipv6 = 1
150 | net.ipv6.conf.default.disable_ipv6 = 1
151 | __EOF__
152 |
153 | sysctl -p
154 | sysctl -a | grep -ie "local_port" -ie "ipv6" | sort
155 |
156 | # Instance Reboot
157 | reboot
158 |
--------------------------------------------------------------------------------
/Miscellaneous/Workaround/RHEL-v7-HVM_workaround-ExtendedDisk_bootstrap.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -v
2 |
3 | # Logger
4 | exec > >(tee /var/log/user-data.log || logger -t user-data -s 2> /dev/console) 2>&1
5 |
6 | # Instance MetaData
7 | region=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/.$//g')
8 | instanceId=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
9 | instanceType=$(curl -s http://169.254.169.254/latest/meta-data/instance-type)
10 | iamRole=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/)
11 | privateIp=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
12 |
13 | #-------------------------------------------------------------------------------
14 | # Default Package Update
15 | #-------------------------------------------------------------------------------
16 |
17 | # Red Hat Update Infrastructure Client Package Update
18 | yum clean all
19 | yum update -y rh-amazon-rhui-client
20 |
21 | # Enable Channnel (RHEL Server RPM) - [Default Enable]
22 | yum-config-manager --enable rhui-REGION-rhel-server-releases
23 | yum-config-manager --enable rhui-REGION-rhel-server-rh-common
24 | yum-config-manager --enable rhui-REGION-client-config-server-7
25 |
26 | # Enable Channnel (RHEL Server RPM) - [Default Disable]
27 | yum-config-manager --enable rhui-REGION-rhel-server-optional
28 | yum-config-manager --enable rhui-REGION-rhel-server-extras
29 | # yum-config-manager --enable rhui-REGION-rhel-server-rhscl
30 |
31 | # Enable Channnel (RHEL Server Debug RPM)
32 | # yum-config-manager --enable rhui-REGION-rhel-server-releases-debug
33 | # yum-config-manager --enable rhui-REGION-rhel-server-debug-rh-common
34 | # yum-config-manager --enable rhui-REGION-rhel-server-debug-optional
35 | # yum-config-manager --enable rhui-REGION-rhel-server-debug-extras
36 | # yum-config-manager --enable rhui-REGION-rhel-server-debug-rhscl
37 |
38 | # Enable Channnel (RHEL Server Source RPM)
39 | # yum-config-manager --enable rhui-REGION-rhel-server-releases-source
40 | # yum-config-manager --enable rhui-REGION-rhel-server-source-rh-common
41 | # yum-config-manager --enable rhui-REGION-rhel-server-source-optional
42 | # yum-config-manager --enable rhui-REGION-rhel-server-source-extras
43 | # yum-config-manager --enable rhui-REGION-rhel-server-source-rhscl
44 |
45 | # yum repository metadata Clean up
46 | yum clean all
47 |
48 | # Default Package Update
49 | yum update -y
50 |
51 | #-------------------------------------------------------------------------------
52 | # Custom Package Installation
53 | #-------------------------------------------------------------------------------
54 |
55 | # Package Install RHEL System Administration Tools (from Red Hat Official Repository)
56 | yum install -y bash-completion dstat gdisk git lzop iotop mtr sos traceroute yum-priorities yum-plugin-versionlock
57 | yum install -y redhat-access-insights redhat-support-tool
58 | yum install -y setroubleshoot-server
59 |
60 | # Package Install EPEL(Extra Packages for Enterprise Linux) Repository Package
61 | yum localinstall -y http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm
62 | sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/epel.repo
63 | yum clean all
64 |
65 | # Package Install RHEL System Administration Tools (from EPEL Repository)
66 | yum --enablerepo=epel install -y jq
67 |
68 | #-------------------------------------------------------------------------------
69 | # Custom Package Clean up
70 | #-------------------------------------------------------------------------------
71 | yum clean all
72 |
73 | #-------------------------------------------------------------------------------
74 | # System Setting
75 | #-------------------------------------------------------------------------------
76 |
77 | # Setting TimeZone
78 | # timedatectl status
79 | timedatectl set-timezone Asia/Tokyo
80 | # timedatectl status
81 |
82 | # Setting Language
83 | # localectl status
84 | localectl set-locale LANG=ja_JP.utf8
85 | # localectl status
86 |
87 | # Setting NTP Deamon
88 | sed -i 's/bindcmdaddress ::1/#bindcmdaddress ::1/g' /etc/chrony.conf
89 | systemctl restart chronyd
90 | systemctl enable chronyd
91 | systemctl is-enabled chronyd
92 | sleep 3
93 | chronyc tracking
94 | chronyc sources -v
95 | chronyc sourcestats -v
96 |
97 | # Root Disk Partition Resize (GPT)
98 | # -- Use RHEL v7 HVM AMI (7.0_HVM_GA) --
99 | # HexCode:EF02 [BIOS boot partition] -> /dev/xvda1 <- None
100 | # HexCode:0700 [Microsoft basic data] -> /dev/xvda2 <- /
101 | df -h
102 | gdisk -l /dev/xvda
103 |
104 | gdisk /dev/xvda << __EOF__
105 | p
106 | d
107 | 2
108 | p
109 | w
110 | Y
111 | Y
112 | __EOF__
113 |
114 | gdisk -l /dev/xvda
115 |
116 | gdisk /dev/xvda << __EOF__
117 | n
118 | 2
119 | 4096
120 |
121 | 0700
122 | p
123 | w
124 | Y
125 | Y
126 | __EOF__
127 |
128 | gdisk -l /dev/xvda
129 | df -h
130 |
131 | # Disable IPv6 Kernel Module
132 | echo "options ipv6 disable=1" >> /etc/modprobe.d/ipv6.conf
133 |
134 | # Disable IPv6 Kernel Parameter
135 | sysctl -a
136 |
137 | cat > /etc/sysctl.d/99-ipv6-disable.conf << __EOF__
138 | # Custom sysctl Parameter for ipv6 disable
139 | net.ipv6.conf.all.disable_ipv6 = 1
140 | net.ipv6.conf.default.disable_ipv6 = 1
141 | __EOF__
142 |
143 | sysctl --system
144 | sysctl -p
145 | sysctl -a | grep -ie "local_port" -ie "ipv6" | sort
146 |
147 | # Instance Reboot
148 | reboot
149 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # amazon-ec2-userdata
2 | Publish the UserData script used when creating EC2 instance of Amazon EC2.
3 | Mainly, optimize operating system settings and introduce AWS environment utilities.
4 | In order to avoid the data size (16KB) which is one of the big limitation of UserData, it is made the implementation which minimizes 1st step script.
5 |
6 | [1st]
7 | Provide bootstrap script for operating system (Windows, Linux).
8 |
9 | [2nd]
10 | Identify the type of operating system (distribution and version).
11 |
12 | [3rd]
13 | Provide a script that describes the processing content that you want to execute in the actual UserData.
14 |
15 | [4th]
16 | Implement cleanup before creating AMI. (In the case of Windows, including generalization by Sysprep)
17 |
--------------------------------------------------------------------------------