1. Packages
  2. AWS
  3. API Docs
  4. opensearch
  5. VpcEndpoint
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.opensearch.VpcEndpoint

Explore with Pulumi AI

Manages an AWS Opensearch VPC Endpoint. Creates an Amazon OpenSearch Service-managed VPC endpoint.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const foo = new aws.opensearch.VpcEndpoint("foo", {
    domainArn: domain1.arn,
    vpcOptions: {
        securityGroupIds: [
            test.id,
            test2.id,
        ],
        subnetIds: [
            testAwsSubnet.id,
            test2AwsSubnet.id,
        ],
    },
});
Copy
import pulumi
import pulumi_aws as aws

foo = aws.opensearch.VpcEndpoint("foo",
    domain_arn=domain1["arn"],
    vpc_options={
        "security_group_ids": [
            test["id"],
            test2["id"],
        ],
        "subnet_ids": [
            test_aws_subnet["id"],
            test2_aws_subnet["id"],
        ],
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := opensearch.NewVpcEndpoint(ctx, "foo", &opensearch.VpcEndpointArgs{
			DomainArn: pulumi.Any(domain1.Arn),
			VpcOptions: &opensearch.VpcEndpointVpcOptionsArgs{
				SecurityGroupIds: pulumi.StringArray{
					test.Id,
					test2.Id,
				},
				SubnetIds: pulumi.StringArray{
					testAwsSubnet.Id,
					test2AwsSubnet.Id,
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var foo = new Aws.OpenSearch.VpcEndpoint("foo", new()
    {
        DomainArn = domain1.Arn,
        VpcOptions = new Aws.OpenSearch.Inputs.VpcEndpointVpcOptionsArgs
        {
            SecurityGroupIds = new[]
            {
                test.Id,
                test2.Id,
            },
            SubnetIds = new[]
            {
                testAwsSubnet.Id,
                test2AwsSubnet.Id,
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.opensearch.VpcEndpoint;
import com.pulumi.aws.opensearch.VpcEndpointArgs;
import com.pulumi.aws.opensearch.inputs.VpcEndpointVpcOptionsArgs;
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 foo = new VpcEndpoint("foo", VpcEndpointArgs.builder()
            .domainArn(domain1.arn())
            .vpcOptions(VpcEndpointVpcOptionsArgs.builder()
                .securityGroupIds(                
                    test.id(),
                    test2.id())
                .subnetIds(                
                    testAwsSubnet.id(),
                    test2AwsSubnet.id())
                .build())
            .build());

    }
}
Copy
resources:
  foo:
    type: aws:opensearch:VpcEndpoint
    properties:
      domainArn: ${domain1.arn}
      vpcOptions:
        securityGroupIds:
          - ${test.id}
          - ${test2.id}
        subnetIds:
          - ${testAwsSubnet.id}
          - ${test2AwsSubnet.id}
Copy

Create VpcEndpoint Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new VpcEndpoint(name: string, args: VpcEndpointArgs, opts?: CustomResourceOptions);
@overload
def VpcEndpoint(resource_name: str,
                args: VpcEndpointArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def VpcEndpoint(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                domain_arn: Optional[str] = None,
                vpc_options: Optional[VpcEndpointVpcOptionsArgs] = None)
func NewVpcEndpoint(ctx *Context, name string, args VpcEndpointArgs, opts ...ResourceOption) (*VpcEndpoint, error)
public VpcEndpoint(string name, VpcEndpointArgs args, CustomResourceOptions? opts = null)
public VpcEndpoint(String name, VpcEndpointArgs args)
public VpcEndpoint(String name, VpcEndpointArgs args, CustomResourceOptions options)
type: aws:opensearch:VpcEndpoint
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. VpcEndpointArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. VpcEndpointArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. VpcEndpointArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. VpcEndpointArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. VpcEndpointArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var examplevpcEndpointResourceResourceFromOpensearchvpcEndpoint = new Aws.OpenSearch.VpcEndpoint("examplevpcEndpointResourceResourceFromOpensearchvpcEndpoint", new()
{
    DomainArn = "string",
    VpcOptions = new Aws.OpenSearch.Inputs.VpcEndpointVpcOptionsArgs
    {
        SubnetIds = new[]
        {
            "string",
        },
        AvailabilityZones = new[]
        {
            "string",
        },
        SecurityGroupIds = new[]
        {
            "string",
        },
        VpcId = "string",
    },
});
Copy
example, err := opensearch.NewVpcEndpoint(ctx, "examplevpcEndpointResourceResourceFromOpensearchvpcEndpoint", &opensearch.VpcEndpointArgs{
	DomainArn: pulumi.String("string"),
	VpcOptions: &opensearch.VpcEndpointVpcOptionsArgs{
		SubnetIds: pulumi.StringArray{
			pulumi.String("string"),
		},
		AvailabilityZones: pulumi.StringArray{
			pulumi.String("string"),
		},
		SecurityGroupIds: pulumi.StringArray{
			pulumi.String("string"),
		},
		VpcId: pulumi.String("string"),
	},
})
Copy
var examplevpcEndpointResourceResourceFromOpensearchvpcEndpoint = new VpcEndpoint("examplevpcEndpointResourceResourceFromOpensearchvpcEndpoint", VpcEndpointArgs.builder()
    .domainArn("string")
    .vpcOptions(VpcEndpointVpcOptionsArgs.builder()
        .subnetIds("string")
        .availabilityZones("string")
        .securityGroupIds("string")
        .vpcId("string")
        .build())
    .build());
Copy
examplevpc_endpoint_resource_resource_from_opensearchvpc_endpoint = aws.opensearch.VpcEndpoint("examplevpcEndpointResourceResourceFromOpensearchvpcEndpoint",
    domain_arn="string",
    vpc_options={
        "subnet_ids": ["string"],
        "availability_zones": ["string"],
        "security_group_ids": ["string"],
        "vpc_id": "string",
    })
Copy
const examplevpcEndpointResourceResourceFromOpensearchvpcEndpoint = new aws.opensearch.VpcEndpoint("examplevpcEndpointResourceResourceFromOpensearchvpcEndpoint", {
    domainArn: "string",
    vpcOptions: {
        subnetIds: ["string"],
        availabilityZones: ["string"],
        securityGroupIds: ["string"],
        vpcId: "string",
    },
});
Copy
type: aws:opensearch:VpcEndpoint
properties:
    domainArn: string
    vpcOptions:
        availabilityZones:
            - string
        securityGroupIds:
            - string
        subnetIds:
            - string
        vpcId: string
Copy

VpcEndpoint Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The VpcEndpoint resource accepts the following input properties:

DomainArn
This property is required.
Changes to this property will trigger replacement.
string
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
VpcOptions This property is required. VpcEndpointVpcOptions
Options to specify the subnets and security groups for the endpoint.
DomainArn
This property is required.
Changes to this property will trigger replacement.
string
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
VpcOptions This property is required. VpcEndpointVpcOptionsArgs
Options to specify the subnets and security groups for the endpoint.
domainArn
This property is required.
Changes to this property will trigger replacement.
String
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
vpcOptions This property is required. VpcEndpointVpcOptions
Options to specify the subnets and security groups for the endpoint.
domainArn
This property is required.
Changes to this property will trigger replacement.
string
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
vpcOptions This property is required. VpcEndpointVpcOptions
Options to specify the subnets and security groups for the endpoint.
domain_arn
This property is required.
Changes to this property will trigger replacement.
str
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
vpc_options This property is required. VpcEndpointVpcOptionsArgs
Options to specify the subnets and security groups for the endpoint.
domainArn
This property is required.
Changes to this property will trigger replacement.
String
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
vpcOptions This property is required. Property Map
Options to specify the subnets and security groups for the endpoint.

Outputs

All input properties are implicitly available as output properties. Additionally, the VpcEndpoint resource produces the following output properties:

Endpoint string
The connection endpoint ID for connecting to the domain.
Id string
The provider-assigned unique ID for this managed resource.
Endpoint string
The connection endpoint ID for connecting to the domain.
Id string
The provider-assigned unique ID for this managed resource.
endpoint String
The connection endpoint ID for connecting to the domain.
id String
The provider-assigned unique ID for this managed resource.
endpoint string
The connection endpoint ID for connecting to the domain.
id string
The provider-assigned unique ID for this managed resource.
endpoint str
The connection endpoint ID for connecting to the domain.
id str
The provider-assigned unique ID for this managed resource.
endpoint String
The connection endpoint ID for connecting to the domain.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing VpcEndpoint Resource

Get an existing VpcEndpoint resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: VpcEndpointState, opts?: CustomResourceOptions): VpcEndpoint
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        domain_arn: Optional[str] = None,
        endpoint: Optional[str] = None,
        vpc_options: Optional[VpcEndpointVpcOptionsArgs] = None) -> VpcEndpoint
func GetVpcEndpoint(ctx *Context, name string, id IDInput, state *VpcEndpointState, opts ...ResourceOption) (*VpcEndpoint, error)
public static VpcEndpoint Get(string name, Input<string> id, VpcEndpointState? state, CustomResourceOptions? opts = null)
public static VpcEndpoint get(String name, Output<String> id, VpcEndpointState state, CustomResourceOptions options)
resources:  _:    type: aws:opensearch:VpcEndpoint    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
DomainArn Changes to this property will trigger replacement. string
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
Endpoint string
The connection endpoint ID for connecting to the domain.
VpcOptions VpcEndpointVpcOptions
Options to specify the subnets and security groups for the endpoint.
DomainArn Changes to this property will trigger replacement. string
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
Endpoint string
The connection endpoint ID for connecting to the domain.
VpcOptions VpcEndpointVpcOptionsArgs
Options to specify the subnets and security groups for the endpoint.
domainArn Changes to this property will trigger replacement. String
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
endpoint String
The connection endpoint ID for connecting to the domain.
vpcOptions VpcEndpointVpcOptions
Options to specify the subnets and security groups for the endpoint.
domainArn Changes to this property will trigger replacement. string
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
endpoint string
The connection endpoint ID for connecting to the domain.
vpcOptions VpcEndpointVpcOptions
Options to specify the subnets and security groups for the endpoint.
domain_arn Changes to this property will trigger replacement. str
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
endpoint str
The connection endpoint ID for connecting to the domain.
vpc_options VpcEndpointVpcOptionsArgs
Options to specify the subnets and security groups for the endpoint.
domainArn Changes to this property will trigger replacement. String
Specifies the Amazon Resource Name (ARN) of the domain to create the endpoint for
endpoint String
The connection endpoint ID for connecting to the domain.
vpcOptions Property Map
Options to specify the subnets and security groups for the endpoint.

Supporting Types

VpcEndpointVpcOptions
, VpcEndpointVpcOptionsArgs

SubnetIds This property is required. List<string>
A list of subnet IDs associated with the VPC endpoints for the domain. If your domain uses multiple Availability Zones, you need to provide two subnet IDs, one per zone. Otherwise, provide only one.
AvailabilityZones List<string>
SecurityGroupIds List<string>
The list of security group IDs associated with the VPC endpoints for the domain. If you do not provide a security group ID, OpenSearch Service uses the default security group for the VPC.
VpcId string
SubnetIds This property is required. []string
A list of subnet IDs associated with the VPC endpoints for the domain. If your domain uses multiple Availability Zones, you need to provide two subnet IDs, one per zone. Otherwise, provide only one.
AvailabilityZones []string
SecurityGroupIds []string
The list of security group IDs associated with the VPC endpoints for the domain. If you do not provide a security group ID, OpenSearch Service uses the default security group for the VPC.
VpcId string
subnetIds This property is required. List<String>
A list of subnet IDs associated with the VPC endpoints for the domain. If your domain uses multiple Availability Zones, you need to provide two subnet IDs, one per zone. Otherwise, provide only one.
availabilityZones List<String>
securityGroupIds List<String>
The list of security group IDs associated with the VPC endpoints for the domain. If you do not provide a security group ID, OpenSearch Service uses the default security group for the VPC.
vpcId String
subnetIds This property is required. string[]
A list of subnet IDs associated with the VPC endpoints for the domain. If your domain uses multiple Availability Zones, you need to provide two subnet IDs, one per zone. Otherwise, provide only one.
availabilityZones string[]
securityGroupIds string[]
The list of security group IDs associated with the VPC endpoints for the domain. If you do not provide a security group ID, OpenSearch Service uses the default security group for the VPC.
vpcId string
subnet_ids This property is required. Sequence[str]
A list of subnet IDs associated with the VPC endpoints for the domain. If your domain uses multiple Availability Zones, you need to provide two subnet IDs, one per zone. Otherwise, provide only one.
availability_zones Sequence[str]
security_group_ids Sequence[str]
The list of security group IDs associated with the VPC endpoints for the domain. If you do not provide a security group ID, OpenSearch Service uses the default security group for the VPC.
vpc_id str
subnetIds This property is required. List<String>
A list of subnet IDs associated with the VPC endpoints for the domain. If your domain uses multiple Availability Zones, you need to provide two subnet IDs, one per zone. Otherwise, provide only one.
availabilityZones List<String>
securityGroupIds List<String>
The list of security group IDs associated with the VPC endpoints for the domain. If you do not provide a security group ID, OpenSearch Service uses the default security group for the VPC.
vpcId String

Import

Using pulumi import, import OpenSearch VPC endpoint connections using the id. For example:

$ pulumi import aws:opensearch/vpcEndpoint:VpcEndpoint example endpoint-id
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.