Skip to content

terraform plan -refresh-only -detailed-exitcode gives incorrect exit code 2 even if the console output says no changes detected #35117

@shaik262

Description

@shaik262

Terraform Version

v1.8.1

Terraform Configuration Files

...terraform config...

Debug Output

I tried to get the exit code displayed on console it gives 2 even if there are no changes detected as per terraform

Expected Behavior

It should return 0 as there are no changes present as per the console

Actual Behavior

terraform plan -refresh-only -detailed-exitcode gives incorrect exit code 2 even if the console output says no changes detected

Steps to Reproduce

we used this command as a part of ADO pipeline drift detection
$terraform plan -refresh-only -detailied-exitcode

Additional Context

image
Screenshot 2024-05-06 160231

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugnewnew issue not yet triagedwaiting for reproductionunable to reproduce issue without further informationwaiting-responseAn issue/pull request is waiting for a response from the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions