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

backend/gcs: Create the bucket if it does not exists #17552

Closed
wants to merge 1 commit into from

Conversation

kavehmz
Copy link
Contributor

@kavehmz kavehmz commented Mar 11, 2018

When running terraform init on a new project if bucket does not exists we get error.

* writing "gs://my-new-bucket-name/terraform/state/default.tflock" failed: googleapi: Error 404: Not Found, notFound
* storage: object doesn't exist

As far as I can read the document, if I provide project, init should try to create the bucket if it does not exists.

https://www.terraform.io/docs/backends/types/gcs.html

My guess is that behavior was changed during recent refactoring which added lock to gcs.

This PR will bring back the behaviour.

If project (ProjectID) is set in config and bucket does not exist we will try to create it
@jbardin
Copy link
Member

jbardin commented Mar 13, 2018

Hi @kavehmz,

Thanks for the PR, but that was a misfeature which should not have made it through review. Terraform should never create unmanaged resources, and I had to remove it in #16865.

While there has been discussion about adding some sort of interface to backends to allow them to create resources, the facts that they cannot be properly managed and that there are always other things required for bootstrapping reduced the desire for the added complexity.

@jbardin jbardin closed this Mar 13, 2018
@kavehmz
Copy link
Contributor Author

kavehmz commented Mar 13, 2018

noted. Makes sense.

@ghost
Copy link

ghost commented Apr 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 Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants