Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/dist/
/docs/
/legal/
/mock-test/
/prebuilt/
/test/bin/
/test/coverage/
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ 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.14.0
github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point v0.8.0
github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.12.0
github.com/confluentinc/ccloud-sdk-go-v2/networking-dnsforwarder v0.4.0
github.com/confluentinc/ccloud-sdk-go-v2/networking-gateway v0.5.0
github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0
github.com/confluentinc/ccloud-sdk-go-v2/networking-ip v0.2.0
github.com/confluentinc/ccloud-sdk-go-v2/networking-privatelink v0.3.0
github.com/confluentinc/ccloud-sdk-go-v2/org v0.9.0
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ github.com/compose-spec/compose-go/v2 v2.1.3 h1:bD67uqLuL/XgkAK6ir3xZvNLFPxPScEi
github.com/compose-spec/compose-go/v2 v2.1.3/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc=
github.com/confluentinc/ccloud-sdk-go-v1-public v0.0.0-20250521223017-0e8f6f971b52 h1:19qEGhkbZa5fopKCe0VPIV+Sasby4Pv10z9ZaktwWso=
github.com/confluentinc/ccloud-sdk-go-v1-public v0.0.0-20250521223017-0e8f6f971b52/go.mod h1:62EMf+5uFEt1BJ2q8WMrUoI9VUSxAbDnmZCGRt/MbA0=
github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.12.0 h1:eeJPL6TpJddJOwStebbW2Y2IYXJrNrLqe0u9EUaAGr4=
github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.12.0/go.mod h1:mFYZvHI92ChlfghLNpnXNxkwX33jEAUXQ5w0/Ri3OQY=
github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0 h1:xD/maPHZjgexJNsXu0zmeU1CXUXPlmnCDUK+t/ighw0=
github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.12.0/go.mod h1:Nq00w3h+2vpEi+8w1f+lgmNu5m3mHogOzpw8/JzUL6k=
github.com/confluentinc/ccloud-sdk-go-v2/ai v0.1.0 h1:zSF4OQUJXWH2JeAo9rsq13ibk+JFdzITGR8S7cFMpzw=
github.com/confluentinc/ccloud-sdk-go-v2/ai v0.1.0/go.mod h1:DoxqzzF3JzvJr3fWkvCiOHFlE0GoYpozWxFZ1Ud9ntA=
github.com/confluentinc/ccloud-sdk-go-v2/apikeys v0.4.0 h1:8fWyLwMuy8ec0MVF5Avd54UvbIxhDFhZzanHBVwgxdw=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

"github.com/confluentinc/cli/v4/pkg/errors"
"github.com/confluentinc/cli/v4/pkg/output"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

pcloud "github.com/confluentinc/cli/v4/pkg/cloud"
pcmd "github.com/confluentinc/cli/v4/pkg/cmd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package network
import (
"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

pcmd "github.com/confluentinc/cli/v4/pkg/cmd"
"github.com/confluentinc/cli/v4/pkg/examples"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

"github.com/confluentinc/cli/v4/pkg/config"
"github.com/confluentinc/cli/v4/pkg/errors"
Expand All @@ -15,14 +15,19 @@ import (
)

type ingressEndpointOut struct {
Id string `human:"ID" serialized:"id"`
Name string `human:"Name,omitempty" serialized:"name,omitempty"`
Environment string `human:"Environment" serialized:"environment"`
Gateway string `human:"Gateway" serialized:"gateway"`
Phase string `human:"Phase" serialized:"phase"`
AwsVpcEndpointId string `human:"AWS VPC Endpoint ID,omitempty" serialized:"aws_vpc_endpoint_id,omitempty"`
AwsVpcEndpointServiceName string `human:"AWS VPC Endpoint Service Name,omitempty" serialized:"aws_vpc_endpoint_service_name,omitempty"`
DnsDomain string `human:"DNS Domain,omitempty" serialized:"dns_domain,omitempty"`
Id string `human:"ID" serialized:"id"`
Name string `human:"Name,omitempty" serialized:"name,omitempty"`
Environment string `human:"Environment" serialized:"environment"`
Gateway string `human:"Gateway" serialized:"gateway"`
Phase string `human:"Phase" serialized:"phase"`
AwsVpcEndpointId string `human:"AWS VPC Endpoint ID,omitempty" serialized:"aws_vpc_endpoint_id,omitempty"`
AwsVpcEndpointServiceName string `human:"AWS VPC Endpoint Service Name,omitempty" serialized:"aws_vpc_endpoint_service_name,omitempty"`
AzurePrivateLinkServiceAlias string `human:"Azure Private Link Service Alias,omitempty" serialized:"azure_private_link_service_alias,omitempty"`
AzurePrivateLinkServiceResourceId string `human:"Azure Private Link Service Resource ID,omitempty" serialized:"azure_private_link_service_resource_id,omitempty"`
AzurePrivateEndpointResourceId string `human:"Azure Private Endpoint Resource ID,omitempty" serialized:"azure_private_endpoint_resource_id,omitempty"`
GcpPrivateServiceConnectServiceAttachment string `human:"GCP PSC Service Attachment,omitempty" serialized:"gcp_private_service_connect_service_attachment,omitempty"`
GcpPrivateServiceConnectConnectionId string `human:"GCP PSC Connection ID,omitempty" serialized:"gcp_private_service_connect_connection_id,omitempty"`
DnsDomain string `human:"DNS Domain,omitempty" serialized:"dns_domain,omitempty"`
}

func (c *accessPointCommand) newIngressEndpointCommand(cfg *config.Config) *cobra.Command {
Expand Down Expand Up @@ -68,7 +73,9 @@ func (c *accessPointCommand) autocompleteIngressEndpoints() []string {
return nil
}
ingressEndpoints := slices.DeleteFunc(accessPoints, func(accessPoint networkingaccesspointv1.NetworkingV1AccessPoint) bool {
return accessPoint.Spec.GetConfig().NetworkingV1AwsIngressPrivateLinkEndpoint == nil
return accessPoint.Spec.GetConfig().NetworkingV1AwsIngressPrivateLinkEndpoint == nil &&
accessPoint.Spec.GetConfig().NetworkingV1AzureIngressPrivateLinkEndpoint == nil &&
accessPoint.Spec.GetConfig().NetworkingV1GcpIngressPrivateServiceConnectEndpoint == nil
})

suggestions := make([]string, len(ingressEndpoints))
Expand Down Expand Up @@ -102,6 +109,23 @@ func printPrivateLinkIngressEndpointTable(cmd *cobra.Command, ingressEndpoint ne
}
}

if ingressEndpoint.Status.Config != nil && ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus != nil {
out.AzurePrivateLinkServiceAlias = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateLinkServiceAlias()
out.AzurePrivateLinkServiceResourceId = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateLinkServiceResourceId()
out.AzurePrivateEndpointResourceId = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateEndpointResourceId()
if ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.HasDnsDomain() {
out.DnsDomain = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetDnsDomain()
}
}

if ingressEndpoint.Status.Config != nil && ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus != nil {
out.GcpPrivateServiceConnectServiceAttachment = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetPrivateServiceConnectServiceAttachment()
out.GcpPrivateServiceConnectConnectionId = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetPrivateServiceConnectConnectionId()
if ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.HasDnsDomain() {
out.DnsDomain = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetDnsDomain()
}
}

table := output.NewTable(cmd)
table.Add(out)
return table.PrintWithAutoWrap(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

pcloud "github.com/confluentinc/cli/v4/pkg/cloud"
pcmd "github.com/confluentinc/cli/v4/pkg/cmd"
Expand All @@ -24,19 +24,28 @@ func (c *accessPointCommand) newIngressEndpointCreateCommand() *cobra.Command {
Text: "Create an AWS PrivateLink ingress endpoint.",
Code: "confluent network access-point private-link ingress-endpoint create --cloud aws --gateway gw-123456 --vpc-endpoint-id vpce-00000000000000000",
},
examples.Example{
Text: "Create an Azure Private Link ingress endpoint.",
Code: "confluent network access-point private-link ingress-endpoint create --cloud azure --gateway gw-123456 --private-endpoint-resource-id /subscriptions/0000000/resourceGroups/resourceGroupName/providers/Microsoft.Network/privateEndpoints/privateEndpointName",
},
examples.Example{
Text: "Create a GCP Private Service Connect ingress endpoint.",
Code: "confluent network access-point private-link ingress-endpoint create --cloud gcp --gateway gw-123456 --private-service-connect-connection-id 111111111111111111",
},
),
}

pcmd.AddCloudAwsFlag(cmd)
pcmd.AddCloudFlag(cmd)
cmd.Flags().String("vpc-endpoint-id", "", "ID of an AWS VPC endpoint.")
cmd.Flags().String("private-endpoint-resource-id", "", "Resource ID of an Azure Private Endpoint.")
cmd.Flags().String("private-service-connect-connection-id", "", "ID of a GCP Private Service Connect connection.")
addGatewayFlag(cmd, c.AuthenticatedCLICommand)
pcmd.AddContextFlag(cmd, c.CLICommand)
pcmd.AddEnvironmentFlag(cmd, c.AuthenticatedCLICommand)
pcmd.AddOutputFlag(cmd)

cobra.CheckErr(cmd.MarkFlagRequired("cloud"))
cobra.CheckErr(cmd.MarkFlagRequired("gateway"))
cobra.CheckErr(cmd.MarkFlagRequired("vpc-endpoint-id"))

return cmd
}
Expand All @@ -63,6 +72,16 @@ func (c *accessPointCommand) createIngressEndpoint(cmd *cobra.Command, args []st
return err
}

privateEndpointResourceId, err := cmd.Flags().GetString("private-endpoint-resource-id")
if err != nil {
return err
}

privateServiceConnectConnectionId, err := cmd.Flags().GetString("private-service-connect-connection-id")
if err != nil {
return err
}

environmentId, err := c.Context.EnvironmentId()
if err != nil {
return err
Expand All @@ -81,14 +100,37 @@ func (c *accessPointCommand) createIngressEndpoint(cmd *cobra.Command, args []st

switch cloud {
case pcloud.Aws:
if vpcEndpointId == "" {
return fmt.Errorf("flag \"vpc-endpoint-id\" is required for AWS ingress endpoints")
}
createIngressEndpoint.Spec.Config = &networkingaccesspointv1.NetworkingV1AccessPointSpecConfigOneOf{
NetworkingV1AwsIngressPrivateLinkEndpoint: &networkingaccesspointv1.NetworkingV1AwsIngressPrivateLinkEndpoint{
Kind: "AwsIngressPrivateLinkEndpoint",
VpcEndpointId: vpcEndpointId,
},
}
case pcloud.Azure:
if privateEndpointResourceId == "" {
return fmt.Errorf("flag \"private-endpoint-resource-id\" is required for Azure ingress endpoints")
}
createIngressEndpoint.Spec.Config = &networkingaccesspointv1.NetworkingV1AccessPointSpecConfigOneOf{
NetworkingV1AzureIngressPrivateLinkEndpoint: &networkingaccesspointv1.NetworkingV1AzureIngressPrivateLinkEndpoint{
Kind: "AzureIngressPrivateLinkEndpoint",
PrivateEndpointResourceId: privateEndpointResourceId,
},
}
case pcloud.Gcp:
if privateServiceConnectConnectionId == "" {
return fmt.Errorf("flag \"private-service-connect-connection-id\" is required for GCP ingress endpoints")
}
createIngressEndpoint.Spec.Config = &networkingaccesspointv1.NetworkingV1AccessPointSpecConfigOneOf{
NetworkingV1GcpIngressPrivateServiceConnectEndpoint: &networkingaccesspointv1.NetworkingV1GcpIngressPrivateServiceConnectEndpoint{
Kind: "GcpIngressPrivateServiceConnectEndpoint",
PrivateServiceConnectConnectionId: privateServiceConnectConnectionId,
},
}
default:
return fmt.Errorf("ingress endpoints are only supported for AWS")
return fmt.Errorf("ingress endpoints are only supported for AWS, Azure, and GCP")
}

ingressEndpoint, err := c.V2Client.CreateAccessPoint(createIngressEndpoint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ func (c *accessPointCommand) listIngressEndpoint(cmd *cobra.Command, _ []string)
if ingressEndpoint.Spec == nil {
return fmt.Errorf(errors.CorruptedNetworkResponseErrorMsg, "spec")
}
if ingressEndpoint.Spec.GetConfig().NetworkingV1AwsIngressPrivateLinkEndpoint == nil {
if ingressEndpoint.Spec.GetConfig().NetworkingV1AwsIngressPrivateLinkEndpoint == nil &&
ingressEndpoint.Spec.GetConfig().NetworkingV1AzureIngressPrivateLinkEndpoint == nil &&
ingressEndpoint.Spec.GetConfig().NetworkingV1GcpIngressPrivateServiceConnectEndpoint == nil {
continue
}
if ingressEndpoint.Status == nil {
Expand All @@ -70,6 +72,23 @@ func (c *accessPointCommand) listIngressEndpoint(cmd *cobra.Command, _ []string)
}
}

if ingressEndpoint.Status.Config != nil && ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus != nil {
out.AzurePrivateLinkServiceAlias = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateLinkServiceAlias()
out.AzurePrivateLinkServiceResourceId = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateLinkServiceResourceId()
out.AzurePrivateEndpointResourceId = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetPrivateEndpointResourceId()
if ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.HasDnsDomain() {
out.DnsDomain = ingressEndpoint.Status.Config.NetworkingV1AzureIngressPrivateLinkEndpointStatus.GetDnsDomain()
}
}

if ingressEndpoint.Status.Config != nil && ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus != nil {
out.GcpPrivateServiceConnectServiceAttachment = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetPrivateServiceConnectServiceAttachment()
out.GcpPrivateServiceConnectConnectionId = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetPrivateServiceConnectConnectionId()
if ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.HasDnsDomain() {
out.DnsDomain = ingressEndpoint.Status.Config.NetworkingV1GcpIngressPrivateServiceConnectEndpointStatus.GetDnsDomain()
}
}

list.Add(out)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package network
import (
"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

pcmd "github.com/confluentinc/cli/v4/pkg/cmd"
"github.com/confluentinc/cli/v4/pkg/examples"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

"github.com/confluentinc/cli/v4/pkg/errors"
"github.com/confluentinc/cli/v4/pkg/output"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

pcloud "github.com/confluentinc/cli/v4/pkg/cloud"
pcmd "github.com/confluentinc/cli/v4/pkg/cmd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package network
import (
"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

pcmd "github.com/confluentinc/cli/v4/pkg/cmd"
"github.com/confluentinc/cli/v4/pkg/examples"
Expand Down
2 changes: 1 addition & 1 deletion internal/network/command_dns_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

"github.com/confluentinc/cli/v4/pkg/ccloudv2"
pcmd "github.com/confluentinc/cli/v4/pkg/cmd"
Expand Down
2 changes: 1 addition & 1 deletion internal/network/command_dns_record_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package network
import (
"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

pcmd "github.com/confluentinc/cli/v4/pkg/cmd"
"github.com/confluentinc/cli/v4/pkg/examples"
Expand Down
2 changes: 1 addition & 1 deletion internal/network/command_dns_record_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package network
import (
"github.com/spf13/cobra"

networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1"
networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point/v1"

pcmd "github.com/confluentinc/cli/v4/pkg/cmd"
"github.com/confluentinc/cli/v4/pkg/examples"
Expand Down
Loading
Loading