Skip to content

RemoteStateReference resource returns an unclear error message #768

@markoglogovac

Description

@markoglogovac

What happened?

I am trying to read the Terraform output storage_account_id from the state file using the RemoteStateReference resource.
Am I doing something wrong, or there is a bug in process.

Example

tf_state = pulumi_terraform.RemoteStateReference(
resource_name="tfstate",
backend_type="azurerm",
args=state.AzureRMBackendArgs(
subscription_id='subscription id',
tenant_id=pulumi.Output.secret(os.getenv('ARM_TENANT_ID')),
client_id=pulumi.Output.secret(os.getenv('LZ_NS_SP_ID')),
client_secret=pulumi.Output.secret(os.getenv('LZ_NS_SP_ID_SECRET')),
resource_group_name=pulumi.Output.secret(os.getenv('CUSTOMER_STATE_FILE_RG')),
storage_account_name=pulumi.Output.secret(os.getenv('CUSTOMER_STORAGE_ACCOUNT_NAME')),
container_name=pulumi.Output.secret(os.getenv('CUSTOMER_CONTAINER_NAME')),
key=pulumi.Output.secret(os.getenv('CUSTOMER_TERRAFORM_CONFIG_KEY')),
workspace="default"
)
customer_module_output = tf_state.get_output('customer_module_output')
storage_id = customer_module_output['storage_account_id']

Output of pulumi about

error: Preview failed: error constructing backend state manager: 5 problems:

  • unsupported checkable object kind "var"
  • unsupported checkable object kind "var"
  • unsupported checkable object kind "var"
  • unsupported checkable object kind "var"
  • unsupported checkable object kind "var"
    error: preview failed

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSome behavior is incorrect or out of spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions