salmon-musician-36333
04/25/2023, 8:20 PM+- ββ aws:rds:Cluster postgres replace [diff: ~availabilityZones,dbClusterInstanceClass]
Error:
error: 1 error occurred:
* creating RDS Cluster (...): DBClusterAlreadyExistsFault: DB Cluster already exists
status code: 400, request id: ...
I'm still testing the deployment, so I'm going to bring the whole thing down and go from there, just wondering if this is expected. deletionProtection
is disabled.billowy-army-68599
04/25/2023, 8:20 PMsalmon-musician-36333
04/25/2023, 8:21 PMclusterIdentifier
? If so, yes.billowy-army-68599
04/25/2023, 8:22 PMsalmon-musician-36333
04/25/2023, 8:22 PMbillowy-army-68599
04/25/2023, 8:39 PMsalmon-musician-36333
04/25/2023, 8:39 PMfinalSnapshotIdentifier
. I would generate a tag based on the date, but then it's going to end up modifying/replacing the cluster every run. Is there a way to ask Pulumi for a unique (hopefully prefixed) identifier that will be persisted in state?error: deleting urn:pulumi:...::...::aws:rds/cluster:Cluster::postgres: 1 error occurred:
* deleting RDS Cluster (...): DBClusterSnapshotAlreadyExistsFault: Cannot create the cluster snapshot because one with the identifier ... already exists.
billowy-army-68599
04/25/2023, 9:45 PMpulumi-random
to generate a random id πsalmon-musician-36333
04/25/2023, 11:16 PMfinalSnapshotIdentifier
like so:
finalSnapshotIdentifier: postgresRetainFinalSnapshot ? postgresFinalSnapshotNameRandom.hex : undefined,
Hopefully that looks reasonable. I feel like keepers
might be relevant, but it says to look at the random.Provider
docs, which don't explain too much πdependsOn
is there, which is troubling:
error: deleting urn:pulumi:...::...::aws:rds/subnetGroup:SubnetGroup::...: 1 error occurred:
* deleting RDS Subnet Group (...): InvalidDBSubnetGroupStateFault: Cannot delete the subnet group '...' because at least one database cluster: ... is still using it.
{ dependsOn: [postgresSg], deleteBeforeReplace: true },
Know what might be up?gentle-daybreak-46874
04/26/2023, 10:41 PMsalmon-musician-36333
04/27/2023, 1:53 AMdependsOn: [x, y]
means the resource needs to come up after x
and y
, and be brought down before x
and y
.pulumi-random
above seem legit?keepers: {x: somethingFromCluster.apply(x => ...)
.keepers
for a recreate.const postgresSgName = `${deployTag}-postgres-sg`;
const postgresClusterIdentifier = `${deployTag}-postgres`;
let postgresFinalSnapshotNameRandomKeepers: Record<string, string> = {};
const postgresFinalSnapshotNameRandom = new random.RandomId('postgres-final-snapshot-random', {
prefix: `${deployTag}-postgres-final-snapshot-`,
byteLength: 4,
keepers: postgresFinalSnapshotNameRandomKeepers,
});
const postgresCluster = new aws.rds.Cluster(...);
postgresCluster.id.apply((id) => (postgresFinalSnapshotNameRandomKeepers['clusterId'] = id));