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

[WIP] feat(Azure): add new check for private DNS zones #1455

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

johannes-engler-mw
Copy link

Description

Adds #1454 .

This PR adds an assertion helper for Azure Private DNS Zones.

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added support for Azure Private DNS Zones assertion helpers.


// PrivateDNSZoneExists indicates whether the specified private DNS zone exists.
// This function would fail the test if there is an error.
func PrivateDNSZoneExists(t *testing.T, zoneName string, resourceGroupName string, subscriptionID string) bool {
Copy link
Member

Choose a reason for hiding this comment

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

Unused function 'PrivateDNSZoneExists'

Copy link
Author

Choose a reason for hiding this comment

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

Deleted


// GetPrivateDNSZone gets the private DNS zone object
// This function would fail the test if there is an error.
func GetPrivateDNSZone(t *testing.T, zoneName string, resGroupName string, subscriptionID string) *privatedns.PrivateZone {
Copy link
Member

Choose a reason for hiding this comment

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

Unused function GetPrivateDNSZone

Copy link
Author

Choose a reason for hiding this comment

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

Deleted

// CreatePrivateDnsZonesClientE is a helper function that will setup a private DNS zone client.
func CreatePrivateDnsZonesClientE(subscriptionID string) (*privatedns.PrivateZonesClient, error) {
// Validate Azure subscription ID
subscriptionID, err := getTargetAzureSubscription(subscriptionID)
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest changing subscriptionID to different name to avoid shadowing

Copy link
Author

Choose a reason for hiding this comment

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

Renamed

@johannes-engler-mw
Copy link
Author

@denis256 I have implemented your comments, please review.

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