Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RemoteStateReference extremely slow #601

Open
cheribral opened this issue May 6, 2021 · 1 comment
Open

RemoteStateReference extremely slow #601

cheribral opened this issue May 6, 2021 · 1 comment
Labels
impact/performance Something is slower than expected kind/enhancement Improvements or new features

Comments

@cheribral
Copy link

I am experimenting with the remote state to see whether we can use pulumi along side terraform. I tried a very simple python program which reads a 300k state file and exports one nested map.

Expected behavior

I would expect pulumi up to return rather quickly.

Current behavior

It takes on the order of 4-5 minutes to finish running and print the outputs.

Steps to reproduce

import pulumi
import pulumi_terraform as terraform

tf = terraform.state.RemoteStateReference('tf', backend_type='local', args=terraform.state.LocalBackendArgs(path='resources/tfstate/stage1.tfstate'))
pulumi.export('test', tf.get_output('sides'))

This is using:

  • pulumi v3.2.0
  • python 3.6 (centos 7)
  • pulumi-terraform v5.1.0
@cheribral cheribral added the kind/bug Some behavior is incorrect or out of spec label May 6, 2021
@mikhailshilkov mikhailshilkov added impact/performance Something is slower than expected kind/enhancement Improvements or new features and removed kind/bug Some behavior is incorrect or out of spec labels May 6, 2021
@cheribral
Copy link
Author

cheribral commented Jun 9, 2021

I've done a bit more work with pulumi now, and I'm not sure this problem is entirely specific to pulumi_terraform. This seems to be a problem I can also cause with general stack references. It must be doing something special, because normally it should be very quick to load a json file, but this can use a lot of CPU and take a long time relatively speaking.

I am guessing (heavy emphasis on "guess") this is because these remote state calls are trying to manage secrets and dependencies properly, converting everything to outputs etc. If this is the case, would it make more sense to somehow skip all this processing for terraform related inputs since they were never tied into the pulumi machinery to begin with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/performance Something is slower than expected kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

2 participants