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

feat: add dns response policy sub-module #55

Merged
merged 5 commits into from
Aug 21, 2023

Conversation

maitreya-source
Copy link
Contributor

Cloud DNS private zones allow customers to create response policies that can override the resolver behavior for DNS queries.

The sub-module contains following resources:

  • google_dns_response_policy
  • google_dns_response_policy_rule

This allows customers to create policy, attach rules within the created policy and attach the policy to a VPC network.

NOTE: Both resources are currently under beta, thus the sub-module is using beta provider.

Testing

  • Added fixtures and inspec for the new sub-module. It tests the successful creation of policy and it's rules.

Removed sub-network from shared test module

  • The shared test fixture file network.tf was creating sub-network which is not needed for testing DNS zones as well as DNS response policy.

@maitreya-source maitreya-source requested a review from a team as a code owner May 24, 2023 11:11
@bharathkkb
Copy link
Member

/gcbrun

Copy link
Member

@bharathkkb bharathkkb left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @maitreya-source

examples/dns-response-policy/variable.tf Outdated Show resolved Hide resolved
modules/dns_response_policy/README.md Outdated Show resolved Hide resolved
modules/dns_response_policy/README.md Outdated Show resolved Hide resolved
modules/dns_response_policy/variable.tf Outdated Show resolved Hide resolved
modules/dns_response_policy/version.tf Show resolved Hide resolved
test/fixtures/dns_response_policy/main.tf Outdated Show resolved Hide resolved
required_providers {
google-beta = {
source = "hashicorp/google-beta"
version = "~> 4.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you plz set this to ">= 4.75, < 5.0" as response policy was moved to GA in 4.75?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the version

Copy link
Collaborator

Choose a reason for hiding this comment

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

@maitreya-source This one should remain ">= 4.75, < 5.0" as module needs version 4.75+. Example version.tf should always be set "~> 4.0"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the module version to point to ">= 4.75, < 5.0" while keeping the example to ~> 4.0
Although trying to understand what would be the benefit in keeping the example version to ~> 4.0.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Module will force example to use appropriate version.

@imrannayer imrannayer self-requested a review July 18, 2023 02:20
@imrannayer
Copy link
Collaborator

@maitreya-source r u still working on this sub-module?

@maitreya-source
Copy link
Contributor Author

@maitreya-source r u still working on this sub-module?

Hi @imrannayer, yes, have not been able to find time for this due to other priorities, but I'll look into it this week. :)
If this is urgently needed, I'm happy to give the repo access to someone who can pick up.

@imrannayer
Copy link
Collaborator

imrannayer commented Aug 14, 2023

@maitreya-source can you change provider in version.tf as follows:

terraform {
  required_version = ">= 1.3.0"
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "~> 4.0"
    }
    google-beta = {
      source  = "hashicorp/google-beta"
      version = "~> 4.0"
    }
  }
}

@maitreya-source
Copy link
Contributor Author

@maitreya-source can you change provider in version.tf as follows:

terraform {
  required_version = ">= 1.3.0"
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "~> 4.0"
    }
    google-beta = {
      source  = "hashicorp/google-beta"
      version = "~> 4.0"
    }
  }
}

Done @imrannayer

@maitreya-source
Copy link
Contributor Author

@bharathkkb / @imrannayer thanks for the patience on this one. Let me know if any more changes are required. Thanks!

@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer imrannayer merged commit ce34fe5 into terraform-google-modules:master Aug 21, 2023
4 checks passed
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.

None yet

3 participants