Skip to content

Conversation

@mawasile
Copy link
Contributor

This pull request introduces a change to the resource naming logic in the infrastructure configuration, specifically improving the determinism and uniqueness of generated resource names by incorporating a seed based on the environment name.

Enhancements to resource naming logic:

  • Added a new local variable azd_env_seed in infra/main.naming.tf that generates a deterministic integer seed from the MD5 hash of var.azd_environment_name. This helps ensure unique and repeatable resource names per environment.
  • Updated the azurecaf_name.main_names resource in infra/main.naming.tf to use the new random_seed parameter, passing in local.azd_env_seed for improved name uniqueness and consistency.

@mawasile mawasile requested a review from a team as a code owner October 14, 2025 19:17
Copilot AI review requested due to automatic review settings October 14, 2025 19:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves resource naming consistency by adding deterministic seed generation based on the environment name. The change ensures that resource names are both unique per environment and reproducible across deployments.

Key changes:

  • Added deterministic seed generation using MD5 hash of environment name
  • Updated resource naming configuration to use the new seed for consistent random generation

Copy link
Collaborator

@HadwaAbdelhalem HadwaAbdelhalem left a comment

Choose a reason for hiding this comment

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

LGTM!

@mawasile mawasile merged commit 670ed2a into main Oct 15, 2025
12 of 13 checks passed
@mawasile mawasile deleted the mawasile/fix-random-resource-naming branch October 15, 2025 14:12
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.

4 participants