# IpAddressType

IP address types supported for VPC endpoint service.

- Source: [`aws-ec2/lib/vpc-endpoint-service.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ec2/lib/vpc-endpoint-service.ts#L21)
- Type last changed: v2.186.0 · 27 Mar 2025

## Example

TypeScript:

```ts
declare const networkLoadBalancer: elbv2.NetworkLoadBalancer;

new ec2.VpcEndpointService(this, 'EndpointService', {
  vpcEndpointServiceLoadBalancers: [networkLoadBalancer],
  // Support both IPv4 and IPv6 connections to the endpoint service
  supportedIpAddressTypes: [
    ec2.IpAddressType.IPV4,
    ec2.IpAddressType.IPV6,
  ],
});
```

Python:

```python
# network_load_balancer: elbv2.NetworkLoadBalancer

ec2.VpcEndpointService(self, "EndpointService",
    vpc_endpoint_service_load_balancers=[network_load_balancer],
    # Support both IPv4 and IPv6 connections to the endpoint service
    supported_ip_address_types=[ec2.IpAddressType.IPV4, ec2.IpAddressType.IPV6
    ]
)
```

Java:

```java
NetworkLoadBalancer networkLoadBalancer;

VpcEndpointService.Builder.create(this, "EndpointService")
        .vpcEndpointServiceLoadBalancers(List.of(networkLoadBalancer))
        // Support both IPv4 and IPv6 connections to the endpoint service
        .supportedIpAddressTypes(List.of(IpAddressType.IPV4, IpAddressType.IPV6))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
NetworkLoadBalancer networkLoadBalancer;

new VpcEndpointService(this, "EndpointService", new VpcEndpointServiceProps {
    VpcEndpointServiceLoadBalancers = new [] { networkLoadBalancer },
    // Support both IPv4 and IPv6 connections to the endpoint service
    SupportedIpAddressTypes = new [] { IpAddressType.IPV4, IpAddressType.IPV6 }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var networkLoadBalancer NetworkLoadBalancer

ec2.NewVpcEndpointService(this, jsii.String("EndpointService"), &VpcEndpointServiceProps{
	VpcEndpointServiceLoadBalancers: []IVpcEndpointServiceLoadBalancer{
		networkLoadBalancer,
	},
	// Support both IPv4 and IPv6 connections to the endpoint service
	SupportedIpAddressTypes: []IpAddressType{
		ec2.IpAddressType_IPV4,
		ec2.IpAddressType_IPV6,
	},
})
```

## Members

| Member | Description |
| --- | --- |
| `IPV4` | ipv4 address type. |
| `IPV6` | ipv6 address type. |

## Referenced by

- [`VpcEndpointServiceProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.VpcEndpointServiceProps.html).supportedIpAddressTypes
