orange-salesclerk-87964
02/17/2025, 4:16 PM--target
? specifically within the context pulumi up --target
?
my understanding is it allows one to target a specific resource for update, but im getting strange behavior/errors like below, which is counterintuitive to me(why is pulumi looking at/reporting on resources outside the --target
?).
error: Resource 'urn:....' will be destroyed but was not specified in --target list.
Either include resource in --target list or pass --target-dependents to proceed.
where the resource to be destroyed is not the targeted resource, nor should it be destroyed (it still exists in state and in the unfiltered stack)
FWIW, im trying to update a provider (using up --target
) as a workaround for this known issue where provider stored config is out of date and breaks refresh
after a secrets rotation.orange-salesclerk-87964
02/17/2025, 4:18 PMmodern-zebra-45309
02/17/2025, 4:34 PMorange-salesclerk-87964
02/17/2025, 4:36 PMurn:pulumi:prd::iac::pulumi:providers:postgresql::some_database
that needs its config updated because of RDS secrets rotation ( i haven't found a clean way to not use the root creds)
every 7 days refresh
breaks, so im trying to "cleanly" update the provider only, basically force a state refresh for the new creds, before running preview --refresh
the issue is, another ec2 resource, very loosley connected to the provider (still trying to figure this one out) is causing the failure
edit: pretty sure the connection is via an aws iam policy.
// some policy allowing an ec2 role to access the password for a postgres user.
Resource: [
someUserCreatedByPostgresProvider.passwordSecret.apply(
({ secret }) => secret.arn,
),
],
modern-zebra-45309
02/17/2025, 4:39 PMorange-salesclerk-87964
02/17/2025, 4:42 PMprovider1 => uses root creds => creates iam role with RDS access for pulumi
provider2 => uses IAM role => creates database users.
... wait 7 days
refresh errors because provider1 has invalid db creds (after rotation)
edit: technically the providers are connected, but perhaps this would unlock the --target
option for provider1
🤔modern-zebra-45309
02/17/2025, 4:45 PMorange-salesclerk-87964
02/17/2025, 4:50 PMrefresh
would always break for this stack
> One that generates the DB instance and admin credentials
assuming it uses the root creds from the cluster (And they're on a rotation) [the original issue]
im still slightly confused as to why --target
is behaving in this way. As there are easily a dozen resources directly related to the provider that pulumi
does not seem to care about when i use --target
seems very odd that some distantly connected resource (by way of an arn referenced in an IAM policy) is marked for deletion, just because its not part of the --target
chain
IMO, the solve here is this epic, which I think allows dynamic provider credentials, but in the meantime Im solving symptomsmodern-zebra-45309
02/17/2025, 4:55 PMi thinkIf all this stack does it to make an RDS instance and create however many sets of admin credentials you need, it's fine if you're destroying and re-creating the admin credentials each time.would always break for this stackrefresh