victorious-dusk-75271
08/12/2022, 6:56 AMDFpSfUijK8
error: deleting urn:pulumi:dev::allrites-infrastructure::custom:component:rds:globaldb$aws:rds/cluster:Cluster::globaldb-cluster: 1 error occurred:
* error deleting RDS Cluster (tf-20220812010823122500000001): InvalidParameterValue: The parameter DBClusterSnapshotIdentifier is not a valid identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits, and hyphens; and must not end with a hyphen or contain two consecutive hyphens.
status code: 400, request id: 92d6a0f5-2c7d-45d7-b094-bf9d91838c77
little-cartoon-10569
08/14/2022, 8:33 PMvictorious-dusk-75271
08/17/2022, 6:15 AMconst finalSnapshotIdentifier = new random.RandomString("final-snapshot-identifier-random", {
length: 10,
special: false,
}).result
----
{
finalSnapshotIdentifier: config.get<string>('FINAL_SNAPSHOT_IDENTIFIER') || finalSnapshotIdentifier,
}
little-cartoon-10569
08/18/2022, 10:20 PMstring || pulumi.Output<string>
which possibly isn't being resolved as a pulumi.Output<string>
, so you're ending up with the error message (the one that says you cannot use an Output as a string) as the finalSnapshotIdentifier.
To confirm / work around this, you could change the value to this:
{
finalSnapshotIdentifier: pulumi.output(config.get<string>('FINAL_SNAPSHOT_IDENTIFIER') || finalSnapshotIdentifier)
}
This will definitely be detected as a pulumi.Output
, so it should sort itself out. If it doesn't, then the next thing to do is to look at the actual value by logging. Something along the lines of
<http://pulumi.log.info|pulumi.log.info>(`Config value: ${config.get<string>('FINAL_SNAPSHOT_IDENTIFIER')}`);
<http://pulumi.log.info|pulumi.log.info>(("Random string", finalSnapshotIdentifier);
Note that you have to use the two-parameter version of pulumi.log.info() or else put that log statement inside an apply().