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

[AVM Module Issue]: Add an output to reference the provisioned KeyVault name #172

Open
1 task done
nickmladenov opened this issue Sep 23, 2024 · 2 comments
Open
1 task done
Assignees
Labels
Language: Terraform 🌐 This is related to the Terraform IaC language Type: Feature Request ➕ New feature or request

Comments

@nickmladenov
Copy link

Check for previous/existing GitHub issues

  • I have checked for previous/existing GitHub issues

Issue Type?

Feature Request

(Optional) Module Version

No response

(Optional) Correlation Id

No response

Description

Could we introduce a resource_name output assigned the value azurerm_key_vault.this.name for this AVM?

This would avoid having to dissect the resource_id output through splitting by using a delimiter and magic numbers for improved code readability.

I've seen other AVM's declare resource as an output with the entire resource definition (azurerm_key_vault.this) specified to allow consumers to reference any missing attributes that have been custom defined.

I would raise a pull request feature for review including this change but it appears this AVM (like many others) has open contribution disabled as I am unable to create a new branch or push one up into the remote repository.

@nickmladenov nickmladenov added Language: Terraform 🌐 This is related to the Terraform IaC language Needs: Triage 🔍 Maintainers need to triage still labels Sep 23, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Status: Response Overdue 🚩 When an issue/PR has not been responded to for X amount of days label Sep 30, 2024
@matt-FFFFFF
Copy link
Member

Hi,

We recently changed the specs to recommend against outputting the whole resource. It has issues with sensitive values and the potential for the schema to change

Instead we recommend that computed attributes are output.

Have you heard of basename()? It will give you the last part of the resource id..

Alternatively use split and reverse and take the zero index.

@matt-FFFFFF matt-FFFFFF removed Needs: Triage 🔍 Maintainers need to triage still Status: Response Overdue 🚩 When an issue/PR has not been responded to for X amount of days labels Oct 4, 2024
@matt-FFFFFF matt-FFFFFF self-assigned this Oct 4, 2024
@nickmladenov
Copy link
Author

Thanks for the recommendations @matt-FFFFFF, we have used similar in various places when data is available at those indexes although it isn't always the case.

I'll update our code with additional function usage in the meantime until there's an available output.

I completely agree with your reasoning for not outputting the whole resource as well as it reducing readability and IDE autocomplete. You mentioned the spec has been changes recently, has that already been published against the AVM standards and conventions document?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language: Terraform 🌐 This is related to the Terraform IaC language Type: Feature Request ➕ New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants