1. CodeDeploy

요금

2. CodeDeploy 세팅

appspec.yml 생성

version: 0.0
os: linux
files:
  - source: /
    destination: /var/www/html/WordPress
hooks:
  BeforeInstall:
    - location: scripts/install_dependencies.sh
      timeout: 300
      runas: root
  AfterInstall:
    - location: scripts/change_permissions.sh
      timeout: 300
      runas: root
  ApplicationStart:
    - location: scripts/start_server.sh
    - location: scripts/create_test_db.sh
      timeout: 300
      runas: root
  ApplicationStop:
    - location: scripts/stop_server.sh
      timeout: 300
      runas: root

version: 0.0
os: linux
files:
    - source:  /
      destination: /home/ec2-user/build/

permissions:
    - object: /
      pattern: "**"
      owner: ec2-user
      group: ec2-user

hooks:
    BeforeInstall:
        - location: beforeInstall.sh
    AfterInstall:
        - location: deploy.sh
          timeout: 60
          runas: ec2-user

beforeInstall.sh 생성