Skip to content

terraform state rm always displays success message as long as you give it a "valid" resource name #17800

@kaofelix

Description

@kaofelix

Terraform Version

Terraform v0.11.5

Terraform Command

$ terraform state rm foo.bar
1 items removed.
Item removal successful.

Expected Behavior

Terraform should give me an error saying the resource does not exist.

Actual Behavior

Terraform says it removed 1 item successfully.

Steps to Reproduce

In any folder, even one that does not contain state run terraform state rm random_type.random_name. If there's no . Terraform will complain:

$ terraform state rm foo
Error removing items from the state: Error parsing address 'foo': invalid resource address "foo"

but beyond that it always prints the success message.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions