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

plan + apply with saved plan and remote state generates local state #741

Closed
sarahhodne opened this issue Jan 6, 2015 · 2 comments · Fixed by #755
Closed

plan + apply with saved plan and remote state generates local state #741

sarahhodne opened this issue Jan 6, 2015 · 2 comments · Fixed by #755

Comments

@sarahhodne
Copy link
Contributor

If I use terraform plan -out=terraform.tfplan and then terraform apply terraform.tfplan, it seems to apply it to a local state instead of a remote state:

% terraform plan -out terraform.tfplan
Refreshing Terraform state prior to plan...

[ ... snip Refreshing state ... ]

The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.

Your plan was also saved to the path below. Call the "apply" subcommand
with this plan file and Terraform will exactly execute this execution
plan.

Path: terraform.tfplan

+/- etc.

% terraform apply terraform.tfplan
<applies normally>
% terraform plan -out=terraform.tfplan
Error loading state: Remote state enabled, but state file 'terraform.tfstate' also present.

The remote state (on Atlas) didn't get updated at all, so the states are now out of sync. It seems mv terraform.tfstate .terraform/terraform.tfstate && terraform push fixed that, though.

@armon
Copy link
Member

armon commented Jan 7, 2015

I just repro'd this. Looking into it.

@ghost
Copy link

ghost commented May 4, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants