question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[aws-events] `cdk diff` shows difference, but `cdk deploy` tells no changes

See original GitHub issue

I’m not sure whether this issue is involved with aws-events or cdk diff.

Reproduction Steps

I have deployed this resource:

import * as events from '@aws-cdk/aws-events'

new events.Rule(this, 'rule', {
  eventPattern: {
    detail: {
      type: ['대한민국'], // Any non-single byte characters
    },
  }
)

cdk diff always tells there is a difference even though it has been deployed.

$ cdk diff <stack>

Stack <stack>
Resources
[~] AWS::Events::Rule rule rule5EE78A73 
 └─ [~] EventPattern
     └─ [~] .detail:
         └─ [~] .type:
             └─ @@ -1,3 +1,3 @@
                [ ] [
                [-]   "????"
                [+]   "대한민국"
                [ ] ]

But when I tried to deploy again, it tells:

$ cdk deploy <stack>

<stack>
<stack>: deploying...
<stack>: creating CloudFormation changeset...

 ✅  <stack> (no changes)

What did you expect to happen?

$ cdk diff <stack>

 ✅  <stack> (no changes)

What actually happened?

$ cdk diff <stack>

Stack <stack>
Resources
[~] AWS::Events::Rule rule rule5EE78A73 
 └─ [~] EventPattern
     └─ [~] .detail:
         └─ [~] .type:
             └─ @@ -1,3 +1,3 @@
                [ ] [
                [-]   "????"
                [+]   "대한민국"
                [ ] ]

Environment

  • CLI Version : aws-cli/2.0.45 Python/3.8.5 Darwin/19.6.0 source/x86_6
  • Framework Version: aws-cdk 1.62.0
  • Node.js Version: v14.9.0
  • OS : macOS Catalina
  • Language (Version): TypeScript 4.0.2

Other


This is 🐛 Bug Report

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
timasplincommented, Dec 3, 2020

I was facing the same issues on a different resource when trying to update the DeletionPolicy - but I found this in the CloudFormation documentation: https://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-get-template.html

Important You cannot update the CreationPolicy, DeletionPolicy or UpdatePolicy attribute by itself. You can update them only when you include changes that add, modify, or delete resources. For example, you can add or modify a metadata attribute of a resource.

3reactions
jdiegosierracommented, Jul 30, 2021

Same problem changing ONLY DeletionPolicy

Read more comments on GitHub >

github_iconTop Results From Across the Web

CDK not updating - Stack Overflow
because CDK uses Cloudformation, it performs an action to determine a ChangeSet. This is to say, if it doesn't think anything has changed, ......
Read more >
What's new with AWS CloudFormation and AWS CDK
Join this session to learn about new features to up-level your infrastructure-as-code (IaC) experiences on AWS. It covers working with AWS ...
Read more >
AWS CDK Toolkit (cdk command) - AWS Documentation
The AWS CDK Toolkit, the CLI command cdk , is the primary tool for interacting with your AWS CDK app. It executes your...
Read more >
AWS CDK Toolkit - npm
This command returns non-zero if any differences are found. $ # Diff against the currently deployed stack $ cdk diff --app='node bin/main.js' MyStackName ......
Read more >
@aws-cdk/aws-events | Yarn - Package Manager
Events: An event indicates a change in your AWS environment. AWS resources can generate events when their state changes. For example, Amazon EC2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found