- Le plus récent
- Le plus de votes
- La plupart des commentaires
The discrepancy you're seeing between the CDK diff and the actual state of your RDS instance is likely due to how CDK tracks and manages resource states compared to manual updates made directly to the RDS instance.
When you manually updated the RDS instance from version 12.5 to 12.19 over time, these changes were not reflected in your CDK stack's state. CDK maintains its own representation of the infrastructure state based on what was last deployed through it.
By updating your CDK code to use ds.PostgresEngineVersion.VER_12_19, you're now aligning the CDK's view of the desired state with the actual current state of your RDS instance. However, from CDK's perspective, this appears as a change because it's comparing against its last known state (12.5) rather than the current state of the deployed resource.
The good news is that this diff doesn't necessarily mean CDK will rebuild your database. In most cases, when you apply this change, CDK will recognize that the actual resource is already at the desired version and won't perform any destructive actions. It will likely just update its own state to reflect the new version.
To avoid any potential issues, you can take the following steps:
- Double-check that the version in your CDK code exactly matches the current version of your RDS instance.
- Consider using a CDK escape hatch to explicitly set the engine version to match the current state, which can help CDK recognize that no actual change is needed.
- Before applying the changes, use the
--no-execute
flag withcdk deploy
to see the detailed plan of what changes will actually be made.
Remember, while CDK is showing a diff, it doesn't always mean a resource will be replaced or rebuilt. In this case, it's more likely updating its own state to match the current reality of your infrastructure.
Sources
Upgrading a DB instance engine version - Amazon Relational Database Service
Upgrading the engine version of a Multi-AZ DB cluster for Amazon RDS - Amazon Relational Database Service
Contenus pertinents
- demandé il y a 2 mois
- demandé il y a 2 ans
- demandé il y a 2 ans
- AWS OFFICIELA mis à jour il y a un mois
- AWS OFFICIELA mis à jour il y a 6 mois
- AWS OFFICIELA mis à jour il y a 7 mois