sparse-intern-71089
04/25/2023, 8:20 PMbillowy-army-68599
salmon-musician-36333
04/25/2023, 8:21 PMclusterIdentifier
? If so, yes.billowy-army-68599
salmon-musician-36333
04/25/2023, 8:22 PMsalmon-musician-36333
04/25/2023, 8:36 PMbillowy-army-68599
salmon-musician-36333
04/25/2023, 8:39 PMsalmon-musician-36333
04/25/2023, 8:42 PMsalmon-musician-36333
04/25/2023, 8:58 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?salmon-musician-36333
04/25/2023, 9:00 PMerror: 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
pulumi-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 ๐salmon-musician-36333
04/25/2023, 11:17 PMdependsOn
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.
salmon-musician-36333
04/25/2023, 11:18 PM{ 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
.salmon-musician-36333
04/27/2023, 1:56 AMpulumi-random
above seem legit?salmon-musician-36333
04/27/2023, 1:57 AMsalmon-musician-36333
04/27/2023, 1:58 AMkeepers: {x: somethingFromCluster.apply(x => ...)
.salmon-musician-36333
04/27/2023, 2:00 AMkeepers
for a recreate.salmon-musician-36333
04/27/2023, 2:06 AMconst 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));