diff --git a/go.mod b/go.mod index 93dbac93e2..9dbb8132b6 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/confluentinc/ccloud-sdk-go-v2/mds v0.4.0 github.com/confluentinc/ccloud-sdk-go-v2/metrics v0.2.0 github.com/confluentinc/ccloud-sdk-go-v2/networking v0.12.0 - github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point v0.2.0 + github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point v0.3.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-dnsforwarder v0.2.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-ip v0.2.0 github.com/confluentinc/ccloud-sdk-go-v2/networking-privatelink v0.2.0 diff --git a/go.sum b/go.sum index 03a8014621..30835f386a 100644 --- a/go.sum +++ b/go.sum @@ -168,8 +168,8 @@ github.com/confluentinc/ccloud-sdk-go-v2/metrics v0.2.0 h1:TWwZHdfo2XNKrnGOuxXx4 github.com/confluentinc/ccloud-sdk-go-v2/metrics v0.2.0/go.mod h1:odGsHChrn2l+jaOvx4Gib5//U4a3Id79wstQVkNh8v0= github.com/confluentinc/ccloud-sdk-go-v2/networking v0.12.0 h1:eaIjlpKyjW6WgOKqR2/v1oITgK/m/eg4PdIrmIN8fbc= github.com/confluentinc/ccloud-sdk-go-v2/networking v0.12.0/go.mod h1:jL9lLHYwFKzCJE5Fh62UdRqJCMJ9T/xg5QOdnQRYIUg= -github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point v0.2.0 h1:aRK2GFLzCWms5Nl5OlMtIFwOl/vUgzczsV2D4di0e/4= -github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point v0.2.0/go.mod h1:HV1xGUwTsGEU3Mgvc+7Ya/0HRpUO69L2rqqxO7LeWMc= +github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point v0.3.0 h1:8STgb5JDV6QFhZIGzvLuGA3eC1aIUBcqW6zS8pHN6BU= +github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point v0.3.0/go.mod h1:HV1xGUwTsGEU3Mgvc+7Ya/0HRpUO69L2rqqxO7LeWMc= github.com/confluentinc/ccloud-sdk-go-v2/networking-dnsforwarder v0.2.0 h1:OdIeCGfy8iQ2Bm+08CDXYttwZOUme0e9FVGrBjBJGx4= github.com/confluentinc/ccloud-sdk-go-v2/networking-dnsforwarder v0.2.0/go.mod h1:472T8ufudvXgXea2BhYxhE/2eowwhoulZzboDh6+ec4= github.com/confluentinc/ccloud-sdk-go-v2/networking-ip v0.2.0 h1:ZHNF2DeqVlNPuKGZ41SBMLGj8GBlvvcwOPnfZLZXA/4= diff --git a/internal/network/command_access_point.go b/internal/network/command_access_point.go index afacbcec09..ae275b8c2e 100644 --- a/internal/network/command_access_point.go +++ b/internal/network/command_access_point.go @@ -11,20 +11,21 @@ type accessPointCommand struct { } type accessPointOut struct { - Id string `human:"ID" serialized:"id"` - Name string `human:"Name,omitempty" serialized:"name,omitempty"` - AwsVpcEndpointService string `human:"AWS VPC Endpoint Service,omitempty" serialized:"aws_vpc_endpoint_service,omitempty"` - AwsVpcEndpoint string `human:"AWS VPC Endpoint,omitempty" serialized:"aws_vpc_endpoint,omitempty"` - AwsVpcEndpointDnsName string `human:"AWS VPC Endpoint DNS Name,omitempty" serialized:"aws_vpc_endpoint_dns_name,omitempty"` - AzurePrivateLinkService string `human:"Azure Private Link Service,omitempty" serialized:"azure_private_link_service,omitempty"` - AzurePrivateLinkSubresourceName string `human:"Azure Private Link Subresource Name,omitempty" serialized:"azure_private_link_subresource_name,omitempty"` - AzurePrivateEndpoint string `human:"Azure Private Endpoint,omitempty" serialized:"azure_private_endpoint,omitempty"` - AzurePrivateEndpointDomain string `human:"Azure Private Endpoint Domain,omitempty" serialized:"azure_private_endpoint_domain,omitempty"` - AzurePrivateEndpointIpAddress string `human:"Azure Private Endpoint IP Address,omitempty" serialized:"azure_private_endpoint_ip_address,omitempty"` - HighAvailability bool `human:"High Availability,omitempty" serialized:"high_availability,omitempty"` - Environment string `human:"Environment" serialized:"environment"` - Gateway string `human:"Gateway" serialized:"gateway"` - Phase string `human:"Phase" serialized:"phase"` + Id string `human:"ID" serialized:"id"` + Name string `human:"Name,omitempty" serialized:"name,omitempty"` + AwsVpcEndpointService string `human:"AWS VPC Endpoint Service,omitempty" serialized:"aws_vpc_endpoint_service,omitempty"` + AwsVpcEndpoint string `human:"AWS VPC Endpoint,omitempty" serialized:"aws_vpc_endpoint,omitempty"` + AwsVpcEndpointDnsName string `human:"AWS VPC Endpoint DNS Name,omitempty" serialized:"aws_vpc_endpoint_dns_name,omitempty"` + AzurePrivateLinkService string `human:"Azure Private Link Service,omitempty" serialized:"azure_private_link_service,omitempty"` + AzurePrivateLinkSubresourceName string `human:"Azure Private Link Subresource Name,omitempty" serialized:"azure_private_link_subresource_name,omitempty"` + AzurePrivateEndpoint string `human:"Azure Private Endpoint,omitempty" serialized:"azure_private_endpoint,omitempty"` + AzurePrivateEndpointDomain string `human:"Azure Private Endpoint Domain,omitempty" serialized:"azure_private_endpoint_domain,omitempty"` + AzurePrivateEndpointIpAddress string `human:"Azure Private Endpoint IP Address,omitempty" serialized:"azure_private_endpoint_ip_address,omitempty"` + AzurePrivateEndpointCustomDnsConfigDomains []string `human:"Azure Private Endpoint Custom DNS Config Domains,omitempty" serialized:"azure_private_endpoint_custom_dns_config_domains,omitempty"` + HighAvailability bool `human:"High Availability,omitempty" serialized:"high_availability,omitempty"` + Environment string `human:"Environment" serialized:"environment"` + Gateway string `human:"Gateway" serialized:"gateway"` + Phase string `human:"Phase" serialized:"phase"` } func newAccessPointCommand(prerunner pcmd.PreRunner) *cobra.Command { diff --git a/internal/network/command_access_point_private_link_egress_endpoint.go b/internal/network/command_access_point_private_link_egress_endpoint.go index 006a8a5f15..d71792225d 100644 --- a/internal/network/command_access_point_private_link_egress_endpoint.go +++ b/internal/network/command_access_point_private_link_egress_endpoint.go @@ -93,6 +93,7 @@ func printPrivateLinkEgressEndpointTable(cmd *cobra.Command, egressEndpoint netw out.AzurePrivateEndpoint = egressEndpoint.Status.Config.NetworkingV1AzureEgressPrivateLinkEndpointStatus.GetPrivateEndpointResourceId() out.AzurePrivateEndpointDomain = egressEndpoint.Status.Config.NetworkingV1AzureEgressPrivateLinkEndpointStatus.GetPrivateEndpointDomain() out.AzurePrivateEndpointIpAddress = egressEndpoint.Status.Config.NetworkingV1AzureEgressPrivateLinkEndpointStatus.GetPrivateEndpointIpAddress() + out.AzurePrivateEndpointCustomDnsConfigDomains = egressEndpoint.Status.Config.NetworkingV1AzureEgressPrivateLinkEndpointStatus.GetPrivateEndpointCustomDnsConfigDomains() } table := output.NewTable(cmd) diff --git a/internal/network/command_access_point_private_link_egress_endpoint_list.go b/internal/network/command_access_point_private_link_egress_endpoint_list.go index ff1a647583..4d558bc181 100644 --- a/internal/network/command_access_point_private_link_egress_endpoint_list.go +++ b/internal/network/command_access_point_private_link_egress_endpoint_list.go @@ -76,6 +76,7 @@ func (c *accessPointCommand) list(cmd *cobra.Command, _ []string) error { out.AzurePrivateEndpoint = egressEndpoint.Status.Config.NetworkingV1AzureEgressPrivateLinkEndpointStatus.GetPrivateEndpointResourceId() out.AzurePrivateEndpointDomain = egressEndpoint.Status.Config.NetworkingV1AzureEgressPrivateLinkEndpointStatus.GetPrivateEndpointDomain() out.AzurePrivateEndpointIpAddress = egressEndpoint.Status.Config.NetworkingV1AzureEgressPrivateLinkEndpointStatus.GetPrivateEndpointIpAddress() + out.AzurePrivateEndpointCustomDnsConfigDomains = egressEndpoint.Status.Config.NetworkingV1AzureEgressPrivateLinkEndpointStatus.GetPrivateEndpointCustomDnsConfigDomains() } list.Add(out) diff --git a/test/fixtures/output/network/access-point/private-link/egress-endpoint/create-azure.golden b/test/fixtures/output/network/access-point/private-link/egress-endpoint/create-azure.golden index c84e17ba6e..6700ff6ea2 100644 --- a/test/fixtures/output/network/access-point/private-link/egress-endpoint/create-azure.golden +++ b/test/fixtures/output/network/access-point/private-link/egress-endpoint/create-azure.golden @@ -1,12 +1,13 @@ -+-------------------------------------+------------------------------------------------------------------------------------------------------------------------+ -| ID | ap-67890 | -| Name | my-egress-endpoint | -| Azure Private Link Service | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | -| Azure Private Link Subresource Name | subresource1 | -| Azure Private Endpoint | private-endpoint-id | -| Azure Private Endpoint Domain | domain.com | -| Azure Private Endpoint IP Address | 10.2.0.68 | -| Environment | env-596 | -| Gateway | gw-123456 | -| Phase | READY | -+-------------------------------------+------------------------------------------------------------------------------------------------------------------------+ ++--------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| ID | ap-67890 | +| Name | my-egress-endpoint | +| Azure Private Link Service | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | +| Azure Private Link Subresource Name | subresource1 | +| Azure Private Endpoint | private-endpoint-id | +| Azure Private Endpoint Domain | domain.com | +| Azure Private Endpoint IP Address | 10.2.0.68 | +| Azure Private Endpoint Custom DNS Config Domains | dbname.database.windows.net, dbname-region.database.windows.net | +| Environment | env-596 | +| Gateway | gw-123456 | +| Phase | READY | ++--------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/access-point/private-link/egress-endpoint/describe-azure.golden b/test/fixtures/output/network/access-point/private-link/egress-endpoint/describe-azure.golden index a92c6eaa6e..9e701313d0 100644 --- a/test/fixtures/output/network/access-point/private-link/egress-endpoint/describe-azure.golden +++ b/test/fixtures/output/network/access-point/private-link/egress-endpoint/describe-azure.golden @@ -1,12 +1,13 @@ -+-------------------------------------+------------------------------------------------------------------------------------------------------------------------+ -| ID | ap-67890 | -| Name | my-azure-egress-access-point | -| Azure Private Link Service | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | -| Azure Private Link Subresource Name | subresource | -| Azure Private Endpoint | private-endpoint-id | -| Azure Private Endpoint Domain | domain.com | -| Azure Private Endpoint IP Address | 10.2.0.68 | -| Environment | env-596 | -| Gateway | gw-12345 | -| Phase | READY | -+-------------------------------------+------------------------------------------------------------------------------------------------------------------------+ ++--------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| ID | ap-67890 | +| Name | my-azure-egress-access-point | +| Azure Private Link Service | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | +| Azure Private Link Subresource Name | subresource | +| Azure Private Endpoint | private-endpoint-id | +| Azure Private Endpoint Domain | domain.com | +| Azure Private Endpoint IP Address | 10.2.0.68 | +| Azure Private Endpoint Custom DNS Config Domains | dbname.database.windows.net, dbname-region.database.windows.net | +| Environment | env-596 | +| Gateway | gw-12345 | +| Phase | READY | ++--------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ diff --git a/test/fixtures/output/network/access-point/private-link/egress-endpoint/list-json.golden b/test/fixtures/output/network/access-point/private-link/egress-endpoint/list-json.golden index e85520b89e..fb0b9726dc 100644 --- a/test/fixtures/output/network/access-point/private-link/egress-endpoint/list-json.golden +++ b/test/fixtures/output/network/access-point/private-link/egress-endpoint/list-json.golden @@ -18,6 +18,10 @@ "azure_private_endpoint": "private-endpoint-id", "azure_private_endpoint_domain": "domain.com", "azure_private_endpoint_ip_address": "10.2.0.68", + "azure_private_endpoint_custom_dns_config_domains": [ + "dbname.database.windows.net", + "dbname-region.database.windows.net" + ], "environment": "env-596", "gateway": "gw-12345", "phase": "READY" diff --git a/test/fixtures/output/network/access-point/private-link/egress-endpoint/list.golden b/test/fixtures/output/network/access-point/private-link/egress-endpoint/list.golden index f05395a427..729f765cfb 100644 --- a/test/fixtures/output/network/access-point/private-link/egress-endpoint/list.golden +++ b/test/fixtures/output/network/access-point/private-link/egress-endpoint/list.golden @@ -1,5 +1,6 @@ - ID | Name | AWS VPC Endpoint Service | AWS VPC Endpoint | AWS VPC Endpoint DNS Name | Azure Private Link Service | Azure Private Link Subresource | Azure Private Endpoint | Azure Private Endpoint Domain | Azure Private Endpoint IP | High Availability | Environment | Gateway | Phase - | | | | | | Name | | | Address | | | | ------------+------------------------------+---------------------------------------------------------+------------------+---------------------------+------------------------------------------------------------------------------------------------------------------------+--------------------------------+------------------------+-------------------------------+--------------------------------+-------------------+-------------+----------+-------- - ap-12345 | my-aws-egress-access-point | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | vpc-endpoint-id | vpc-endpoint-dns-name | | | | | | true | env-596 | gw-12345 | READY - ap-67890 | my-azure-egress-access-point | | | | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | subresource | private-endpoint-id | domain.com | 10.2.0.68 | false | env-596 | gw-12345 | READY + ID | Name | AWS VPC Endpoint Service | AWS VPC Endpoint | AWS VPC Endpoint DNS Name | Azure Private Link Service | Azure Private Link Subresource | Azure Private Endpoint | Azure Private Endpoint Domain | Azure Private Endpoint IP | Azure Private Endpoint Custom | High Availability | Environment | Gateway | Phase + | | | | | | Name | | | Address | DNS Config Domains | | | | +-----------+------------------------------+---------------------------------------------------------+------------------+---------------------------+------------------------------------------------------------------------------------------------------------------------+--------------------------------+------------------------+-------------------------------+--------------------------------+------------------------------------+-------------------+-------------+----------+-------- + ap-12345 | my-aws-egress-access-point | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | vpc-endpoint-id | vpc-endpoint-dns-name | | | | | | | true | env-596 | gw-12345 | READY + ap-67890 | my-azure-egress-access-point | | | | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | subresource | private-endpoint-id | domain.com | 10.2.0.68 | dbname.database.windows.net, | false | env-596 | gw-12345 | READY + | | | | | | | | | | dbname-region.database.windows.net | | | | diff --git a/test/fixtures/output/network/access-point/private-link/egress-endpoint/update-azure.golden b/test/fixtures/output/network/access-point/private-link/egress-endpoint/update-azure.golden index 51b5fd8d3b..3ad6d803bc 100644 --- a/test/fixtures/output/network/access-point/private-link/egress-endpoint/update-azure.golden +++ b/test/fixtures/output/network/access-point/private-link/egress-endpoint/update-azure.golden @@ -1,12 +1,13 @@ -+-------------------------------------+------------------------------------------------------------------------------------------------------------------------+ -| ID | ap-67890 | -| Name | my-new-azure-egress-access-point | -| Azure Private Link Service | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | -| Azure Private Link Subresource Name | subresource | -| Azure Private Endpoint | private-endpoint-id | -| Azure Private Endpoint Domain | domain.com | -| Azure Private Endpoint IP Address | 10.2.0.68 | -| Environment | env-596 | -| Gateway | gw-12345 | -| Phase | READY | -+-------------------------------------+------------------------------------------------------------------------------------------------------------------------+ ++--------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| ID | ap-67890 | +| Name | my-new-azure-egress-access-point | +| Azure Private Link Service | /subscriptions/0000000/resourceGroups/plsRgName/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName | +| Azure Private Link Subresource Name | subresource | +| Azure Private Endpoint | private-endpoint-id | +| Azure Private Endpoint Domain | domain.com | +| Azure Private Endpoint IP Address | 10.2.0.68 | +| Azure Private Endpoint Custom DNS Config Domains | dbname.database.windows.net, dbname-region.database.windows.net | +| Environment | env-596 | +| Gateway | gw-12345 | +| Phase | READY | ++--------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ diff --git a/test/test-server/networking_handlers.go b/test/test-server/networking_handlers.go index ef3d0eeebb..53c7fdb8c6 100644 --- a/test/test-server/networking_handlers.go +++ b/test/test-server/networking_handlers.go @@ -2504,10 +2504,11 @@ func getAzureEgressAccessPoint(id, environment, name string) networkingaccesspoi Phase: "READY", Config: &networkingaccesspointv1.NetworkingV1AccessPointStatusConfigOneOf{ NetworkingV1AzureEgressPrivateLinkEndpointStatus: &networkingaccesspointv1.NetworkingV1AzureEgressPrivateLinkEndpointStatus{ - Kind: "AzureEgressPrivateLinkEndpointStatus", - PrivateEndpointResourceId: "private-endpoint-id", - PrivateEndpointDomain: networkingaccesspointv1.PtrString("domain.com"), - PrivateEndpointIpAddress: "10.2.0.68", + Kind: "AzureEgressPrivateLinkEndpointStatus", + PrivateEndpointResourceId: "private-endpoint-id", + PrivateEndpointDomain: networkingaccesspointv1.PtrString("domain.com"), + PrivateEndpointIpAddress: "10.2.0.68", + PrivateEndpointCustomDnsConfigDomains: &[]string{"dbname.database.windows.net", "dbname-region.database.windows.net"}, }, }, }, @@ -2592,10 +2593,11 @@ func handleNetworkingAccessPointCreate(t *testing.T) http.HandlerFunc { Phase: "READY", Config: &networkingaccesspointv1.NetworkingV1AccessPointStatusConfigOneOf{ NetworkingV1AzureEgressPrivateLinkEndpointStatus: &networkingaccesspointv1.NetworkingV1AzureEgressPrivateLinkEndpointStatus{ - Kind: "AzureEgressPrivateLinkEndpointStatus", - PrivateEndpointResourceId: "private-endpoint-id", - PrivateEndpointDomain: networkingaccesspointv1.PtrString("domain.com"), - PrivateEndpointIpAddress: "10.2.0.68", + Kind: "AzureEgressPrivateLinkEndpointStatus", + PrivateEndpointResourceId: "private-endpoint-id", + PrivateEndpointDomain: networkingaccesspointv1.PtrString("domain.com"), + PrivateEndpointIpAddress: "10.2.0.68", + PrivateEndpointCustomDnsConfigDomains: &[]string{"dbname.database.windows.net", "dbname-region.database.windows.net"}, }, }, }