Is there a way to modify `inputs.__defaults` in th...
# aws
Is there a way to modify
in the state via code? cc @red-match-15116 probably requires deep pulumi knowledge. For the context, I am trying to find the simplest (read without stack surgery) way to migrate lots of projects out of
So far I have a nice flow on how to refactor the code without losing resources.
The __defaults is a pulumi-terraform-bridge artifact that tries to record the origin of an actual property value to inform further treatment - did the value originate from applying a default or not. I recall it was slightly convoluted .. possibly would reach for explicit surgery in this case ... `pulumi stack export | transform | pulumi stack import``
Yeah, I was hoping I wouldn't have to, but if this is the only option it will be a very simple transformation.
It would be great if I could have types while working with the exported state but I could not find anything relevant. Programming language does not matter that much.
are really the only thing preventing me from using
method to do rather heavy state transformation. Here's what I am working on: original code in the
(awsx creates component resource and urn)
Copy code
const sg = awsx.ec2.SecurityGroup(...)
new code migrated away from
without aliases.
protected initialize(args: pulumi.Inputs)
Copy code
const sg = awsx.ec2.SecurityGroup(...) // transformation with retain on delete=true

const sgIdPromise = new Promise((resolve) =>

const classicSg = new aws.ec2.SecurityGroup(
import: await sgIdPromise
Yeah, interesting idea but not supported yet AFAIK (generated types for state). There is type information in Pulumi Package Schema but the generated helper types are focused on direct use scenarios not transforming state.
Pulumi Package Schema
- is this accessible from the code somewhere?
I think the most fleshed out SDK for working with it is in Go
thank you, time to brush up my Golang "skills"
Just wanna say I am flattered to be tagged as someone with deep pulumi knowledge 💜
And also that I am very glad @enough-garden-22763 jumped in because I sure had no idea how to answer this one
Sorry for tagging you directly, I usually try to avoid this but my questions can take me to the dark places.