Skip to content

Userdata for installing Wordpress on EC2. This script can also configure wp-config.

License

Notifications You must be signed in to change notification settings

Shintaro-Abe/Wordpress-userdata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

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コマンドを、<<EOFからEOFで指定。

About

Userdata for installing Wordpress on EC2. This script can also configure wp-config.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages