Skip to content

Improve ALZ Module CLI #2

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

Merged
merged 12 commits into from
Mar 17, 2023
Merged

Improve ALZ Module CLI #2

merged 12 commits into from
Mar 17, 2023

Conversation

lovelysandwich
Copy link
Contributor

@lovelysandwich lovelysandwich commented Mar 14, 2023

Pull Request

Description

Adding further CLI 'questions' to allow for configuration and deployment of ALZ.
Adding support for replacement by matching patterns in the existing ALZ bicep configuration.
Support input validation (using Regex - I'm sorry)
Adding tests (of course!)
A few fit and finish changes

(Note. This change doesn't yet address the issues with USEast DCs for Log Analytics Workspace needing to reside in a paired DC UsEast2. That will be handled in a subsequent change.) #3

License

By submitting this pull request, I confirm that my contribution is made under the terms of the projects associated license.

@lovelysandwich lovelysandwich changed the title Improve cli configuration Improve ALZ Module CLI Mar 15, 2023
@lovelysandwich lovelysandwich marked this pull request as ready for review March 15, 2023 14:07
Names = @("parTopLevelManagementGroupSuffix")
Value = ""
DefaultValue = ""
Valid = "^[a-zA-Z]{0,5}$"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make this a function rather than a RegEx. We can have more nuanced handling of error.

We can nest the Regex validation for now - but gives us future scope for better validation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I'm finding pscustomobject doesn't house functions all that well - we might need to change to genuine PS classes to get this kind of functionality...

ConnectivitySubscriptionId = [pscustomobject]@{
ForEnvironment = $true
Description = "The identifier of the Connectivity subscription. (e.g '00000000-0000-0000-0000-000000000000')"
Valid = "^( {){0,1}[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(}){0,1}$"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could be a common 'Validate ID or Validate Guid' validation function.

"Destination": "Parameters"
}
],
"AllowedValues": [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need to find a nice way to do this dynamically - I could embed PS script in here I suppose...

Copy link
Member

@Nepomuceno Nepomuceno left a comment

Choose a reason for hiding this comment

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

:shipit:

@Nepomuceno Nepomuceno merged commit 1dc0a07 into main Mar 17, 2023
@Nepomuceno Nepomuceno deleted the improve-cli-configuration branch March 30, 2023 13:06
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.

2 participants