[cdk diff] Modifications to stack-level tags do not surface in cdk diff results, leading to unexpected updates
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #1989 来自 @Adityaj0 —— 已关闭,未合并
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- aws, typescript
- 领域
- cli, cloud, infrastructure
调研方向
先使用 lib/cdk_diff_replication-stack 中的示例以及 app 入口点中显示的堆栈级标签重现问题,然后运行 cdk diff,并将其输出与 CloudFormation ChangeSet 进行比较。跟踪 CLI 如何解析 ChangeSet 结果;完成标准是 cdk diff 报告由更改标签值导致的资源修改。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
When you make a change to a stack-level tag in CDK, cdk diff returns There were no differences even though changes to stack-level tags do in fact results in updates to resources. This results in inaccurate diff results that can lead to unexpected updates.
In comparison - When you make a change to a stack-level tag and then create a CloudFormation ChangeSet, CloudFormation does report this as a change. It lists a Modify operation for all supported resources.
The cdk diff command creates (and then immediately deletes) a CloudFormation ChangeSet, and this ChangeSet does accurately report the Modify behavior, but the actual cdk diff results in the CDK CLI still returns no differences despite this. I have provided screenshots of this below.
CloudFormation ChangeSet:
CDK Diff Results:
In other words, this doesn't appear to be an issue or limitation with the CloudFormation ChangeSet behavior. This specifically looks like a limitation with how CDK diff parses and returns ChangeSet results when stack-level tags are involved.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
CDK diff should accurately report changes to resources when changes are made to stack-level tags.
Current Behavior
CDK diff incorrectly returns "There were no differences" despite the CloudFormation ChangeSet reporting differences.
Reproduction Steps
- Create a CDK stack. As an example, I made one that just creates an SNS topic:
import * as cdk from 'aws-cdk-lib/core';
import * as sqs from 'aws-cdk-lib/aws-sqs';
import { Construct } from 'constructs';
export class CdkDiffReplicationStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
new sqs.Queue(this, 'Queue');
}
}
- Define one or more stack tags. For example:
#!/usr/bin/env node
import * as cdk from 'aws-cdk-lib/core';
import { CdkDiffReplicationStack } from '../lib/cdk_diff_replication-stack';
const app = new cdk.App();
new CdkDiffReplicationStack(app, 'CdkDiffReplicationStack', {
// Specialize for the account/region from the current CLI configuration.
env: {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION,
},
// stack-level tag
tags: {
DiffReplicationTag: 'Original',
},
});
- Deploy the stack
- Make a change to the stack-level tag in the CDK code:
tags: {
DiffReplicationTag: 'Changed', //<---Changed the value
},
- Run CDK diff - Observe that the command returns
There were no differences. - In the CloudFormation console, manually create a CloudFormation ChangeSet. Use the same template but change the value of the stack-level tag. Observe that CloudFormation does report changes for these resources.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.1141.0
Framework Version
No response
Node.js Version
v24.14.0
OS
Windows 10
Language
TypeScript
Language Version
No response
Other information
No response
- 主要语言
- TypeScript
- 星标
- 110
- 派生
- 138
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 55
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws/aws-cdk-cli 的其他 Issue
-
aws-cdk bug needs-triage
难度 2/5 1-3 小时 新手友好度 76/100
aws/aws-cdk-cli#2179 ·
维护者通常 1 天内回复
-
(cli): deploy waits forever when an AWS API call gets no response, because requestTimeout only logs a warning可能已有人在做 @abhiramshaji-cyber 于 27 天前认领。 未关闭aws-cdk bug p2
难度 2/5 1-3 小时 新手友好度 76/100
aws/aws-cdk-cli#2097 ·
维护者通常 1 天内回复
-
(bootstrap) FilePublishingRoleDefaultPolicy permission incorrect when FileAssetsBucketKmsKeyId is an ARN value可能已有人在做 @lemon0333 于 95 天前认领。 未关闭bug p2
难度 2/5 1-3 小时 新手友好度 74/100
aws/aws-cdk-cli#921 · 1 条评论 ·
维护者通常 1 天内回复
-
(garbage-collection): cdk gc takes hours on a large bootstrap bucket可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
aws/aws-cdk-cli#2165 ·
维护者通常 1 天内回复
-
(cli): cdk flags --set always reports no template differences before applying flags可能已有人在做 @go-to-k 于 10 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
aws/aws-cdk-cli#2153 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
GetStream/stream-chat-react#3467 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
vercel-labs/ui#1139 ·
维护者通常 1 天内回复
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10可能已有人在做 @goranai 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
bot:ai-assisted component:platform-js status:untriaged
难度 2/5 1-3 小时 新手友好度 82/100
midnightntwrk/platform-js#93 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100