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

add -force-copy option to init command #12939

Merged
merged 1 commit into from
Mar 22, 2017
Merged

add -force-copy option to init command #12939

merged 1 commit into from
Mar 22, 2017

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Mar 21, 2017

The -force-copy option will suppress confirmation for copying state
data.

Modify some tests to use the option, making sure to leave coverage of
the Input code path.

fixes #12921

Copy link
Contributor

@mitchellh mitchellh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One typo.

This works great for now. In the future we should consider exposing setting values for the "id" set on InputOpts. It is why they are there we just don't have a way to short-circuit them right now in non-test code. That would let us more easily do force flags without having to special case branches.

command/init.go Outdated
@@ -225,6 228,10 @@ Options:

-no-color If specified, output won't contain any color.

-force-copy Suppress prompts about copying state data. This is
equivalent to providing a "yes" to all confirmation
prompts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a stray tab char.

The `-force-copy` option will suppress confirmation for copying state
data.

Modify some tests to use the option, making sure to leave coverage of
the Input code path.
@jbardin
Copy link
Member Author

jbardin commented Mar 22, 2017

@mitchellh, thanks for the confirmation, I wasn't sure if that was the plan for the input ID and was going to look into it later ;)

@jbardin jbardin merged commit ddb9c51 into master Mar 22, 2017
@jbardin jbardin deleted the jbardin/GH-12921 branch March 22, 2017 12:48
@ianpackard
Copy link

The documentation for init command is missing this flag.

@kilpatty
Copy link

Is there any way to force a no...?

@nbering
Copy link

nbering commented Aug 28, 2017

@s-pk If you use -input=false and a prompt is required it will error out instead of prompting.

Edit:

Here's the documenation for that. You can also set it with an environment variable.

@tonglil
Copy link

tonglil commented Nov 16, 2017

@nbering but I don't want to error out, I don't want to copy.

@nbering
Copy link

nbering commented Nov 16, 2017

@tonglil I think the context of my comment may have been lost. I suspect the person I was replying to deleted their account, because their comment is missing and that name's profile comes up with a 404.

Despite that, I think what you're looking for is the -reconfigure flag, which ignores the existing backend configuration, so it won't prompt and will just set up the new backend ignoring the old configuration.

https://www.terraform.io/docs/commands/init.html#backend-initialization

@ghost
Copy link

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

Successfully merging this pull request may close these issues.

terraform init - local to remote(s3) state, no way to force yes
6 participants