Aws-cdk: [CLI] display issues with new deployment monitoring in the CDK CLI

Created on 23 Jun 2020  ยท  6Comments  ยท  Source: aws/aws-cdk

_Originally posted by @robertd in https://github.com/aws/aws-cdk/pull/8165#issuecomment-647178526_

It's not working really well on iTerm2 with zsh (using robbierussel/oh-my-zsh)?

Is there a way to use more verbose output (~for CI/CD purposes too~)?

โžœ  sipp-api-cdk git:(master) โœ— cdk deploy
SippApiStack: deploying...
SippApiStack: creating CloudFormation changeset...








 โœ…  SippApiStack

Outputs:
SippApiStack.ServiceServiceURL250C0FB6 = https://sipp-api-alb.acme.com
SippApiStack.ServiceLoadBalancerDNSEC5B149E = internal-SippA-Servi-1X2ZSXSR3W328-1234567890.us-west-2.elb.amazonaws.com

Stack ARN:
arn:aws:cloudformation:us-west-2:1234567890:stack/SippApiStack/3841b3e0-b271-11ea-aae2-065639e88e5c

.
.
.

edit: Luckily everything looks fine in Gitlab's CI/CD pipeline.

image

bug in-progress p1 packagtools

Most helpful comment

Agreed. In addition to providing an option for people to choose, I think non-interactive terminals (like CI) should default to the other output style. Most (all?) CI platforms set the CI environment variable, so maybe when the CI variable is set (or another non-interactive terminal is detected), CDK automatically reverts to the old behavior?

All 6 comments

_Originally posted by @slotnick in https://github.com/aws/aws-cdk/pull/8165#issuecomment-647998179_

Encountering exactly the same here. Is there an option to disable this mode and revert to the previous display? Itโ€™s also useful to understand what happened during the build, which is lost with this update. My working model is to kick off a build, then check back after awhile to see what happened. This change makes that very difficult.

I'm seeing a bunch of escape codes being dumped when running cdk deploy --no-color in a jenkins job. e.g.,

Stack ARN:
arn:aws:cloudformation:eu-central-1:account-num:stack/stack-name/uuid
stack-name
stack-name: deploying...
stack-name: creating CloudFormation changeset...




[
ยท
ยท
ยท
ยท
ยท
ยท
ยท
ยท
]

(
0
/
2
)





[
ยท
ยท
ยท
ยท
ยท
ยท
ยท
ยท
]

(
0
/
2
)





[
ยท
ยท
ยท
ยท
ยท
ยท
ยท
ยท
]

(
0
/
2

Is there a way to revert to the prior display mode when running with --no-color?

I agree. While this is very pretty, it's a bit of a hit to usefulness when doing complex debugging of stacks if I can't see what was actually deployed after it's been deployed. Adds a lot of friction to the process.

I would like to add to the request to have an option to revert to the previous behaviour. In the event of a failed deploy it gives basically no feedback as to what went wrong.

xxxx: creating CloudFormation changeset...
[โ–ˆโ–ˆโ–ˆโ–ˆโ–ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท] (1/13)


 โŒ  xxxx failed: Error: The stack named xxxx is in a failed state: UPDATE_ROLLBACK_COMPLETE
    at Object.waitForStack (/xxx/cdk/node_modules/aws-cdk/lib/api/util/cloudformation.ts:266:11)

Previously I could see which components had been deployed and rolled back, now I need to login to the console to find out.

For example in a verbose run I see this much more useful message

(UPDATE_ROLLBACK_IN_PROGRESS Export xxxxStack:ExportsOutputRefxxxx cannot be deleted as it is in use by yyyyStack))

Agreed. In addition to providing an option for people to choose, I think non-interactive terminals (like CI) should default to the other output style. Most (all?) CI platforms set the CI environment variable, so maybe when the CI variable is set (or another non-interactive terminal is detected), CDK automatically reverts to the old behavior?

I opened a PR at https://github.com/aws/aws-cdk/pull/9516 that detects whether the CI environment variable is set and reverts the output to previous behavior.

It's a minor change, so to anyone that is affected by this:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eladb picture eladb  ยท  3Comments

v-do picture v-do  ยท  3Comments

abelmokadem picture abelmokadem  ยท  3Comments

pepastach picture pepastach  ยท  3Comments

mirazmamun picture mirazmamun  ยท  3Comments