-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_private_endpoint
- expose private_dns_zone_group
, private_dns_zone_configs
, and custom_dns_configs
#7246
Conversation
azurerm_private_endpoint
- expose custom_dns_configs
azurerm_private_endpoint
- expose custom_dns_configs
add New Resource: azurerm_private_dns_zone_group
azurerm_private_endpoint
- expose custom_dns_configs
add New Resource: azurerm_private_dns_zone_group
azurerm_private_endpoint
- expose private_dns_zone_group
, private_dns_zone_configs
, and custom_dns_configs
and
azurerm_private_endpoint
- expose private_dns_zone_group
, private_dns_zone_configs
, and custom_dns_configs
and azurerm_private_endpoint
- expose private_dns_zone_group
, private_dns_zone_configs
, and custom_dns_configs
and
azurerm_private_endpoint
- expose private_dns_zone_group
, private_dns_zone_configs
, and custom_dns_configs
and azurerm_private_endpoint
- expose private_dns_zone_group
, private_dns_zone_configs
, and custom_dns_configs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
partial review as discussed offline
Name: id.Path["privateDnsZoneGroups"], | ||
ResourceGroup: id.ResourceGroup, | ||
ID: input, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should use the PopSegment
and ValidateNoEmptySegments
functions here to ensure this is the ID of a private endpoint and not something else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly Fixed. I can't use ValidateNoEmptySegments
because I am parsing the information for multiple resources from one resource ID(e.g. /subscriptions/XXXX/resourceGroups/jcline-privateDns-rg
/providers/Microsoft.Network/privateEndpoints/contoso-cosmosdb
/privateDnsZoneGroups/privatelink.postgres.database.azure.com2
/privateDnsZoneConfigs/finance-contoso-com
.
return privateDnsZoneGroup, nil | ||
} | ||
|
||
func PrivateDnsZoneResourceIDs(input []interface{}) ([]NameResourceGroup, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same here)
return results, nil | ||
} | ||
|
||
func PrivateEndpointResourceID(input string) (NameResourceGroup, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Name: id.Path["privateDnsZones"], | ||
ResourceGroup: id.ResourceGroup, | ||
ID: v, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
} | ||
|
||
privateDnsZone := NameResourceGroup{ | ||
Name: id.Path["privateDnsZones"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we pull this out into a separate ParseDNSZoneResourceID method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Required: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
ValidateFunc: azure.ValidateResourceID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which then means we can validate this is a Private DNS Zone ID here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
} | ||
if resp.ID == nil || *resp.ID == "" { | ||
return fmt.Errorf("API returns a nil/empty id on Private Endpoint %q (Resource Group %q): %+v", name, resourceGroup, err) | ||
} | ||
d.SetId(*resp.ID) | ||
|
||
// now create the dns zone group | ||
// first I have to see if the dns zone group exists, if it does I need to delete it an re-create it because you can only have one per private endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens to traffic when this is deleted, is this dropped? if so - should we be locating the existing one and updating instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only delete if the name has changed, else I will need to force new the attribute which would delete the entire private endpoint. Once the private DNS zone group is deleted the traffic is automatically re-routed to the existing private endpoint FQDN which is displayed via the custom DNS configs attribute.
Co-authored-by: Tom Harvey <[email protected]>
Co-authored-by: Tom Harvey <[email protected]>
Co-authored-by: Tom Harvey <[email protected]>
=== RUN TestAccAzureRMPrivateEndpoint_basic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aside from one comment LGTM 👍
result["id"] = *input.ID | ||
result["name"] = *input.Name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should nil check these?
This has been released in version 2.15.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.15.0"
}
# ... other configuration ... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
(fixes #6571)