diff --git a/go.mod b/go.mod index f5d54290fc..d3e804d2c9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/confluentinc/cli/v4 -go 1.24.9 +go 1.24.10 + +toolchain go1.24.11 require ( github.com/antihax/optional v1.0.0 @@ -286,3 +288,6 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) + +replace github.com/confluentinc/ccloud-sdk-go-v2/networking-gateway v0.2.0 => github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.11.0 +replace github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point v0.5.0 => github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.10.0 diff --git a/go.sum b/go.sum index 67d58db424..5e60a805ad 100644 --- a/go.sum +++ b/go.sum @@ -188,6 +188,12 @@ 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.9.0 h1:BULMAA6/NxDdd/MPgkXJHRkIh4ZEHNOEU+0SkOiiNqI= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.9.0/go.mod h1:3qRZBOqO0+rqWPWpfB1C56IvO6BvcjgYguIlXS8747s= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.10.0 h1:64ofcEeL8cuN3Ar7ClgQK769jBTbjYYInT+P+1Q+ub0= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-access-point v0.10.0/go.mod h1:VhCGBq6fQ8cJCEkp1OfPV4/8Pw4VbVKQCA9an2tLcQw= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.11.0 h1:z5ud8cyXRQw1QWlTH8mlDjPK9vQkqwALjAZ1RZYV05I= +github.com/confluentinc/ccloud-sdk-go-v2-internal/networking-gateway v0.11.0/go.mod h1:ECFZ7rp1MZKQQ8b2FHOlrngR4x26QcQAnBYGKxMxQ5c= 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= diff --git a/internal/network/command_access_point_private_link.go b/internal/network/command_access_point_private_link.go index 1fa71a0d6f..aa97e493c2 100644 --- a/internal/network/command_access_point_private_link.go +++ b/internal/network/command_access_point_private_link.go @@ -11,6 +11,7 @@ func (c *accessPointCommand) newPrivateLinkCommand() *cobra.Command { } cmd.AddCommand(c.newEgressEndpointCommand()) + cmd.AddCommand(c.newIngressEndpointCommand()) return cmd } diff --git a/internal/network/command_access_point_private_link_ingress_endpoint.go b/internal/network/command_access_point_private_link_ingress_endpoint.go new file mode 100644 index 0000000000..21c5a479f3 --- /dev/null +++ b/internal/network/command_access_point_private_link_ingress_endpoint.go @@ -0,0 +1,105 @@ +package network + +import ( + "fmt" + "slices" + + "github.com/spf13/cobra" + + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + + "github.com/confluentinc/cli/v4/pkg/errors" + "github.com/confluentinc/cli/v4/pkg/output" +) + +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"` +} + +func (c *accessPointCommand) newIngressEndpointCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "ingress-endpoint", + Short: "Manage private link ingress endpoints.", + } + + cmd.AddCommand(c.newIngressEndpointCreateCommand()) + cmd.AddCommand(c.newIngressEndpointDeleteCommand()) + cmd.AddCommand(c.newIngressEndpointDescribeCommand()) + cmd.AddCommand(c.newIngressEndpointListCommand()) + cmd.AddCommand(c.newIngressEndpointUpdateCommand()) + + return cmd +} + +func (c *accessPointCommand) validIngressEndpointArgs(cmd *cobra.Command, args []string) []string { + if len(args) > 0 { + return nil + } + + return c.validIngressEndpointArgsMultiple(cmd, args) +} + +func (c *accessPointCommand) validIngressEndpointArgsMultiple(cmd *cobra.Command, args []string) []string { + if err := c.PersistentPreRunE(cmd, args); err != nil { + return nil + } + + return c.autocompleteIngressEndpoints() +} + +func (c *accessPointCommand) autocompleteIngressEndpoints() []string { + environmentId, err := c.Context.EnvironmentId() + if err != nil { + return nil + } + + accessPoints, err := c.V2Client.ListAccessPoints(environmentId, nil) + if err != nil { + return nil + } + ingressEndpoints := slices.DeleteFunc(accessPoints, func(accessPoint networkingaccesspointv1.NetworkingV1AccessPoint) bool { + return accessPoint.Spec.GetConfig().NetworkingV1AwsIngressPrivateLinkEndpoint == nil + }) + + suggestions := make([]string, len(ingressEndpoints)) + for i, ingressEndpoint := range ingressEndpoints { + suggestions[i] = fmt.Sprintf("%s\t%s", ingressEndpoint.GetId(), ingressEndpoint.Spec.GetDisplayName()) + } + return suggestions +} + +func printPrivateLinkIngressEndpointTable(cmd *cobra.Command, ingressEndpoint networkingaccesspointv1.NetworkingV1AccessPoint) error { + if ingressEndpoint.Spec == nil { + return fmt.Errorf(errors.CorruptedNetworkResponseErrorMsg, "spec") + } + if ingressEndpoint.Status == nil { + return fmt.Errorf(errors.CorruptedNetworkResponseErrorMsg, "status") + } + + out := &ingressEndpointOut{ + Id: ingressEndpoint.GetId(), + Name: ingressEndpoint.Spec.GetDisplayName(), + Gateway: ingressEndpoint.Spec.Gateway.GetId(), + Environment: ingressEndpoint.Spec.Environment.GetId(), + Phase: ingressEndpoint.Status.GetPhase(), + } + + if ingressEndpoint.Status.Config != nil && ingressEndpoint.Status.Config.NetworkingV1AwsIngressPrivateLinkEndpointStatus != nil { + out.AwsVpcEndpointId = ingressEndpoint.Status.Config.NetworkingV1AwsIngressPrivateLinkEndpointStatus.GetVpcEndpointId() + out.AwsVpcEndpointServiceName = ingressEndpoint.Status.Config.NetworkingV1AwsIngressPrivateLinkEndpointStatus.GetVpcEndpointServiceName() + if ingressEndpoint.Status.Config.NetworkingV1AwsIngressPrivateLinkEndpointStatus.HasDnsDomain() { + out.DnsDomain = ingressEndpoint.Status.Config.NetworkingV1AwsIngressPrivateLinkEndpointStatus.GetDnsDomain() + } + } + + table := output.NewTable(cmd) + table.Add(out) + return table.PrintWithAutoWrap(false) +} diff --git a/internal/network/command_access_point_private_link_ingress_endpoint_create.go b/internal/network/command_access_point_private_link_ingress_endpoint_create.go new file mode 100644 index 0000000000..8bb7c14257 --- /dev/null +++ b/internal/network/command_access_point_private_link_ingress_endpoint_create.go @@ -0,0 +1,100 @@ +package network + +import ( + "fmt" + "strings" + + "github.com/spf13/cobra" + + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + + pcloud "github.com/confluentinc/cli/v4/pkg/cloud" + pcmd "github.com/confluentinc/cli/v4/pkg/cmd" + "github.com/confluentinc/cli/v4/pkg/examples" +) + +func (c *accessPointCommand) newIngressEndpointCreateCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "create [name]", + Short: "Create an ingress endpoint.", + Args: cobra.MaximumNArgs(1), + RunE: c.createIngressEndpoint, + Example: examples.BuildExampleString( + examples.Example{ + 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 com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000", + }, + ), + } + + pcmd.AddCloudFlag(cmd) + cmd.Flags().String("vpc-endpoint-id", "", "ID of an AWS VPC endpoint.") + 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 +} + +func (c *accessPointCommand) createIngressEndpoint(cmd *cobra.Command, args []string) error { + name := "" + if len(args) == 1 { + name = args[0] + } + + cloud, err := cmd.Flags().GetString("cloud") + if err != nil { + return err + } + cloud = strings.ToUpper(cloud) + + gateway, err := cmd.Flags().GetString("gateway") + if err != nil { + return err + } + + vpcEndpointId, err := cmd.Flags().GetString("vpc-endpoint-id") + if err != nil { + return err + } + + environmentId, err := c.Context.EnvironmentId() + if err != nil { + return err + } + + createIngressEndpoint := networkingaccesspointv1.NetworkingV1AccessPoint{ + Spec: &networkingaccesspointv1.NetworkingV1AccessPointSpec{ + Environment: &networkingaccesspointv1.ObjectReference{Id: environmentId}, + Gateway: &networkingaccesspointv1.ObjectReference{Id: gateway}, + }, + } + + if name != "" { + createIngressEndpoint.Spec.SetDisplayName(name) + } + + switch cloud { + case pcloud.Aws: + createIngressEndpoint.Spec.Config = &networkingaccesspointv1.NetworkingV1AccessPointSpecConfigOneOf{ + NetworkingV1AwsIngressPrivateLinkEndpoint: &networkingaccesspointv1.NetworkingV1AwsIngressPrivateLinkEndpoint{ + Kind: "AwsIngressPrivateLinkEndpoint", + VpcEndpointId: vpcEndpointId, + }, + } + default: + return fmt.Errorf("ingress endpoints are only supported for AWS") + } + + ingressEndpoint, err := c.V2Client.CreateAccessPoint(createIngressEndpoint) + if err != nil { + return err + } + + return printPrivateLinkIngressEndpointTable(cmd, ingressEndpoint) +} diff --git a/internal/network/command_access_point_private_link_ingress_endpoint_delete.go b/internal/network/command_access_point_private_link_ingress_endpoint_delete.go new file mode 100644 index 0000000000..7f950da666 --- /dev/null +++ b/internal/network/command_access_point_private_link_ingress_endpoint_delete.go @@ -0,0 +1,60 @@ +package network + +import ( + "fmt" + + "github.com/spf13/cobra" + + pcmd "github.com/confluentinc/cli/v4/pkg/cmd" + "github.com/confluentinc/cli/v4/pkg/deletion" + "github.com/confluentinc/cli/v4/pkg/output" + "github.com/confluentinc/cli/v4/pkg/plural" + "github.com/confluentinc/cli/v4/pkg/resource" + "github.com/confluentinc/cli/v4/pkg/utils" +) + +func (c *accessPointCommand) newIngressEndpointDeleteCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "delete [id-2] ... [id-n]", + Short: "Delete one or more ingress endpoints.", + Args: cobra.MinimumNArgs(1), + ValidArgsFunction: pcmd.NewValidArgsFunction(c.validIngressEndpointArgsMultiple), + RunE: c.deleteIngressEndpoint, + } + + pcmd.AddForceFlag(cmd) + pcmd.AddContextFlag(cmd, c.CLICommand) + pcmd.AddEnvironmentFlag(cmd, c.AuthenticatedCLICommand) + + return cmd +} + +func (c *accessPointCommand) deleteIngressEndpoint(cmd *cobra.Command, args []string) error { + environmentId, err := c.Context.EnvironmentId() + if err != nil { + return err + } + + existenceFunc := func(id string) bool { + _, err := c.V2Client.GetAccessPoint(environmentId, id) + return err == nil + } + + if err := deletion.ValidateAndConfirm(cmd, args, existenceFunc, resource.AccessPoint); err != nil { + return err + } + + deleteFunc := func(id string) error { + return c.V2Client.DeleteAccessPoint(environmentId, id) + } + + deletedIds, err := deletion.DeleteWithoutMessage(cmd, args, deleteFunc) + deleteMsg := "Requested to delete %s %s.\n" + if len(deletedIds) == 1 { + output.Printf(c.Config.EnableColor, deleteMsg, resource.AccessPoint, fmt.Sprintf(`"%s"`, deletedIds[0])) + } else if len(deletedIds) > 1 { + output.Printf(c.Config.EnableColor, deleteMsg, plural.Plural(resource.AccessPoint), utils.ArrayToCommaDelimitedString(deletedIds, "and")) + } + + return err +} diff --git a/internal/network/command_access_point_private_link_ingress_endpoint_describe.go b/internal/network/command_access_point_private_link_ingress_endpoint_describe.go new file mode 100644 index 0000000000..72f5ef2e7d --- /dev/null +++ b/internal/network/command_access_point_private_link_ingress_endpoint_describe.go @@ -0,0 +1,44 @@ +package network + +import ( + "github.com/spf13/cobra" + + pcmd "github.com/confluentinc/cli/v4/pkg/cmd" + "github.com/confluentinc/cli/v4/pkg/examples" +) + +func (c *accessPointCommand) newIngressEndpointDescribeCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "describe ", + Short: "Describe an ingress endpoint.", + Args: cobra.ExactArgs(1), + ValidArgsFunction: pcmd.NewValidArgsFunction(c.validIngressEndpointArgs), + RunE: c.describeIngressEndpoint, + Example: examples.BuildExampleString( + examples.Example{ + Text: `Describe ingress endpoint "ap-123456".`, + Code: "confluent network access-point private-link ingress-endpoint describe ap-123456", + }, + ), + } + + pcmd.AddContextFlag(cmd, c.CLICommand) + pcmd.AddEnvironmentFlag(cmd, c.AuthenticatedCLICommand) + pcmd.AddOutputFlag(cmd) + + return cmd +} + +func (c *accessPointCommand) describeIngressEndpoint(cmd *cobra.Command, args []string) error { + environmentId, err := c.Context.EnvironmentId() + if err != nil { + return err + } + + ingressEndpoint, err := c.V2Client.GetAccessPoint(environmentId, args[0]) + if err != nil { + return err + } + + return printPrivateLinkIngressEndpointTable(cmd, ingressEndpoint) +} diff --git a/internal/network/command_access_point_private_link_ingress_endpoint_list.go b/internal/network/command_access_point_private_link_ingress_endpoint_list.go new file mode 100644 index 0000000000..fd73a90efd --- /dev/null +++ b/internal/network/command_access_point_private_link_ingress_endpoint_list.go @@ -0,0 +1,77 @@ +package network + +import ( + "fmt" + + "github.com/spf13/cobra" + + pcmd "github.com/confluentinc/cli/v4/pkg/cmd" + "github.com/confluentinc/cli/v4/pkg/errors" + "github.com/confluentinc/cli/v4/pkg/output" +) + +func (c *accessPointCommand) newIngressEndpointListCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "list", + Short: "List ingress endpoints.", + Args: cobra.NoArgs, + RunE: c.listIngressEndpoint, + } + + cmd.Flags().StringSlice("names", nil, "A comma-separated list of display names.") + pcmd.AddContextFlag(cmd, c.CLICommand) + pcmd.AddEnvironmentFlag(cmd, c.AuthenticatedCLICommand) + pcmd.AddOutputFlag(cmd) + + return cmd +} + +func (c *accessPointCommand) listIngressEndpoint(cmd *cobra.Command, _ []string) error { + environmentId, err := c.Context.EnvironmentId() + if err != nil { + return err + } + + names, err := cmd.Flags().GetStringSlice("names") + if err != nil { + return err + } + + ingressEndpoints, err := c.V2Client.ListAccessPoints(environmentId, names) + if err != nil { + return err + } + + list := output.NewList(cmd) + for _, ingressEndpoint := range ingressEndpoints { + if ingressEndpoint.Spec == nil { + return fmt.Errorf(errors.CorruptedNetworkResponseErrorMsg, "spec") + } + if ingressEndpoint.Spec.GetConfig().NetworkingV1AwsIngressPrivateLinkEndpoint == nil { + continue + } + if ingressEndpoint.Status == nil { + return fmt.Errorf(errors.CorruptedNetworkResponseErrorMsg, "status") + } + + out := &ingressEndpointOut{ + Id: ingressEndpoint.GetId(), + Name: ingressEndpoint.Spec.GetDisplayName(), + Gateway: ingressEndpoint.Spec.Gateway.GetId(), + Environment: ingressEndpoint.Spec.Environment.GetId(), + Phase: ingressEndpoint.Status.GetPhase(), + } + + if ingressEndpoint.Status.Config != nil && ingressEndpoint.Status.Config.NetworkingV1AwsIngressPrivateLinkEndpointStatus != nil { + out.AwsVpcEndpointId = ingressEndpoint.Status.Config.NetworkingV1AwsIngressPrivateLinkEndpointStatus.GetVpcEndpointId() + out.AwsVpcEndpointServiceName = ingressEndpoint.Status.Config.NetworkingV1AwsIngressPrivateLinkEndpointStatus.GetVpcEndpointServiceName() + if ingressEndpoint.Status.Config.NetworkingV1AwsIngressPrivateLinkEndpointStatus.HasDnsDomain() { + out.DnsDomain = ingressEndpoint.Status.Config.NetworkingV1AwsIngressPrivateLinkEndpointStatus.GetDnsDomain() + } + } + + list.Add(out) + } + + return list.Print() +} diff --git a/internal/network/command_access_point_private_link_ingress_endpoint_update.go b/internal/network/command_access_point_private_link_ingress_endpoint_update.go new file mode 100644 index 0000000000..57e18169d5 --- /dev/null +++ b/internal/network/command_access_point_private_link_ingress_endpoint_update.go @@ -0,0 +1,61 @@ +package network + +import ( + "github.com/spf13/cobra" + + networkingaccesspointv1 "github.com/confluentinc/ccloud-sdk-go-v2/networking-access-point/v1" + + pcmd "github.com/confluentinc/cli/v4/pkg/cmd" + "github.com/confluentinc/cli/v4/pkg/examples" +) + +func (c *accessPointCommand) newIngressEndpointUpdateCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "update ", + Short: "Update an existing ingress endpoint.", + Args: cobra.ExactArgs(1), + ValidArgsFunction: pcmd.NewValidArgsFunction(c.validIngressEndpointArgs), + RunE: c.updateIngressEndpoint, + Example: examples.BuildExampleString( + examples.Example{ + Text: `Update the name of ingress endpoint "ap-123456".`, + Code: "confluent network access-point private-link ingress-endpoint update ap-123456 --name my-new-ingress-endpoint", + }, + ), + } + + cmd.Flags().String("name", "", "Name of the ingress endpoint.") + pcmd.AddContextFlag(cmd, c.CLICommand) + pcmd.AddEnvironmentFlag(cmd, c.AuthenticatedCLICommand) + pcmd.AddOutputFlag(cmd) + + cobra.CheckErr(cmd.MarkFlagRequired("name")) + + return cmd +} + +func (c *accessPointCommand) updateIngressEndpoint(cmd *cobra.Command, args []string) error { + name, err := cmd.Flags().GetString("name") + if err != nil { + return err + } + + environmentId, err := c.Context.EnvironmentId() + if err != nil { + return err + } + + updateIngressEndpoint := networkingaccesspointv1.NetworkingV1AccessPointUpdate{ + Spec: &networkingaccesspointv1.NetworkingV1AccessPointSpecUpdate{ + DisplayName: networkingaccesspointv1.PtrString(name), + Environment: &networkingaccesspointv1.ObjectReference{Id: environmentId}, + }, + } + + ingressEndpoint, err := c.V2Client.UpdateAccessPoint(args[0], updateIngressEndpoint) + if err != nil { + return err + } + + return printPrivateLinkIngressEndpointTable(cmd, ingressEndpoint) +} diff --git a/internal/network/command_gateway.go b/internal/network/command_gateway.go index baa15f1d16..6138fef7ef 100644 --- a/internal/network/command_gateway.go +++ b/internal/network/command_gateway.go @@ -18,6 +18,7 @@ import ( const ( awsEgressPrivateLink = "AwsEgressPrivateLink" + awsIngressPrivateLink = "AwsIngressPrivateLink" awsPeering = "AwsPeering" azureEgressPrivateLink = "AzureEgressPrivateLink" azurePeering = "AzurePeering" @@ -27,29 +28,31 @@ const ( ) var ( - createGatewayTypes = []string{"egress-privatelink", "private-network-interface"} - listGatewayTypes = []string{"aws-egress-privatelink", "azure-egress-privatelink", "gcp-egress-private-service-connect"} // TODO: check if we accept private-network-interface here + createGatewayTypes = []string{"egress-privatelink", "ingress-privatelink", "private-network-interface"} + listGatewayTypes = []string{"aws-egress-privatelink", "aws-ingress-privatelink", "azure-egress-privatelink", "gcp-egress-private-service-connect"} // TODO: check if we accept private-network-interface here gatewayTypeMap = map[string]string{ "aws-egress-privatelink": awsEgressPrivateLink, + "aws-ingress-privatelink": awsIngressPrivateLink, "azure-egress-privatelink": azureEgressPrivateLink, "gcp-egress-private-service-connect": gcpEgressPrivateServiceConnect, } ) type gatewayOut struct { - Id string `human:"ID" serialized:"id"` - Name string `human:"Name,omitempty" serialized:"name,omitempty"` - Environment string `human:"Environment" serialized:"environment"` - Region string `human:"Region,omitempty" serialized:"region,omitempty"` - Type string `human:"Type,omitempty" serialized:"type,omitempty"` - AwsPrincipalArn string `human:"AWS Principal ARN,omitempty" serialized:"aws_principal_arn,omitempty"` - AzureSubscription string `human:"Azure Subscription,omitempty" serialized:"azure_subscription,omitempty"` - GcpIamPrincipal string `human:"GCP IAM Principal,omitempty" serialized:"gcp_iam_principal,omitempty"` - GcpProject string `human:"GCP Project,omitempty" serialized:"gcp_project,omitempty"` - Phase string `human:"Phase" serialized:"phase"` - Zones []string `human:"Zones,omitempty" serialized:"zones,omitempty"` - Account string `human:"Account,omitempty" serialized:"account,omitempty"` - ErrorMessage string `human:"Error Message,omitempty" serialized:"error_message,omitempty"` + Id string `human:"ID" serialized:"id"` + Name string `human:"Name,omitempty" serialized:"name,omitempty"` + Environment string `human:"Environment" serialized:"environment"` + Region string `human:"Region,omitempty" serialized:"region,omitempty"` + Type string `human:"Type,omitempty" serialized:"type,omitempty"` + AwsPrincipalArn string `human:"AWS Principal ARN,omitempty" serialized:"aws_principal_arn,omitempty"` + VpcEndpointServiceName string `human:"VPC Endpoint Service Name,omitempty" serialized:"vpc_endpoint_service_name,omitempty"` + AzureSubscription string `human:"Azure Subscription,omitempty" serialized:"azure_subscription,omitempty"` + GcpIamPrincipal string `human:"GCP IAM Principal,omitempty" serialized:"gcp_iam_principal,omitempty"` + GcpProject string `human:"GCP Project,omitempty" serialized:"gcp_project,omitempty"` + Phase string `human:"Phase" serialized:"phase"` + Zones []string `human:"Zones,omitempty" serialized:"zones,omitempty"` + Account string `human:"Account,omitempty" serialized:"account,omitempty"` + ErrorMessage string `human:"Error Message,omitempty" serialized:"error_message,omitempty"` } func (c *command) newGatewayCommand() *cobra.Command { @@ -130,7 +133,7 @@ func autocompleteGateways(client *ccloudv2.Client, environmentId string) []strin func getGatewayCloud(gateway networkinggatewayv1.NetworkingV1Gateway) string { cloud := gateway.Status.GetCloudGateway() - if cloud.NetworkingV1AwsEgressPrivateLinkGatewayStatus != nil || cloud.NetworkingV1AwsPrivateNetworkInterfaceGatewayStatus != nil { + if cloud.NetworkingV1AwsEgressPrivateLinkGatewayStatus != nil || cloud.NetworkingV1AwsIngressPrivateLinkGatewayStatus != nil || cloud.NetworkingV1AwsPrivateNetworkInterfaceGatewayStatus != nil { return pcloud.Aws } @@ -160,6 +163,10 @@ func getGatewayType(gateway networkinggatewayv1.NetworkingV1Gateway) (string, er return awsEgressPrivateLink, nil } + if config.NetworkingV1AwsIngressPrivateLinkGatewaySpec != nil { + return awsIngressPrivateLink, nil + } + if config.NetworkingV1AzureEgressPrivateLinkGatewaySpec != nil { return azureEgressPrivateLink, nil } @@ -208,6 +215,9 @@ func printGatewayTable(cmd *cobra.Command, gateway networkinggatewayv1.Networkin if gatewayType == awsEgressPrivateLink { out.Region = gateway.Spec.Config.NetworkingV1AwsEgressPrivateLinkGatewaySpec.GetRegion() } + if gatewayType == awsIngressPrivateLink { + out.Region = gateway.Spec.Config.NetworkingV1AwsIngressPrivateLinkGatewaySpec.GetRegion() + } if gatewayType == awsPeering { out.Region = gateway.Spec.Config.NetworkingV1AwsPeeringGatewaySpec.GetRegion() } @@ -232,6 +242,8 @@ func printGatewayTable(cmd *cobra.Command, gateway networkinggatewayv1.Networkin case pcloud.Aws: if gatewayType == awsEgressPrivateLink { out.AwsPrincipalArn = gateway.Status.CloudGateway.NetworkingV1AwsEgressPrivateLinkGatewayStatus.GetPrincipalArn() + } else if gatewayType == awsIngressPrivateLink { + out.VpcEndpointServiceName = gateway.Status.CloudGateway.NetworkingV1AwsIngressPrivateLinkGatewayStatus.GetVpcEndpointServiceName() } else if gatewayType == awsPrivateNetworkInterface { out.Account = gateway.Status.CloudGateway.NetworkingV1AwsPrivateNetworkInterfaceGatewayStatus.GetAccount() } diff --git a/internal/network/command_gateway_create.go b/internal/network/command_gateway_create.go index cb006b01cb..88e539745e 100644 --- a/internal/network/command_gateway_create.go +++ b/internal/network/command_gateway_create.go @@ -20,12 +20,12 @@ func (c *command) newGatewayCreateCommand() *cobra.Command { RunE: c.gatewayCreate, Example: examples.BuildExampleString( examples.Example{ - Text: `Create network gateway "my-gateway".`, - Code: "confluent network gateway create my-gateway --cloud aws --region us-east-1 --type egress-privatelink", + Text: `Create AWS ingress private link gateway "my-ingress-gateway".`, + Code: "confluent network gateway create my-ingress-gateway --cloud aws --region us-east-1 --type ingress-privatelink", }, examples.Example{ - Text: "Create an AWS private network interface gateway.", - Code: "confluent network gateway create --cloud aws --region us-east-1 --type private-network-interface", + Text: `Create AWS private network interface gateway "my-pni-gateway".`, + Code: "confluent network gateway create my-pni-gateway --cloud aws --region us-east-1 --type private-network-interface", }, ), } @@ -87,6 +87,13 @@ func (c *command) gatewayCreate(cmd *cobra.Command, args []string) error { Region: region, }, } + } else if gatewayType == "ingress-privatelink" { + createGateway.Spec.Config = &networkinggatewayv1.NetworkingV1GatewaySpecConfigOneOf{ + NetworkingV1AwsIngressPrivateLinkGatewaySpec: &networkinggatewayv1.NetworkingV1AwsIngressPrivateLinkGatewaySpec{ + Kind: "AwsIngressPrivateLinkGatewaySpec", + Region: region, + }, + } } else if gatewayType == "private-network-interface" { createGateway.Spec.Config = &networkinggatewayv1.NetworkingV1GatewaySpecConfigOneOf{ NetworkingV1AwsPrivateNetworkInterfaceGatewaySpec: &networkinggatewayv1.NetworkingV1AwsPrivateNetworkInterfaceGatewaySpec{ diff --git a/internal/network/command_gateway_list.go b/internal/network/command_gateway_list.go index 4278dfd981..a07ef390e9 100644 --- a/internal/network/command_gateway_list.go +++ b/internal/network/command_gateway_list.go @@ -75,6 +75,9 @@ func (c *command) gatewayList(cmd *cobra.Command, _ []string) error { if gatewayType == awsEgressPrivateLink { out.Region = gateway.Spec.Config.NetworkingV1AwsEgressPrivateLinkGatewaySpec.GetRegion() } + if gatewayType == awsIngressPrivateLink { + out.Region = gateway.Spec.Config.NetworkingV1AwsIngressPrivateLinkGatewaySpec.GetRegion() + } if gatewayType == awsPeering { out.Region = gateway.Spec.Config.NetworkingV1AwsPeeringGatewaySpec.GetRegion() } @@ -99,6 +102,8 @@ func (c *command) gatewayList(cmd *cobra.Command, _ []string) error { case pcloud.Aws: if gatewayType == "AwsEgressPrivateLink" { out.AwsPrincipalArn = gateway.Status.CloudGateway.NetworkingV1AwsEgressPrivateLinkGatewayStatus.GetPrincipalArn() + } else if gatewayType == "AwsIngressPrivateLink" { + out.VpcEndpointServiceName = gateway.Status.CloudGateway.NetworkingV1AwsIngressPrivateLinkGatewayStatus.GetVpcEndpointServiceName() } else if gatewayType == "AwsPrivateNetworkInterface" { out.Account = gateway.Status.CloudGateway.NetworkingV1AwsPrivateNetworkInterfaceGatewayStatus.GetAccount() } diff --git a/test/fixtures/output/network/access-point/private-link/help.golden b/test/fixtures/output/network/access-point/private-link/help.golden index b877639abd..1fb34c5148 100644 --- a/test/fixtures/output/network/access-point/private-link/help.golden +++ b/test/fixtures/output/network/access-point/private-link/help.golden @@ -4,7 +4,8 @@ Usage: confluent network access-point private-link [command] Available Commands: - egress-endpoint Manage private link egress endpoints. + egress-endpoint Manage private link egress endpoints. + ingress-endpoint Manage private link ingress endpoints. Global Flags: -h, --help Show help for this command. diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws-name.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws-name.golden new file mode 100644 index 0000000000..2e076e4d05 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws-name.golden @@ -0,0 +1,10 @@ ++-------------------------------+---------------------------------------------------------+ +| ID | ap-99999 | +| Name | my-ingress-endpoint | +| Environment | env-596 | +| Gateway | gw-88888 | +| Phase | READY | +| AWS VPC Endpoint ID | vpce-1234567890abcdef0 | +| AWS VPC Endpoint Service Name | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | +| DNS Domain | ap123abc.us-west-2.aws.accesspoint.confluent.cloud | ++-------------------------------+---------------------------------------------------------+ diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws.golden new file mode 100644 index 0000000000..8de2886b3f --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-aws.golden @@ -0,0 +1,9 @@ ++-------------------------------+---------------------------------------------------------+ +| ID | ap-99999 | +| Environment | env-596 | +| Gateway | gw-88888 | +| Phase | READY | +| AWS VPC Endpoint ID | vpce-1234567890abcdef0 | +| AWS VPC Endpoint Service Name | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | +| DNS Domain | ap123abc.us-west-2.aws.accesspoint.confluent.cloud | ++-------------------------------+---------------------------------------------------------+ diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-help.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-help.golden new file mode 100644 index 0000000000..061d179e4a --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/create-help.golden @@ -0,0 +1,22 @@ +Create an ingress endpoint. + +Usage: + confluent network access-point private-link ingress-endpoint create [name] [flags] + +Examples: +Create an AWS PrivateLink ingress endpoint. + + $ confluent network access-point private-link ingress-endpoint create --cloud aws --gateway gw-123456 --vpc-endpoint-id com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 + +Flags: + --cloud string REQUIRED: Specify the cloud provider as "aws", "azure", or "gcp". + --vpc-endpoint-id string REQUIRED: ID of an AWS VPC endpoint. + --gateway string REQUIRED: Gateway ID. + --context string CLI context name. + --environment string Environment ID. + -o, --output string Specify the output format as "human", "json", or "yaml". (default "human") + +Global Flags: + -h, --help Show help for this command. + --unsafe-trace Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets. + -v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace). diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-autocomplete.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-autocomplete.golden new file mode 100644 index 0000000000..ef273e8c24 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-autocomplete.golden @@ -0,0 +1,3 @@ +ap-99999 my-aws-ingress-access-point +:4 +Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-fail.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-fail.golden new file mode 100644 index 0000000000..0bca0ce739 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-fail.golden @@ -0,0 +1,4 @@ +Error: access point "ap-invalid" not found + +Suggestions: + List available access points with `confluent network access-point private-link ingress-endpoint list`. diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-help.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-help.golden new file mode 100644 index 0000000000..1a4bf67e80 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-help.golden @@ -0,0 +1,14 @@ +Delete one or more ingress endpoints. + +Usage: + confluent network access-point private-link ingress-endpoint delete [id-2] ... [id-n] [flags] + +Flags: + --force Skip the deletion confirmation prompt. + --context string CLI context name. + --environment string Environment ID. + +Global Flags: + -h, --help Show help for this command. + --unsafe-trace Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets. + -v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace). diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-multiple.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-multiple.golden new file mode 100644 index 0000000000..185f5c9d80 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete-multiple.golden @@ -0,0 +1 @@ +Are you sure you want to delete access points "ap-99999" and "ap-88888"? (y/n): Requested to delete access points "ap-99999" and "ap-88888". diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete.golden new file mode 100644 index 0000000000..965205b41c --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/delete.golden @@ -0,0 +1 @@ +Are you sure you want to delete access point "ap-88888"? (y/n): Requested to delete access point "ap-88888". diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-autocomplete.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-autocomplete.golden new file mode 100644 index 0000000000..ef273e8c24 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-autocomplete.golden @@ -0,0 +1,3 @@ +ap-99999 my-aws-ingress-access-point +:4 +Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws-json.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws-json.golden new file mode 100644 index 0000000000..8745067043 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws-json.golden @@ -0,0 +1,10 @@ +{ + "id": "ap-99999", + "name": "my-aws-ingress-access-point", + "environment": "env-596", + "gateway": "gw-88888", + "phase": "READY", + "aws_vpc_endpoint_id": "vpce-1234567890abcdef0", + "aws_vpc_endpoint_service_name": "com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000", + "dns_domain": "ap123abc.us-west-2.aws.accesspoint.confluent.cloud" +} diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws.golden new file mode 100644 index 0000000000..31fe1d3c41 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-aws.golden @@ -0,0 +1,10 @@ ++-------------------------------+---------------------------------------------------------+ +| ID | ap-99999 | +| Name | my-aws-ingress-access-point | +| Environment | env-596 | +| Gateway | gw-88888 | +| Phase | READY | +| AWS VPC Endpoint ID | vpce-1234567890abcdef0 | +| AWS VPC Endpoint Service Name | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | +| DNS Domain | ap123abc.us-west-2.aws.accesspoint.confluent.cloud | ++-------------------------------+---------------------------------------------------------+ diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-help.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-help.golden new file mode 100644 index 0000000000..e3a13a62a8 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/describe-help.golden @@ -0,0 +1,19 @@ +Describe an ingress endpoint. + +Usage: + confluent network access-point private-link ingress-endpoint describe [flags] + +Examples: +Describe ingress endpoint "ap-123456". + + $ confluent network access-point private-link ingress-endpoint describe ap-123456 + +Flags: + --context string CLI context name. + --environment string Environment ID. + -o, --output string Specify the output format as "human", "json", or "yaml". (default "human") + +Global Flags: + -h, --help Show help for this command. + --unsafe-trace Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets. + -v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace). diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/help.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/help.golden new file mode 100644 index 0000000000..9ad091c44f --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/help.golden @@ -0,0 +1,18 @@ +Manage private link ingress endpoints. + +Usage: + confluent network access-point private-link ingress-endpoint [command] + +Available Commands: + create Create an ingress endpoint. + delete Delete one or more ingress endpoints. + describe Describe an ingress endpoint. + list List ingress endpoints. + update Update an existing ingress endpoint. + +Global Flags: + -h, --help Show help for this command. + --unsafe-trace Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets. + -v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace). + +Use "confluent network access-point private-link ingress-endpoint [command] --help" for more information about a command. diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list-help.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list-help.golden new file mode 100644 index 0000000000..a59d592c44 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list-help.golden @@ -0,0 +1,15 @@ +List ingress endpoints. + +Usage: + confluent network access-point private-link ingress-endpoint list [flags] + +Flags: + --names strings A comma-separated list of display names. + --context string CLI context name. + --environment string Environment ID. + -o, --output string Specify the output format as "human", "json", or "yaml". (default "human") + +Global Flags: + -h, --help Show help for this command. + --unsafe-trace Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets. + -v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace). diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list-json.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list-json.golden new file mode 100644 index 0000000000..d22b6d3237 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list-json.golden @@ -0,0 +1,12 @@ +[ + { + "id": "ap-99999", + "name": "my-aws-ingress-access-point", + "environment": "env-596", + "gateway": "gw-88888", + "phase": "READY", + "aws_vpc_endpoint_id": "vpce-1234567890abcdef0", + "aws_vpc_endpoint_service_name": "com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000", + "dns_domain": "ap123abc.us-west-2.aws.accesspoint.confluent.cloud" + } +] diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list.golden new file mode 100644 index 0000000000..8c96cff753 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/list.golden @@ -0,0 +1,3 @@ + ID | Name | Environment | Gateway | Phase | AWS VPC Endpoint ID | AWS VPC Endpoint Service Name | DNS Domain +-----------+-----------------------------+-------------+----------+-------+------------------------+---------------------------------------------------------+----------------------------------------------------- + ap-99999 | my-aws-ingress-access-point | env-596 | gw-88888 | READY | vpce-1234567890abcdef0 | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | ap123abc.us-west-2.aws.accesspoint.confluent.cloud diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-autocomplete.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-autocomplete.golden new file mode 100644 index 0000000000..8840fd58b6 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-autocomplete.golden @@ -0,0 +1,4 @@ +--name Name of the ingress endpoint. +ap-99999 my-aws-ingress-access-point +:4 +Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-aws.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-aws.golden new file mode 100644 index 0000000000..b4c5eaa74b --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-aws.golden @@ -0,0 +1,7 @@ ++-------------+---------------------------------+ +| ID | ap-88888 | +| Name | my-new-aws-ingress-access-point | +| Environment | env-596 | +| Gateway | gw-12345 | +| Phase | READY | ++-------------+---------------------------------+ diff --git a/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-help.golden b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-help.golden new file mode 100644 index 0000000000..bfa35fe6e8 --- /dev/null +++ b/test/fixtures/output/network/access-point/private-link/ingress-endpoint/update-help.golden @@ -0,0 +1,20 @@ +Update an existing ingress endpoint. + +Usage: + confluent network access-point private-link ingress-endpoint update [flags] + +Examples: +Update the name of ingress endpoint "ap-123456". + + $ confluent network access-point private-link ingress-endpoint update ap-123456 --name my-new-ingress-endpoint + +Flags: + --name string REQUIRED: Name of the ingress endpoint. + --context string CLI context name. + --environment string Environment ID. + -o, --output string Specify the output format as "human", "json", or "yaml". (default "human") + +Global Flags: + -h, --help Show help for this command. + --unsafe-trace Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets. + -v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace). diff --git a/test/fixtures/output/network/dns/record/create-autocomplete-gateway-flag.golden b/test/fixtures/output/network/dns/record/create-autocomplete-gateway-flag.golden index 4e787c2256..3bae66e233 100644 --- a/test/fixtures/output/network/dns/record/create-autocomplete-gateway-flag.golden +++ b/test/fixtures/output/network/dns/record/create-autocomplete-gateway-flag.golden @@ -5,5 +5,6 @@ gw-67890 my-azure-gateway gw-09876 my-azure-peering-gateway gw-13570 my-gcp-peering-gateway gw-07531 my-gcp-gateway +gw-88888 my-aws-ingress-gateway :4 Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/dns/record/create-autocomplete-private-link-access-point-flag.golden b/test/fixtures/output/network/dns/record/create-autocomplete-private-link-access-point-flag.golden index 4660fff9c6..655d02edbd 100644 --- a/test/fixtures/output/network/dns/record/create-autocomplete-private-link-access-point-flag.golden +++ b/test/fixtures/output/network/dns/record/create-autocomplete-private-link-access-point-flag.golden @@ -2,5 +2,6 @@ ap-12345 my-aws-egress-access-point ap-67890 my-azure-egress-access-point ap-54321 my-aws-private-network-interface-access-point ap-88888 my-gcp-egress-access-point +ap-99999 my-aws-ingress-access-point :4 Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/gateway/create-aws-ingress.golden b/test/fixtures/output/network/gateway/create-aws-ingress.golden new file mode 100644 index 0000000000..49f2ea734d --- /dev/null +++ b/test/fixtures/output/network/gateway/create-aws-ingress.golden @@ -0,0 +1,9 @@ ++---------------------------+---------------------------------------------------------+ +| ID | gw-abc123 | +| Name | my-gateway | +| Environment | env-596 | +| Region | us-west-2 | +| Type | AwsIngressPrivateLink | +| VPC Endpoint Service Name | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | +| Phase | READY | ++---------------------------+---------------------------------------------------------+ diff --git a/test/fixtures/output/network/gateway/create-help.golden b/test/fixtures/output/network/gateway/create-help.golden index 8f4069ccaa..627941565f 100644 --- a/test/fixtures/output/network/gateway/create-help.golden +++ b/test/fixtures/output/network/gateway/create-help.golden @@ -4,17 +4,17 @@ Usage: confluent network gateway create [name] [flags] Examples: -Create network gateway "my-gateway". +Create AWS ingress private link gateway "my-ingress-gateway". - $ confluent network gateway create my-gateway --cloud aws --region us-east-1 --type egress-privatelink + $ confluent network gateway create my-ingress-gateway --cloud aws --region us-east-1 --type ingress-privatelink -Create an AWS private network interface gateway. +Create AWS private network interface gateway "my-pni-gateway". - $ confluent network gateway create --cloud aws --region us-east-1 --type private-network-interface + $ confluent network gateway create my-pni-gateway --cloud aws --region us-east-1 --type private-network-interface Flags: --cloud string REQUIRED: Specify the cloud provider as "aws" or "azure". - --type string REQUIRED: Specify the gateway type as "egress-privatelink" or "private-network-interface". + --type string REQUIRED: Specify the gateway type as "egress-privatelink", "ingress-privatelink", or "private-network-interface". --region string REQUIRED: AWS or Azure region of the gateway. --zones strings A comma-separated list of availability zones for this gateway. --context string CLI context name. diff --git a/test/fixtures/output/network/gateway/create-type-autocomplete.golden b/test/fixtures/output/network/gateway/create-type-autocomplete.golden index 52bf57d458..e05cbe8707 100644 --- a/test/fixtures/output/network/gateway/create-type-autocomplete.golden +++ b/test/fixtures/output/network/gateway/create-type-autocomplete.golden @@ -1,4 +1,5 @@ egress-privatelink +ingress-privatelink private-network-interface :4 Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/gateway/describe-autocomplete.golden b/test/fixtures/output/network/gateway/describe-autocomplete.golden index 4e787c2256..3bae66e233 100644 --- a/test/fixtures/output/network/gateway/describe-autocomplete.golden +++ b/test/fixtures/output/network/gateway/describe-autocomplete.golden @@ -5,5 +5,6 @@ gw-67890 my-azure-gateway gw-09876 my-azure-peering-gateway gw-13570 my-gcp-peering-gateway gw-07531 my-gcp-gateway +gw-88888 my-aws-ingress-gateway :4 Completion ended with directive: ShellCompDirectiveNoFileComp diff --git a/test/fixtures/output/network/gateway/describe-aws-ingress-json.golden b/test/fixtures/output/network/gateway/describe-aws-ingress-json.golden new file mode 100644 index 0000000000..8d7759c35a --- /dev/null +++ b/test/fixtures/output/network/gateway/describe-aws-ingress-json.golden @@ -0,0 +1,9 @@ +{ + "id": "gw-88888", + "name": "my-aws-ingress-gateway", + "environment": "env-596", + "region": "us-west-2", + "type": "AwsIngressPrivateLink", + "vpc_endpoint_service_name": "com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000", + "phase": "READY" +} diff --git a/test/fixtures/output/network/gateway/describe-aws-ingress.golden b/test/fixtures/output/network/gateway/describe-aws-ingress.golden new file mode 100644 index 0000000000..f495e5598d --- /dev/null +++ b/test/fixtures/output/network/gateway/describe-aws-ingress.golden @@ -0,0 +1,9 @@ ++---------------------------+---------------------------------------------------------+ +| ID | gw-88888 | +| Name | my-aws-ingress-gateway | +| Environment | env-596 | +| Region | us-west-2 | +| Type | AwsIngressPrivateLink | +| VPC Endpoint Service Name | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | +| Phase | READY | ++---------------------------+---------------------------------------------------------+ diff --git a/test/fixtures/output/network/gateway/list-help.golden b/test/fixtures/output/network/gateway/list-help.golden index 9765b725e8..a73c5de847 100644 --- a/test/fixtures/output/network/gateway/list-help.golden +++ b/test/fixtures/output/network/gateway/list-help.golden @@ -4,7 +4,7 @@ Usage: confluent network gateway list [flags] Flags: - --types strings A comma-separated list of gateway types: "aws-egress-privatelink", "azure-egress-privatelink", or "gcp-egress-private-service-connect". + --types strings A comma-separated list of gateway types: "aws-egress-privatelink", "aws-ingress-privatelink", "azure-egress-privatelink", or "gcp-egress-private-service-connect". --context string CLI context name. --environment string Environment ID. -o, --output string Specify the output format as "human", "json", or "yaml". (default "human") diff --git a/test/fixtures/output/network/gateway/list-json.golden b/test/fixtures/output/network/gateway/list-json.golden index 25065ffc64..67348d8d88 100644 --- a/test/fixtures/output/network/gateway/list-json.golden +++ b/test/fixtures/output/network/gateway/list-json.golden @@ -60,5 +60,14 @@ "type": "AzureEgressPrivateLink", "azure_subscription": "aa000000-a000-0a00-00aa-0000aaa0a0a0", "phase": "READY" + }, + { + "id": "gw-88888", + "name": "my-aws-ingress-gateway", + "environment": "env-596", + "region": "us-west-2", + "type": "AwsIngressPrivateLink", + "vpc_endpoint_service_name": "com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000", + "phase": "READY" } ] diff --git a/test/fixtures/output/network/gateway/list.golden b/test/fixtures/output/network/gateway/list.golden index 1868a3f8ea..1f164638dc 100644 --- a/test/fixtures/output/network/gateway/list.golden +++ b/test/fixtures/output/network/gateway/list.golden @@ -1,9 +1,10 @@ - ID | Name | Environment | Region | Type | AWS Principal ARN | Azure Subscription | GCP IAM Principal | GCP Project | Phase | Zones | Account | Error Message ------------+--------------------------+-------------+-----------+--------------------------------+--------------------------------+--------------------------------------+-------------------------------------+---------------+-------+------------------------+--------------+---------------- - gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateServiceConnect | | | | project-12345 | READY | | | - gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | READY | | | - gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | READY | | | - gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | READY | | | - gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | READY | us-east-2a, us-east-2b | 000000000000 | - gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | READY | | | - gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | + ID | Name | Environment | Region | Type | AWS Principal ARN | VPC Endpoint Service Name | Azure Subscription | GCP IAM Principal | GCP Project | Phase | Zones | Account | Error Message +-----------+--------------------------+-------------+-----------+--------------------------------+--------------------------------+---------------------------------------------------------+--------------------------------------+-------------------------------------+---------------+-------+------------------------+--------------+---------------- + gw-07531 | my-gcp-gateway | env-596 | eastus | GcpEgressPrivateServiceConnect | | | | | project-12345 | READY | | | + gw-09876 | my-azure-peering-gateway | env-596 | eastus2 | AzurePeering | | | | | | READY | | | + gw-12345 | my-aws-gateway | env-596 | us-east-1 | AwsEgressPrivateLink | arn:aws:iam::123456789012:role | | | | | READY | | | + gw-13570 | my-gcp-peering-gateway | env-596 | eastus2 | GcpPeering | | | | g000000-a000-0a00-00aa-0000aaa0a0a0 | | READY | | | + gw-23456 | my-aws-gateway | env-596 | us-east-2 | AwsPrivateNetworkInterface | | | | | | READY | us-east-2a, us-east-2b | 000000000000 | + gw-54321 | my-aws-peering-gateway | env-596 | us-east-2 | AwsPeering | | | | | | READY | | | + gw-67890 | my-azure-gateway | env-596 | eastus | AzureEgressPrivateLink | | | aa000000-a000-0a00-00aa-0000aaa0a0a0 | | | READY | | | + gw-88888 | my-aws-ingress-gateway | env-596 | us-west-2 | AwsIngressPrivateLink | | com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000 | | | | READY | | | diff --git a/test/network_test.go b/test/network_test.go index 57efc2db79..ff34b28b90 100644 --- a/test/network_test.go +++ b/test/network_test.go @@ -123,6 +123,7 @@ func (s *CLITestSuite) TestNetwork_Autocomplete() { func (s *CLITestSuite) TestNetworkGateway() { tests := []CLITest{ {args: "network gateway create my-gateway --cloud aws --type egress-privatelink --region us-west-2", fixture: "network/gateway/create-aws.golden"}, + {args: "network gateway create my-gateway --cloud aws --type ingress-privatelink --region us-west-2", fixture: "network/gateway/create-aws-ingress.golden"}, {args: "network gateway create my-gateway --cloud aws --type private-network-interface --region us-west-2 --zones us-west-2a,us-west-2b", fixture: "network/gateway/create-aws-private-network-interface.golden"}, {args: "network gateway update gw-111111 --name new-name", fixture: "network/gateway/update.golden"}, {args: "network gateway delete gw-12345", input: "y\n", fixture: "network/gateway/delete.golden"}, @@ -140,10 +141,12 @@ func (s *CLITestSuite) TestNetworkGatewayDescribe() { tests := []CLITest{ {args: "network gateway describe gw-12345", fixture: "network/gateway/describe-aws.golden"}, {args: "network gateway describe gw-54321", fixture: "network/gateway/describe-aws-private-network-interface.golden"}, + {args: "network gateway describe gw-88888", fixture: "network/gateway/describe-aws-ingress.golden"}, {args: "network gateway describe gw-13570", fixture: "network/gateway/describe-gcp-dns-peering.golden"}, {args: "network gateway describe gw-07531", fixture: "network/gateway/describe-gcp.golden"}, {args: "network gateway describe gw-67890", fixture: "network/gateway/describe-azure.golden"}, {args: "network gateway describe gw-12345 --output json", fixture: "network/gateway/describe-aws-json.golden"}, + {args: "network gateway describe gw-88888 --output json", fixture: "network/gateway/describe-aws-ingress-json.golden"}, } for _, test := range tests { @@ -1156,6 +1159,59 @@ func (s *CLITestSuite) TestNetworkAccessPointPrivateLinkEgressEndpoint_Autocompl } } +func (s *CLITestSuite) TestNetworkAccessPointPrivateLinkIngressEndpoint() { + tests := []CLITest{ + {args: "network access-point private-link ingress-endpoint create --cloud aws --gateway gw-88888 --vpc-endpoint-id vpce-1234567890abcdef0", fixture: "network/access-point/private-link/ingress-endpoint/create-aws.golden"}, + {args: "network access-point private-link ingress-endpoint create my-ingress-endpoint --cloud aws --gateway gw-88888 --vpc-endpoint-id vpce-1234567890abcdef0", fixture: "network/access-point/private-link/ingress-endpoint/create-aws-name.golden"}, + {args: "network access-point private-link ingress-endpoint update ap-88888 --name my-new-aws-ingress-access-point", fixture: "network/access-point/private-link/ingress-endpoint/update-aws.golden"}, + {args: "network access-point private-link ingress-endpoint delete ap-88888", input: "y\n", fixture: "network/access-point/private-link/ingress-endpoint/delete.golden"}, + {args: "network access-point private-link ingress-endpoint delete ap-99999 ap-88888", input: "y\n", fixture: "network/access-point/private-link/ingress-endpoint/delete-multiple.golden"}, + {args: "network access-point private-link ingress-endpoint delete ap-invalid", fixture: "network/access-point/private-link/ingress-endpoint/delete-fail.golden", exitCode: 1}, + } + + for _, test := range tests { + test.login = "cloud" + s.runIntegrationTest(test) + } +} + +func (s *CLITestSuite) TestNetworkAccessPointPrivateLinkIngressEndpointDescribe() { + tests := []CLITest{ + {args: "network access-point private-link ingress-endpoint describe ap-99999", fixture: "network/access-point/private-link/ingress-endpoint/describe-aws.golden"}, + {args: "network access-point private-link ingress-endpoint describe ap-99999 --output json", fixture: "network/access-point/private-link/ingress-endpoint/describe-aws-json.golden"}, + } + + for _, test := range tests { + test.login = "cloud" + s.runIntegrationTest(test) + } +} + +func (s *CLITestSuite) TestNetworkAccessPointPrivateLinkIngressEndpointList() { + tests := []CLITest{ + {args: "network access-point private-link ingress-endpoint list", fixture: "network/access-point/private-link/ingress-endpoint/list.golden"}, + {args: "network access-point private-link ingress-endpoint list --output json", fixture: "network/access-point/private-link/ingress-endpoint/list-json.golden"}, + } + + for _, test := range tests { + test.login = "cloud" + s.runIntegrationTest(test) + } +} + +func (s *CLITestSuite) TestNetworkAccessPointPrivateLinkIngressEndpoint_Autocomplete() { + tests := []CLITest{ + {args: `__complete network access-point private-link ingress-endpoint describe ""`, login: "cloud", fixture: "network/access-point/private-link/ingress-endpoint/describe-autocomplete.golden"}, + {args: `__complete network access-point private-link ingress-endpoint delete ""`, login: "cloud", fixture: "network/access-point/private-link/ingress-endpoint/delete-autocomplete.golden"}, + {args: `__complete network access-point private-link ingress-endpoint update ""`, login: "cloud", fixture: "network/access-point/private-link/ingress-endpoint/update-autocomplete.golden"}, + } + + for _, test := range tests { + test.login = "cloud" + s.runIntegrationTest(test) + } +} + func (s *CLITestSuite) TestNetworkAccessPointPrivateNetworkInterfaceDelete() { tests := []CLITest{ {args: "network access-point private-network-interface delete ap-54321", input: "y\n", fixture: "network/access-point/private-network-interface/delete.golden"}, diff --git a/test/test-server/networking_handlers.go b/test/test-server/networking_handlers.go index 3f47d71b3f..8d2d130cf3 100644 --- a/test/test-server/networking_handlers.go +++ b/test/test-server/networking_handlers.go @@ -2355,6 +2355,11 @@ func getGateway(id, environment, name, specConfigKind, statusCloudGatewayKind st Kind: specConfigKind, Region: "us-east-1", })) + case "AwsIngressPrivateLinkGatewaySpec": + gateway.Spec.SetConfig(networkinggatewayv1.NetworkingV1AwsIngressPrivateLinkGatewaySpecAsNetworkingV1GatewaySpecConfigOneOf(&networkinggatewayv1.NetworkingV1AwsIngressPrivateLinkGatewaySpec{ + Kind: specConfigKind, + Region: "us-west-2", + })) case "AwsPeeringGatewaySpec": gateway.Spec.SetConfig(networkinggatewayv1.NetworkingV1AwsPeeringGatewaySpecAsNetworkingV1GatewaySpecConfigOneOf(&networkinggatewayv1.NetworkingV1AwsPeeringGatewaySpec{ Kind: specConfigKind, @@ -2394,6 +2399,11 @@ func getGateway(id, environment, name, specConfigKind, statusCloudGatewayKind st Kind: statusCloudGatewayKind, PrincipalArn: networkinggatewayv1.PtrString("arn:aws:iam::123456789012:role"), })) + case "AwsIngressPrivateLinkGatewayStatus": + gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1AwsIngressPrivateLinkGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1AwsIngressPrivateLinkGatewayStatus{ + Kind: statusCloudGatewayKind, + VpcEndpointServiceName: networkinggatewayv1.PtrString("com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000"), + })) case "AwsPrivateNetworkInterfaceGatewayStatus": gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1AwsPrivateNetworkInterfaceGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1AwsPrivateNetworkInterfaceGatewayStatus{ Kind: statusCloudGatewayKind, @@ -2446,6 +2456,10 @@ func handleNetworkingGatewayGet(t *testing.T, id, environment string) http.Handl record := getGateway(id, environment, "my-gcp-gateway", "GcpEgressPrivateServiceConnectGatewaySpec", "GcpEgressPrivateServiceConnectGatewayStatus") err := json.NewEncoder(w).Encode(record) require.NoError(t, err) + case "gw-88888": + record := getGateway(id, environment, "my-aws-ingress-gateway", "AwsIngressPrivateLinkGatewaySpec", "AwsIngressPrivateLinkGatewayStatus") + err := json.NewEncoder(w).Encode(record) + require.NoError(t, err) } } } @@ -2479,6 +2493,11 @@ func handleNetworkingGatewayPost(t *testing.T) http.HandlerFunc { Kind: "AwsEgressPrivateLinkGatewayStatus", PrincipalArn: networkingv1.PtrString("arn:aws:iam::123456789012:role"), })) + } else if body.Spec.Config.NetworkingV1AwsIngressPrivateLinkGatewaySpec != nil { + gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1AwsIngressPrivateLinkGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1AwsIngressPrivateLinkGatewayStatus{ + Kind: "AwsIngressPrivateLinkGatewayStatus", + VpcEndpointServiceName: networkingv1.PtrString("com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000"), + })) } else if body.Spec.Config.NetworkingV1AwsPrivateNetworkInterfaceGatewaySpec != nil { gateway.Status.SetCloudGateway(networkinggatewayv1.NetworkingV1AwsPrivateNetworkInterfaceGatewayStatusAsNetworkingV1GatewayStatusCloudGatewayOneOf(&networkinggatewayv1.NetworkingV1AwsPrivateNetworkInterfaceGatewayStatus{ Kind: "AwsPrivateNetworkInterfaceGatewayStatus", @@ -2515,8 +2534,9 @@ func handleNetworkingGatewayList(t *testing.T, environment string) http.HandlerF gatewayFive := getGateway("gw-09876", environment, "my-azure-peering-gateway", "AzurePeeringGatewaySpec", "") gatewaySix := getGateway("gw-13570", environment, "my-gcp-peering-gateway", "GcpPeeringGatewaySpec", "GcpPeeringGatewayStatus") gatewaySeven := getGateway("gw-07531", environment, "my-gcp-gateway", "GcpEgressPrivateServiceConnectGatewaySpec", "GcpEgressPrivateServiceConnectGatewayStatus") + gatewayEight := getGateway("gw-88888", environment, "my-aws-ingress-gateway", "AwsIngressPrivateLinkGatewaySpec", "AwsIngressPrivateLinkGatewayStatus") - recordList := networkinggatewayv1.NetworkingV1GatewayList{Data: []networkinggatewayv1.NetworkingV1Gateway{gatewayOne, gatewayTwo, gatewayThree, gatewayFour, gatewayFive, gatewaySix, gatewaySeven}} + recordList := networkinggatewayv1.NetworkingV1GatewayList{Data: []networkinggatewayv1.NetworkingV1Gateway{gatewayOne, gatewayTwo, gatewayThree, gatewayFour, gatewayFive, gatewaySix, gatewaySeven, gatewayEight}} setPageToken(&recordList, &recordList.Metadata, r.URL) err := json.NewEncoder(w).Encode(recordList) require.NoError(t, err) @@ -2932,6 +2952,34 @@ func getGcpEgressAccessPoint(id, environment, name string) networkingaccesspoint } } +func getAwsIngressAccessPoint(id, environment, name string) networkingaccesspointv1.NetworkingV1AccessPoint { + return networkingaccesspointv1.NetworkingV1AccessPoint{ + Id: networkingaccesspointv1.PtrString(id), + Spec: &networkingaccesspointv1.NetworkingV1AccessPointSpec{ + DisplayName: networkingaccesspointv1.PtrString(name), + Config: &networkingaccesspointv1.NetworkingV1AccessPointSpecConfigOneOf{ + NetworkingV1AwsIngressPrivateLinkEndpoint: &networkingaccesspointv1.NetworkingV1AwsIngressPrivateLinkEndpoint{ + Kind: "AwsIngressPrivateLinkEndpoint", + VpcEndpointId: "vpce-1234567890abcdef0", + }, + }, + Environment: &networkingaccesspointv1.ObjectReference{Id: environment}, + Gateway: &networkingaccesspointv1.ObjectReference{Id: "gw-88888"}, + }, + Status: &networkingaccesspointv1.NetworkingV1AccessPointStatus{ + Phase: "READY", + Config: &networkingaccesspointv1.NetworkingV1AccessPointStatusConfigOneOf{ + NetworkingV1AwsIngressPrivateLinkEndpointStatus: &networkingaccesspointv1.NetworkingV1AwsIngressPrivateLinkEndpointStatus{ + Kind: "AwsIngressPrivateLinkEndpointStatus", + VpcEndpointId: "vpce-1234567890abcdef0", + VpcEndpointServiceName: "com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000", + DnsDomain: networkingaccesspointv1.PtrString("ap123abc.us-west-2.aws.accesspoint.confluent.cloud"), + }, + }, + }, + } +} + func handleNetworkingAccessPointGet(t *testing.T, id, environment string) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var accessPoint networkingaccesspointv1.NetworkingV1AccessPoint @@ -2946,6 +2994,8 @@ func handleNetworkingAccessPointGet(t *testing.T, id, environment string) http.H accessPoint = getAzureEgressAccessPoint(id, environment, "my-azure-egress-access-point") case "ap-88888": accessPoint = getGcpEgressAccessPoint(id, environment, "my-gcp-egress-access-point") + case "ap-99999": + accessPoint = getAwsIngressAccessPoint(id, environment, "my-aws-ingress-access-point") } err := json.NewEncoder(w).Encode(accessPoint) require.NoError(t, err) @@ -2977,6 +3027,8 @@ func handleNetworkingAccessPointUpdate(t *testing.T, id string) http.HandlerFunc accessPoint = getAzureEgressAccessPoint(id, body.Spec.Environment.GetId(), "my-azure-egress-access-point") case "ap-88888": accessPoint = getGcpEgressAccessPoint(id, body.Spec.Environment.GetId(), "my-gcp-egress-access-point") + case "ap-99999": + accessPoint = getAwsIngressAccessPoint(id, body.Spec.Environment.GetId(), "my-aws-ingress-access-point") } accessPoint.Spec.SetDisplayName(body.Spec.GetDisplayName()) @@ -2992,8 +3044,9 @@ func handleNetworkingAccessPointList(t *testing.T, environment string) http.Hand accessPointTwo := getAzureEgressAccessPoint("ap-67890", environment, "my-azure-egress-access-point") accessPointThree := getAwsPrivateNetworkInterfaceAccessPoint("ap-54321", environment, "my-aws-private-network-interface-access-point") accessPointFour := getGcpEgressAccessPoint("ap-88888", environment, "my-gcp-egress-access-point") + accessPointFive := getAwsIngressAccessPoint("ap-99999", environment, "my-aws-ingress-access-point") - recordList := networkingaccesspointv1.NetworkingV1AccessPointList{Data: []networkingaccesspointv1.NetworkingV1AccessPoint{accessPointOne, accessPointTwo, accessPointThree, accessPointFour}} + recordList := networkingaccesspointv1.NetworkingV1AccessPointList{Data: []networkingaccesspointv1.NetworkingV1AccessPoint{accessPointOne, accessPointTwo, accessPointThree, accessPointFour, accessPointFive}} setPageToken(&recordList, &recordList.Metadata, r.URL) err := json.NewEncoder(w).Encode(recordList) require.NoError(t, err) @@ -3018,6 +3071,19 @@ func handleNetworkingAccessPointCreate(t *testing.T) http.HandlerFunc { }, }, } + } else if accessPoint.Spec.Config.NetworkingV1AwsIngressPrivateLinkEndpoint != nil { + accessPoint.SetId("ap-99999") + accessPoint.Status = &networkingaccesspointv1.NetworkingV1AccessPointStatus{ + Phase: "READY", + Config: &networkingaccesspointv1.NetworkingV1AccessPointStatusConfigOneOf{ + NetworkingV1AwsIngressPrivateLinkEndpointStatus: &networkingaccesspointv1.NetworkingV1AwsIngressPrivateLinkEndpointStatus{ + Kind: "AwsIngressPrivateLinkEndpointStatus", + VpcEndpointId: "vpce-1234567890abcdef0", + VpcEndpointServiceName: "com.amazonaws.vpce.us-west-2.vpce-svc-00000000000000000", + DnsDomain: networkingaccesspointv1.PtrString("ap123abc.us-west-2.aws.accesspoint.confluent.cloud"), + }, + }, + } } else if accessPoint.Spec.Config.NetworkingV1AwsPrivateNetworkInterface != nil { accessPoint.SetId("ap-54321") accessPoint.Status = &networkingaccesspointv1.NetworkingV1AccessPointStatus{