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

Terraform init -migrate-state (Local Storage) #371

Merged
merged 2 commits into from
Apr 17, 2023
Merged

Conversation

alfespa17
Copy link
Member

@alfespa17 alfespa17 commented Apr 17, 2023

Adding support to migrate the state to terrakube using

terraform init -migrate-state

This is usefull for migrating the state from other storage backends like terraform cloud

Initial setup

terraform {
  backend "remote" {
    hostname = "app.terraform.io"
    organization = "XXXXXX"

    workspaces {
      name = "migrate-state"
    }
  }
}

When running the flag "-migrate-state"

terraform {
  backend "remote" {
    hostname = "8080-azbuilder-terrakube-q8aleg88vlc.ws-us94.gitpod.io"
    organization = "XXXXXX"

    workspaces {
      name = "migrate-state"
    }
  }
}

The state from terraform was copied to the local storage backend

@sonarcloud
Copy link

sonarcloud bot commented Apr 17, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@alfespa17 alfespa17 mentioned this pull request Apr 17, 2023
@alfespa17 alfespa17 merged commit 3781ed3 into main Apr 17, 2023
3 checks passed
@alfespa17 alfespa17 deleted the migrate-state branch April 17, 2023 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant