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

Unless and Dialogue blocks #36364

Open
kassett opened this issue Jan 19, 2025 · 2 comments
Open

Unless and Dialogue blocks #36364

kassett opened this issue Jan 19, 2025 · 2 comments
Labels
enhancement new new issue not yet triaged

Comments

@kassett
Copy link

kassett commented Jan 19, 2025

Terraform Version

Terraform v1.10.4
on darwin_arm64

Use Cases

When trying to output messages to developers in the particular environment, you can show error messages, but you can't show just regular messages, except in output blocks. An example use case is, let's say that a particular resource is replaced and now has a new name. It's pertinent that that resource is updated elsewhere, but that place is not tracked in Terraform. I would like the user to be notified that the name changes requires updating, but without throwing an error.

Unless blocks could be useful when managing very large environments with hundreds, if not thousands of resources. It can be easy to miss things in these environment. In my particular example, I have two static IP addresses that should never change. I would like a way to fail the plan in the event that a particular change is going to happen.

Attempted Solutions

Outputs to leave user messages, but outputs are a little nondescript. I would like something more noticeable.
I have used null_resources in the past to check if resources are going to change, but that is very messy.

Proposal

I should preface this by saying that I believe that these would be useful features and would love to implement them myself. However, I don't want to start writing code if there's no desire to implement them.

Unless blocks would look like this:

unless "server_ips" {
    replace  {
        module.proxy.aws_eip[*].public_ip
    }
}

Dialogue blocks would look like this:

dialogue "gihub_runner_secret" {
    replace {
       aws_secretmanager_secret.runner_secret
    }
    
    message = "The name of the secret used by the Github runner has been replaced. Please update it in the Github environment variables."
}

References

No response

@kassett kassett added enhancement new new issue not yet triaged labels Jan 19, 2025
@crw
Copy link
Contributor

crw commented Jan 21, 2025

Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again!

@crw
Copy link
Contributor

crw commented Jan 21, 2025

Hi @kassett, thanks for the offer to implement this idea, however your instinct is likely correct - this sounds like an impactful change that would likely require a deeper conversation about consequences. I'll raise it in triage to get a product and engineering take. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants