https://pulumi.com logo
Title
s

steep-window-60101

12/02/2021, 8:18 PM
hey, i asked this question in general channel without feedback. Since it is related to AWS terraform statefile parsing with pulumi. I reposted it here for more feedbacks. Thanks!
l

little-cartoon-10569

12/02/2021, 8:44 PM
This code seems to create a reference to remote state, rather than import it. So accessing the outputs would be expected behaviour. What are you hoping to achieve?
That's what the docs for the provider say, too:
The Terraform resource provider for Pulumi lets you consume the outputs contained in Terraform state files from your Pulumi programs. The package provides a RemoteStateReference resource which acts like a native Pulumi StackReference.
Your question said "to import existing terraform state", but that's not what this provider does.
If you want to import from terraform.tfstate, the tool you want is tf2pulumi. https://github.com/pulumi/tf2pulumi https://github.com/pulumi/tf2pulumi#adopting-resource-from-tfstate
s

steep-window-60101

12/02/2021, 10:33 PM
thanks @little-cartoon-10569, i will check the reference doc for more details.