VpcEndpointArgs

data class VpcEndpointArgs(val autoAccept: Output<Boolean>? = null, val dnsOptions: Output<VpcEndpointDnsOptionsArgs>? = null, val ipAddressType: Output<String>? = null, val policy: Output<String>? = null, val privateDnsEnabled: Output<Boolean>? = null, val routeTableIds: Output<List<String>>? = null, val securityGroupIds: Output<List<String>>? = null, val serviceName: Output<String>? = null, val subnetIds: Output<List<String>>? = null, val tags: Output<Map<String, String>>? = null, val vpcEndpointType: Output<String>? = null, val vpcId: Output<String>? = null) : ConvertibleToJava<VpcEndpointArgs>

Provides a VPC Endpoint resource.

NOTE on VPC Endpoints and VPC Endpoint Associations: The provider provides both standalone VPC Endpoint Associations for Route Tables - (an association between a VPC endpoint and a single route_table_id), Security Groups - (an association between a VPC endpoint and a single security_group_id), and Subnets - (an association between a VPC endpoint and a single subnet_id) and a VPC Endpoint resource with route_table_ids and subnet_ids attributes. Do not use the same resource ID in both a VPC Endpoint resource and a VPC Endpoint Association resource. Doing so will cause a conflict of associations and will overwrite the association.

Example Usage

Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.VpcEndpoint;
import com.pulumi.aws.ec2.VpcEndpointArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var s3 = new VpcEndpoint("s3", VpcEndpointArgs.builder()
.vpcId(aws_vpc.main().id())
.serviceName("com.amazonaws.us-west-2.s3")
.build());
}
}

Basic w/ Tags

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.VpcEndpoint;
import com.pulumi.aws.ec2.VpcEndpointArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var s3 = new VpcEndpoint("s3", VpcEndpointArgs.builder()
.vpcId(aws_vpc.main().id())
.serviceName("com.amazonaws.us-west-2.s3")
.tags(Map.of("Environment", "test"))
.build());
}
}

Interface Endpoint Type

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.VpcEndpoint;
import com.pulumi.aws.ec2.VpcEndpointArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var ec2 = new VpcEndpoint("ec2", VpcEndpointArgs.builder()
.vpcId(aws_vpc.main().id())
.serviceName("com.amazonaws.us-west-2.ec2")
.vpcEndpointType("Interface")
.securityGroupIds(aws_security_group.sg1().id())
.privateDnsEnabled(true)
.build());
}
}

Gateway Load Balancer Endpoint Type

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.ec2.VpcEndpointService;
import com.pulumi.aws.ec2.VpcEndpointServiceArgs;
import com.pulumi.aws.ec2.VpcEndpoint;
import com.pulumi.aws.ec2.VpcEndpointArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var current = AwsFunctions.getCallerIdentity();
var exampleVpcEndpointService = new VpcEndpointService("exampleVpcEndpointService", VpcEndpointServiceArgs.builder()
.acceptanceRequired(false)
.allowedPrincipals(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.arn()))
.gatewayLoadBalancerArns(aws_lb.example().arn())
.build());
var exampleVpcEndpoint = new VpcEndpoint("exampleVpcEndpoint", VpcEndpointArgs.builder()
.serviceName(exampleVpcEndpointService.serviceName())
.subnetIds(aws_subnet.example().id())
.vpcEndpointType(exampleVpcEndpointService.serviceType())
.vpcId(aws_vpc.example().id())
.build());
}
}

Import

VPC Endpoints can be imported using the vpc endpoint id, e.g.,

$ pulumi import aws:ec2/vpcEndpoint:VpcEndpoint endpoint1 vpce-3ecf2a57

Constructors

Link copied to clipboard
constructor(autoAccept: Output<Boolean>? = null, dnsOptions: Output<VpcEndpointDnsOptionsArgs>? = null, ipAddressType: Output<String>? = null, policy: Output<String>? = null, privateDnsEnabled: Output<Boolean>? = null, routeTableIds: Output<List<String>>? = null, securityGroupIds: Output<List<String>>? = null, serviceName: Output<String>? = null, subnetIds: Output<List<String>>? = null, tags: Output<Map<String, String>>? = null, vpcEndpointType: Output<String>? = null, vpcId: Output<String>? = null)

Properties

Link copied to clipboard
val autoAccept: Output<Boolean>? = null

Accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account).

Link copied to clipboard

The DNS options for the endpoint. See dns_options below.

Link copied to clipboard
val ipAddressType: Output<String>? = null

The IP address type for the endpoint. Valid values are ipv4, dualstack, and ipv6.

Link copied to clipboard
val policy: Output<String>? = null

A policy to attach to the endpoint that controls access to the service. This is a JSON formatted string. Defaults to full access. All Gateway and some Interface endpoints support policies - see the relevant AWS documentation for more details.

Link copied to clipboard
val privateDnsEnabled: Output<Boolean>? = null

Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type Interface. Defaults to false.

Link copied to clipboard
val routeTableIds: Output<List<String>>? = null

One or more route table IDs. Applicable for endpoints of type Gateway.

Link copied to clipboard
val securityGroupIds: Output<List<String>>? = null

The ID of one or more security groups to associate with the network interface. Applicable for endpoints of type Interface. If no security groups are specified, the VPC's default security group is associated with the endpoint.

Link copied to clipboard
val serviceName: Output<String>? = null

The service name. For AWS services the service name is usually in the form com.amazonaws.<region>.<service> (the SageMaker Notebook service is an exception to this rule, the service name is in the form aws.sagemaker.<region>.notebook).

Link copied to clipboard
val subnetIds: Output<List<String>>? = null

The ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type GatewayLoadBalancer and Interface.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val vpcEndpointType: Output<String>? = null

The VPC endpoint type, Gateway, GatewayLoadBalancer, or Interface. Defaults to Gateway.

Link copied to clipboard
val vpcId: Output<String>? = null

The ID of the VPC in which the endpoint will be used.

Functions

Link copied to clipboard
open override fun toJava(): VpcEndpointArgs