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 a linter to warn on nondeterministic resource names #7491

Merged
merged 2 commits into from
Jul 14, 2022

Conversation

jeskew
Copy link
Member

@jeskew jeskew commented Jul 5, 2022

Resolves #7562

One theme that came up during discussion around #6065 was that while you certainly can create a resource that can't be addressed outside of its initial deployment context, doing so nerfs WhatIf, makes deployments non-repeatable, and is generally not a great idea.

This PR adds a linter that will emit a warning if any of a resource's unique identifiers rely on a non-deterministic value (i.e., a parameter whose default value uses the newGuid or utcNow functions). This does not address the core issue of #6065 but should help with one of the concerns around the "outlining" solution proposed in that issue.

Microsoft Reviewers: Open in CodeFlow

@jeskew jeskew requested a review from anthony-c-martin July 5, 2022 19:38
Copy link
Contributor

@shenglol shenglol left a comment

Choose a reason for hiding this comment

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

:shipit:

@jeskew jeskew merged commit 6cbbb63 into main Jul 14, 2022
@jeskew jeskew deleted the jeskew/deterministic-resource-names-linter branch July 14, 2022 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emit warning diagnostic for nondeterministic resource names
2 participants