Sahil Kapoor
Sahil Kapoor

Reputation: 17

AWS code deploy fails with error : specified file already exists at this

I tried it for 2 cases

Using github as repository

  1. Fresh deployment using codepipeline to desired location multiple time : files are overwritten automatically in this case by code deploy agent.

  2. When files are manually created at install location(/var/www/html) then codedeploy throws error "The deployment failed because a specified file already exists at this location: /var/www/html/abc.php"

I am not able to overwrite files using for 2nd case ,

tried : overwrite:true -> this is not working

appspec.yml file

version: 0.0
os: linux
files:
  - source: /
    destination: /var/www/html/
    overwrite: true
    

Upvotes: 0

Views: 1014

Answers (1)

Ravi Kumar CH
Ravi Kumar CH

Reputation: 541

This will work.

version: 0.0
os: linux
files:
  - source: /
    destination: /var/www/html/
file_exists_behavior: OVERWRITE

Upvotes: 2

Related Questions