Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(codedeploy): unable to configure disable automatically rollback #21691

Closed
msysh opened this issue Aug 20, 2022 · 2 comments · Fixed by #22083
Closed

(codedeploy): unable to configure disable automatically rollback #21691

msysh opened this issue Aug 20, 2022 · 2 comments · Fixed by #22083
Assignees
Labels
@aws-cdk/aws-codedeploy Related to AWS CodeDeploy bug This issue is a bug. feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs p2

Comments

@msysh
Copy link
Contributor

msysh commented Aug 20, 2022

Describe the bug

In creating a DeploymentGroup, automatically rollback cannot be disabled because there is no way to set the enabled property of auto-rollback-configuration to false.

It cannot be disabled by setting all deploymentInAlarm, failedDeployment, and stoppedDeployment to false.

Expected Behavior

It is expected to be disabled if deploymentInAlarm, failedDeployment, and stoppedDeployment are false.

Current Behavior

Currently, setting all properties of autoRollback to false will not disable automatic rollback.

The following is an excerpt of the output from aws deploy get-deployment-group in CLI after deploying with all autoRollback properties, deploymentInAlarm, failedDeployment and stoppedDeployment set to false.

{
  "deploymentGroupInfo": {
    "autoRollbackConfiguration": {
      "enabled": true,
      "events": [
        "DEPLOYMENT_FAILURE"
      ]
    }
  }
}

Reproduction Steps

Setting all properties of autoRollback to false does not disable autoRollback.

new cdk.aws_codedeploy.ServerDeploymentGroup(this, 'DeploymentGroup', {
  autoRollback: {
    deploymentInAlarm: false,
    failedDeployment: false,
    stoppedDeployment: false,
  },
});

Possible Solution

How about disabling autoRollback if all its properties are set false?

Additional Information/Context

No response

CDK CLI Version

2.38.1 (build a5ced21)

Framework Version

No response

Node.js Version

v16.14.0

OS

macOS 11.6.8

Language

Typescript

Language Version

3.9.10

Other information

No response

@msysh msysh added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 20, 2022
@github-actions github-actions bot added the @aws-cdk/aws-codedeploy Related to AWS CodeDeploy label Aug 20, 2022
@indrora
Copy link
Contributor

indrora commented Sep 9, 2022

Hmm... This is interesting. https://github.com/aws/aws-cdk/blob/v2.41.0/packages/%40aws-cdk/aws-codedeploy/lib/utils.ts#L35 looks like the source.

@indrora indrora added p2 feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs and removed needs-triage This issue or PR still needs to be triaged. labels Sep 9, 2022
@mergify mergify bot closed this as completed in #22083 Sep 17, 2022
mergify bot pushed a commit that referenced this issue Sep 17, 2022
…22083)

In creating a DeploymentGroup, auto rollback cannot be disabled because there is no way to set the enabled property of auto-rollback-configuration to false.

Once automatically rollback is enabled, it cannot be disabled by deleting the `autoRollback` property or by setting both deploymentInAlarm and failedDeployment to false.
The root cause of this bug is that if all autoRollback properties, `deploymentInAlarm`, `failedDeployment`, and `stoppedDeployment`, are false, `AutoRollbackConfig` is undefined and cannot be changed to disabled.

To solve this bug, `autoRollback` is disabled (`{ enabled: false }`) if the properties of `autoRollback` are explicitly set to false.

closes #21691

----

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

homakk pushed a commit to homakk/aws-cdk that referenced this issue Dec 1, 2022
…ws#22083)

In creating a DeploymentGroup, auto rollback cannot be disabled because there is no way to set the enabled property of auto-rollback-configuration to false.

Once automatically rollback is enabled, it cannot be disabled by deleting the `autoRollback` property or by setting both deploymentInAlarm and failedDeployment to false.
The root cause of this bug is that if all autoRollback properties, `deploymentInAlarm`, `failedDeployment`, and `stoppedDeployment`, are false, `AutoRollbackConfig` is undefined and cannot be changed to disabled.

To solve this bug, `autoRollback` is disabled (`{ enabled: false }`) if the properties of `autoRollback` are explicitly set to false.

closes aws#21691

----

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codedeploy Related to AWS CodeDeploy bug This issue is a bug. feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants