# EndpointConfiguration

The endpoint configuration of a REST API, including VPCs and endpoint types.

EndpointConfiguration is a property of the AWS::ApiGateway::RestApi resource.

- Source: [`aws-apigateway/lib/restapi.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts#L1127)
- Type last changed: v2.195.0 · 7 May 2025

## Example

TypeScript:

```ts
declare const someEndpoint: ec2.IVpcEndpoint;

const api = new apigateway.RestApi(this, 'api', {
  endpointConfiguration: {
    types: [ apigateway.EndpointType.PRIVATE ],
    vpcEndpoints: [ someEndpoint ]
  }
});
```

Python:

```python
# some_endpoint: ec2.IVpcEndpoint

api = apigateway.RestApi(self, "api",
    endpoint_configuration=apigateway.EndpointConfiguration(
        types=[apigateway.EndpointType.PRIVATE],
        vpc_endpoints=[some_endpoint]
    )
)
```

Java:

```java
IVpcEndpoint someEndpoint;

RestApi api = RestApi.Builder.create(this, "api")
        .endpointConfiguration(EndpointConfiguration.builder()
                .types(List.of(EndpointType.PRIVATE))
                .vpcEndpoints(List.of(someEndpoint))
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
IVpcEndpoint someEndpoint;

var api = new RestApi(this, "api", new RestApiProps {
    EndpointConfiguration = new EndpointConfiguration {
        Types = new [] { EndpointType.PRIVATE },
        VpcEndpoints = new [] { someEndpoint }
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var someEndpoint IVpcEndpoint

api := apigateway.NewRestApi(this, jsii.String("api"), &RestApiProps{
	EndpointConfiguration: &EndpointConfiguration{
		Types: []EndpointType{
			apigateway.EndpointType_PRIVATE,
		},
		VpcEndpoints: []IVpcEndpoint{
			someEndpoint,
		},
	},
})
```

## Properties

- `ipAddressType`: [IpAddressType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IpAddressType.html) — The IP address types that can invoke the API.

  **Default:** undefined - AWS default is DUAL_STACK for private API, IPV4 for all other APIs.

- `types`: [EndpointType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.EndpointType.html)[] (required) = EndpointType.EDGE — A list of endpoint types of an API or its custom domain name.

- `vpcEndpoints`: [IVpcEndpoint](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpcEndpoint.html)[] — A list of VPC Endpoints against which to create Route53 ALIASes.

  **Default:** no ALIASes are created for the endpoint.
