[cdk diff] Modifications to stack-level tags do not surface in cdk diff results, leading to unexpected updates
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #1989 @Adityaj0 による — マージされずにクローズ
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- aws, typescript
- 領域
- cli, cloud, infrastructure
調査の方向性
まず、lib/cdk_diff_replication-stack の例と、アプリのエントリポイントに示されているスタックレベルのタグを使って問題を再現し、次に 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時間
- マージ済み PR(30日)
- 55
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 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 が 9 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
aws/aws-cdk-cli#2153 ·
メンテナーはふだん 1 日以内に返信
aws/aws-cdk-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
volcengine/OpenViking#8432 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
jupyterlab/eslint-plugin#178 · コメント 2 件 ·
-
bug from-app needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
nightly-labs/openbot#16303 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100