'codedeploy on boto does not allow content overwrite
I'm using boto3==1.20.42. Here is my code:
import boto3
client = boto3.client('codedeploy')
response = client.create_deployment(
applicationName='MyWebsite',
deploymentGroupName='MySiteDeploymentGroup',
revision={
'revisionType': 'S3',
's3Location': {
'bucket': 'my-code-deploy',
'key': 'drupal-deploy2.zip',
'bundleType': 'zip',
},
},
description='Deploying updates',
ignoreApplicationStopFailures=False,
fileExistsBehavior='OVERWRITE'
)
print(response)
What I expect is that it overwrite the contents as I specified above but I observe that it is not overwriting files as you can see in the used deployment settings image below:

Can anyone help me figure out how to overwrite contents programmatically with boto?
Solution 1:[1]
fileExistsBehavior is per deployment setting. You can't set a default value for that. For each new deploymentyou have to explicitly specify that it should be OVERWRITE.
Solution 2:[2]
Actually the code above seems to work but if you open the settings of a previous deployment on the AWS console, it does not show the flag as selected which lead to me thinking that it did not overwrite.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Marcin |
| Solution 2 | max |
