Post

AWS - CodeDevelop - CodeDeploy - appspec.yml Template

appspec.yml Template

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# example from AWS WhitePaper, no real credential inside

version:[1]version-number                      # version: 0.0
os:[1]operating-system-name                    # os: linux OR windows
files:                                         # files:
[2]-[1]source:[1]source-files-location         #  - source: /
[4]destination:[1]destination-files-location   #    destination: /var/www/html/WordPress
permissions:                                   # permissions:
[2]-[1]object:[1]object-specification
[4]pattern:[1]pattern-specification
[4]except:[1]exception-specification
[4]owner:[1]owner-account-name
[4]group:[1]group-name
[4]mode:[1]mode-specification
[4]acls:                                       # [4]acls:
[6]-[1]acls-specification
[4]context:
[6]user:[1]user-specification
[6]type:[1]type-specification
[6]range:[1]range-specification
[4]type:
[6]-[1]object-type
hooks:                                         # hooks:
[2]deployment-lifecycle-event-name:            #   BeforeInstall:
[4]-[1]location:[1]script-location             #     - location: scripts/install_dependencies.sh
[6]timeout:[1]timeout-in-seconds               #       timeout: 300
[6]runas:[1]user-name                          #       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


# example of a correctly spaced AppSpec file:
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


# example of a correctly spaced AppSpec file:
version: 0.0
os: linux
files:
  - source: Config/config.txt
    destination: /webapps/Config
  - source: Source
    destination: /webapps/Config
hooks:
  BeforeInstall:
    - location: scripts/install_dependencies.sh
    - location: scripts/UnzipResourceBundle.sh
      location: scripts/UnzipDataBundle.sh
      timeout: 300
      runas: root
  AfterInstall:
    - location: scripts/change_permissions.sh
    - location: scripts/RunResourceTests.sh
      timeout: 300
      runas: root
  ApplicationStart:
    - location: scripts/start_server.sh
    - location: scripts/create_test_db.sh
    - location: scripts/RunFunctionTests.sh
      timeout: 300
      runas: root
  ValidataService:
    - location: scripts/MonitorService.sh
      timeout: 3600
      runas: CodeDeployuser
ApplicationStop:
    - location: scripts/stop_server.sh
      timeout: 300
      runas: root
This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.