https://github.com/shintaro-abe/wordpress-userdata
Userdata for installing Wordpress on EC2. This script can also configure wp-config.
https://github.com/shintaro-abe/wordpress-userdata
aws ec2 mysql shellscript userdata wordpress
Last synced: 2 months ago
JSON representation
Userdata for installing Wordpress on EC2. This script can also configure wp-config.
- Host: GitHub
- URL: https://github.com/shintaro-abe/wordpress-userdata
- Owner: Shintaro-Abe
- License: mit
- Created: 2023-05-21T09:09:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-06T02:21:11.000Z (over 1 year ago)
- Last Synced: 2025-03-27T20:49:42.816Z (2 months ago)
- Topics: aws, ec2, mysql, shellscript, userdata, wordpress
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Wordpress-userdata
## 使用について
* __AmazonLinux2023は非対応。AmazonLinux2での使用を推奨。__
* AmazonLinux2023で使用できるスクリプトを作成中。
* __SystemsManager ParameterStoreにあらかじめパラメータを設定。__
* __EC2のインスタンスプロファイルにIAMロールを設定。__
* ` ssm:GetParameter `ポリシーが必要。## スクリプトについて
以下の流れでインストールを実施。
* __SystemsManager ParameterStoreからパラメータを取得、環境変数に設定__
* __必要なパッケージのインストール__
* __MySQLユーザーの作成__
* __Wordpressのダウンロード__
* __wp-config.phpの修正__## コマンドについて
### SystemsManager ParameterStoreのパラメータ取得```
variable=$(aws ssm get-parameter --name "parameter_name" --with-decryption --region current_region --output text --query Parameter.Value)
```variableに` ssm get-parameter `コマンドで取得した値が入るので、スクリプトでパラメータを参照する箇所に` $variable `の形式で記述。
パラメータのタイプはString、SecureString関係なく使用可能。### MySQLログイン
MySQLコマンドを、` <