[cdk diff] Modifications to stack-level tags do not surface in cdk diff results, leading to unexpected updates
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #1989 de @Adityaj0 — cerrado sin fusionar
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- aws, typescript
- Área
- cli, cloud, infrastructure
Línea de trabajo
Comienza reproduciendo el problema con el ejemplo de lib/cdk_diff_replication-stack y las etiquetas de nivel de stack que se muestran en el punto de entrada de la app; después, ejecuta cdk diff y compara su salida con un CloudFormation ChangeSet. Sigue cómo la CLI analiza los resultados del ChangeSet; el trabajo estará terminado cuando cdk diff informe de las modificaciones de recursos causadas por cambiar el valor de la etiqueta.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 110
- Forks
- 138
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 55
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/aws-cdk-cli
-
aws-cdk bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
aws/aws-cdk-cli#2179 ·
Los mantenedores suelen responder en 1 día
-
(cli): deploy waits forever when an AWS API call gets no response, because requestTimeout only logs a warningPosiblemente ocupada @abhiramshaji-cyber la tomó hace 27 días. Abiertoaws-cdk bug p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
aws/aws-cdk-cli#2097 ·
Los mantenedores suelen responder en 1 día
-
(bootstrap) FilePublishingRoleDefaultPolicy permission incorrect when FileAssetsBucketKmsKeyId is an ARN valuePosiblemente ocupada @lemon0333 la tomó hace 95 días. Abiertobug p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
aws/aws-cdk-cli#921 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
(garbage-collection): cdk gc takes hours on a large bootstrap bucketPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
aws/aws-cdk-cli#2165 ·
Los mantenedores suelen responder en 1 día
-
(cli): cdk flags --set always reports no template differences before applying flagsPosiblemente ocupada @go-to-k la tomó hace 9 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
aws/aws-cdk-cli#2153 ·
Los mantenedores suelen responder en 1 día
Todos los issues de aws/aws-cdk-cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
volcengine/OpenViking#8432 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
jupyterlab/eslint-plugin#178 · 2 comentarios ·
-
bug from-app needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
nightly-labs/openbot#16303 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100