CodeDeployment Issue

0

The deployment failed because a specified file already exists at this location: /var/www/html/index.html, this is the error message

asked a year ago504 views
1 Answer
0

The error is caused by the existence of the same file in "/var/www/html/" of the instance to be deployed.
To resolve the error, you need to set "file_exists_behavior" in appspec.yml.
If "OVERWRITE" is set for "file_exists_behavior", the same file will be overwritten and deployed even if it exists when deploying.

https://docs.aws.amazon.com/ja_jp/codedeploy/latest/userguide/reference-appspec-file-structure-files.html
Sample appspec.yml.

version: 0.0
os: linux
files:
  - source: /
    destination: /var/www/html
file_exists_behavior: OVERWRITE
permissions:
  - object: /var/www/html
    owner: apache
    group: apache
    mode: 755
    type:
      - file
      - directory
profile picture
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions