Adds a rule to check that the name of a windows virtual machine is valid #331
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Found an error in my code. Will update later and squash my commits!
Hi,
i added the rule
azurerm_windows_virtual_machine_invalid_name
.It checks, if the name is a valid windows server hostname, based on this documenation:
![image](https://private-user-images.githubusercontent.com/33316737/320747708-01fe1ff8-5445-4441-8677-c0491085b43e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA3MzE4NzcsIm5iZiI6MTcyMDczMTU3NywicGF0aCI6Ii8zMzMxNjczNy8zMjA3NDc3MDgtMDFmZTFmZjgtNTQ0NS00NDQxLTg2NzctYzA0OTEwODViNDNlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzExVDIwNTkzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTllNDdmNTZmYTQwZmMwNGExYTA5NjAxN2Y4NzY2YWM4MzJhNGEyZTljNGI0NDE0ZTVhNzU2MTJiYjlhZmRhYzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.wPA6MinvkCYwUNcNV-Zj2hfRitlRaskQTPv5aTo14PQ)
https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftcompute
Based on the terraform documentation, the check is skipped, if the
![image](https://private-user-images.githubusercontent.com/33316737/320748115-2d6df132-0a60-4987-b4d8-38f3f7953096.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA3MzE4NzcsIm5iZiI6MTcyMDczMTU3NywicGF0aCI6Ii8zMzMxNjczNy8zMjA3NDgxMTUtMmQ2ZGYxMzItMGE2MC00OTg3LWI0ZDgtMzhmM2Y3OTUzMDk2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzExVDIwNTkzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA5ZjMwMzA0NzIwMjJlN2IyNWI4Yjk1OTRiZGIwMTVhYjNhNGQ0N2EzYTNlNTk1N2NjZjUwM2E0NmVjMzk4NmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.aTMpZR9btIC3S4ehYo-l1iZCb8ZCFBo-SZDBbDKDm2U)
computer_name
attribute is specified. In future this rule could be expanded or a second rule specific forcomputer_name could be added
.Thank you!