Try AWS Native preview for resources not in the classic version.
aws.ec2.getVpcEndpointService
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
The VPC Endpoint Service data source details about a specific service that can be specified when creating a VPC endpoint within the region configured in the provider.
Example Usage
AWS Service
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// Declare the data source
const s3 = aws.ec2.getVpcEndpointService({
service: "s3",
serviceType: "Gateway",
});
// Create a VPC
const foo = new aws.ec2.Vpc("foo", {cidrBlock: "10.0.0.0/16"});
// Create a VPC endpoint
const ep = new aws.ec2.VpcEndpoint("ep", {
vpcId: foo.id,
serviceName: s3.then(s3 => s3.serviceName),
});
import pulumi
import pulumi_aws as aws
# Declare the data source
s3 = aws.ec2.get_vpc_endpoint_service(service="s3",
service_type="Gateway")
# Create a VPC
foo = aws.ec2.Vpc("foo", cidr_block="10.0.0.0/16")
# Create a VPC endpoint
ep = aws.ec2.VpcEndpoint("ep",
vpc_id=foo.id,
service_name=s3.service_name)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Declare the data source
s3, err := ec2.LookupVpcEndpointService(ctx, &ec2.LookupVpcEndpointServiceArgs{
Service: pulumi.StringRef("s3"),
ServiceType: pulumi.StringRef("Gateway"),
}, nil)
if err != nil {
return err
}
// Create a VPC
foo, err := ec2.NewVpc(ctx, "foo", &ec2.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
// Create a VPC endpoint
_, err = ec2.NewVpcEndpoint(ctx, "ep", &ec2.VpcEndpointArgs{
VpcId: foo.ID(),
ServiceName: pulumi.String(s3.ServiceName),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
// Declare the data source
var s3 = Aws.Ec2.GetVpcEndpointService.Invoke(new()
{
Service = "s3",
ServiceType = "Gateway",
});
// Create a VPC
var foo = new Aws.Ec2.Vpc("foo", new()
{
CidrBlock = "10.0.0.0/16",
});
// Create a VPC endpoint
var ep = new Aws.Ec2.VpcEndpoint("ep", new()
{
VpcId = foo.Id,
ServiceName = s3.Apply(getVpcEndpointServiceResult => getVpcEndpointServiceResult.ServiceName),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetVpcEndpointServiceArgs;
import com.pulumi.aws.ec2.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
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) {
// Declare the data source
final var s3 = Ec2Functions.getVpcEndpointService(GetVpcEndpointServiceArgs.builder()
.service("s3")
.serviceType("Gateway")
.build());
// Create a VPC
var foo = new Vpc("foo", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
// Create a VPC endpoint
var ep = new VpcEndpoint("ep", VpcEndpointArgs.builder()
.vpcId(foo.id())
.serviceName(s3.applyValue(getVpcEndpointServiceResult -> getVpcEndpointServiceResult.serviceName()))
.build());
}
}
resources:
# Create a VPC
foo:
type: aws:ec2:Vpc
properties:
cidrBlock: 10.0.0.0/16
# Create a VPC endpoint
ep:
type: aws:ec2:VpcEndpoint
properties:
vpcId: ${foo.id}
serviceName: ${s3.serviceName}
variables:
# Declare the data source
s3:
fn::invoke:
Function: aws:ec2:getVpcEndpointService
Arguments:
service: s3
serviceType: Gateway
Non-AWS Service
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const custome = aws.ec2.getVpcEndpointService({
serviceName: "com.amazonaws.vpce.us-west-2.vpce-svc-0e87519c997c63cd8",
});
import pulumi
import pulumi_aws as aws
custome = aws.ec2.get_vpc_endpoint_service(service_name="com.amazonaws.vpce.us-west-2.vpce-svc-0e87519c997c63cd8")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.LookupVpcEndpointService(ctx, &ec2.LookupVpcEndpointServiceArgs{
ServiceName: pulumi.StringRef("com.amazonaws.vpce.us-west-2.vpce-svc-0e87519c997c63cd8"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var custome = Aws.Ec2.GetVpcEndpointService.Invoke(new()
{
ServiceName = "com.amazonaws.vpce.us-west-2.vpce-svc-0e87519c997c63cd8",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetVpcEndpointServiceArgs;
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 custome = Ec2Functions.getVpcEndpointService(GetVpcEndpointServiceArgs.builder()
.serviceName("com.amazonaws.vpce.us-west-2.vpce-svc-0e87519c997c63cd8")
.build());
}
}
variables:
custome:
fn::invoke:
Function: aws:ec2:getVpcEndpointService
Arguments:
serviceName: com.amazonaws.vpce.us-west-2.vpce-svc-0e87519c997c63cd8
Filter
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = aws.ec2.getVpcEndpointService({
filters: [{
name: "service-name",
values: ["some-service"],
}],
});
import pulumi
import pulumi_aws as aws
test = aws.ec2.get_vpc_endpoint_service(filters=[{
"name": "service-name",
"values": ["some-service"],
}])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.LookupVpcEndpointService(ctx, &ec2.LookupVpcEndpointServiceArgs{
Filters: []ec2.GetVpcEndpointServiceFilter{
{
Name: "service-name",
Values: []string{
"some-service",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = Aws.Ec2.GetVpcEndpointService.Invoke(new()
{
Filters = new[]
{
new Aws.Ec2.Inputs.GetVpcEndpointServiceFilterInputArgs
{
Name = "service-name",
Values = new[]
{
"some-service",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetVpcEndpointServiceArgs;
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 test = Ec2Functions.getVpcEndpointService(GetVpcEndpointServiceArgs.builder()
.filters(GetVpcEndpointServiceFilterArgs.builder()
.name("service-name")
.values("some-service")
.build())
.build());
}
}
variables:
test:
fn::invoke:
Function: aws:ec2:getVpcEndpointService
Arguments:
filters:
- name: service-name
values:
- some-service
Using getVpcEndpointService
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVpcEndpointService(args: GetVpcEndpointServiceArgs, opts?: InvokeOptions): Promise<GetVpcEndpointServiceResult>
function getVpcEndpointServiceOutput(args: GetVpcEndpointServiceOutputArgs, opts?: InvokeOptions): Output<GetVpcEndpointServiceResult>
def get_vpc_endpoint_service(filters: Optional[Sequence[GetVpcEndpointServiceFilter]] = None,
service: Optional[str] = None,
service_name: Optional[str] = None,
service_type: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetVpcEndpointServiceResult
def get_vpc_endpoint_service_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcEndpointServiceFilterArgs]]]] = None,
service: Optional[pulumi.Input[str]] = None,
service_name: Optional[pulumi.Input[str]] = None,
service_type: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVpcEndpointServiceResult]
func LookupVpcEndpointService(ctx *Context, args *LookupVpcEndpointServiceArgs, opts ...InvokeOption) (*LookupVpcEndpointServiceResult, error)
func LookupVpcEndpointServiceOutput(ctx *Context, args *LookupVpcEndpointServiceOutputArgs, opts ...InvokeOption) LookupVpcEndpointServiceResultOutput
> Note: This function is named LookupVpcEndpointService
in the Go SDK.
public static class GetVpcEndpointService
{
public static Task<GetVpcEndpointServiceResult> InvokeAsync(GetVpcEndpointServiceArgs args, InvokeOptions? opts = null)
public static Output<GetVpcEndpointServiceResult> Invoke(GetVpcEndpointServiceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVpcEndpointServiceResult> getVpcEndpointService(GetVpcEndpointServiceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:ec2/getVpcEndpointService:getVpcEndpointService
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<Get
Vpc Endpoint Service Filter> - Configuration block(s) for filtering. Detailed below.
- Service string
- Common name of an AWS service (e.g.,
s3
). - Service
Name string - Service name that is specified when creating a VPC endpoint. 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 formaws.sagemaker.<region>.notebook
). - Service
Type string - Service type,
Gateway
orInterface
. - Dictionary<string, string>
Map of tags, each pair of which must exactly match a pair on the desired VPC Endpoint Service.
NOTE: Specifying
service
will not work for non-AWS services or AWS services that don't follow the standardservice_name
pattern ofcom.amazonaws.<region>.<service>
.
- Filters
[]Get
Vpc Endpoint Service Filter - Configuration block(s) for filtering. Detailed below.
- Service string
- Common name of an AWS service (e.g.,
s3
). - Service
Name string - Service name that is specified when creating a VPC endpoint. 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 formaws.sagemaker.<region>.notebook
). - Service
Type string - Service type,
Gateway
orInterface
. - map[string]string
Map of tags, each pair of which must exactly match a pair on the desired VPC Endpoint Service.
NOTE: Specifying
service
will not work for non-AWS services or AWS services that don't follow the standardservice_name
pattern ofcom.amazonaws.<region>.<service>
.
- filters
List<Get
Vpc Endpoint Service Filter> - Configuration block(s) for filtering. Detailed below.
- service String
- Common name of an AWS service (e.g.,
s3
). - service
Name String - Service name that is specified when creating a VPC endpoint. 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 formaws.sagemaker.<region>.notebook
). - service
Type String - Service type,
Gateway
orInterface
. - Map<String,String>
Map of tags, each pair of which must exactly match a pair on the desired VPC Endpoint Service.
NOTE: Specifying
service
will not work for non-AWS services or AWS services that don't follow the standardservice_name
pattern ofcom.amazonaws.<region>.<service>
.
- filters
Get
Vpc Endpoint Service Filter[] - Configuration block(s) for filtering. Detailed below.
- service string
- Common name of an AWS service (e.g.,
s3
). - service
Name string - Service name that is specified when creating a VPC endpoint. 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 formaws.sagemaker.<region>.notebook
). - service
Type string - Service type,
Gateway
orInterface
. - {[key: string]: string}
Map of tags, each pair of which must exactly match a pair on the desired VPC Endpoint Service.
NOTE: Specifying
service
will not work for non-AWS services or AWS services that don't follow the standardservice_name
pattern ofcom.amazonaws.<region>.<service>
.
- filters
Sequence[Get
Vpc Endpoint Service Filter] - Configuration block(s) for filtering. Detailed below.
- service str
- Common name of an AWS service (e.g.,
s3
). - service_
name str - Service name that is specified when creating a VPC endpoint. 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 formaws.sagemaker.<region>.notebook
). - service_
type str - Service type,
Gateway
orInterface
. - Mapping[str, str]
Map of tags, each pair of which must exactly match a pair on the desired VPC Endpoint Service.
NOTE: Specifying
service
will not work for non-AWS services or AWS services that don't follow the standardservice_name
pattern ofcom.amazonaws.<region>.<service>
.
- filters List<Property Map>
- Configuration block(s) for filtering. Detailed below.
- service String
- Common name of an AWS service (e.g.,
s3
). - service
Name String - Service name that is specified when creating a VPC endpoint. 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 formaws.sagemaker.<region>.notebook
). - service
Type String - Service type,
Gateway
orInterface
. - Map<String>
Map of tags, each pair of which must exactly match a pair on the desired VPC Endpoint Service.
NOTE: Specifying
service
will not work for non-AWS services or AWS services that don't follow the standardservice_name
pattern ofcom.amazonaws.<region>.<service>
.
getVpcEndpointService Result
The following output properties are available:
- Acceptance
Required bool - Whether or not VPC endpoint connection requests to the service must be accepted by the service owner -
true
orfalse
. - Arn string
- ARN of the VPC endpoint service.
- Availability
Zones List<string> - Availability Zones in which the service is available.
- Base
Endpoint List<string>Dns Names - The DNS names for the service.
- Id string
- The provider-assigned unique ID for this managed resource.
- Manages
Vpc boolEndpoints - Whether or not the service manages its VPC endpoints -
true
orfalse
. - Owner string
- AWS account ID of the service owner or
amazon
. - Private
Dns stringName - Private DNS name for the service.
- Service
Id string - ID of the endpoint service.
- Service
Name string - Service
Type string - Supported
Ip List<string>Address Types - The supported IP address types.
- Dictionary<string, string>
- Map of tags assigned to the resource.
- Vpc
Endpoint boolPolicy Supported - Whether or not the service supports endpoint policies -
true
orfalse
. - Filters
List<Get
Vpc Endpoint Service Filter> - Service string
- Acceptance
Required bool - Whether or not VPC endpoint connection requests to the service must be accepted by the service owner -
true
orfalse
. - Arn string
- ARN of the VPC endpoint service.
- Availability
Zones []string - Availability Zones in which the service is available.
- Base
Endpoint []stringDns Names - The DNS names for the service.
- Id string
- The provider-assigned unique ID for this managed resource.
- Manages
Vpc boolEndpoints - Whether or not the service manages its VPC endpoints -
true
orfalse
. - Owner string
- AWS account ID of the service owner or
amazon
. - Private
Dns stringName - Private DNS name for the service.
- Service
Id string - ID of the endpoint service.
- Service
Name string - Service
Type string - Supported
Ip []stringAddress Types - The supported IP address types.
- map[string]string
- Map of tags assigned to the resource.
- Vpc
Endpoint boolPolicy Supported - Whether or not the service supports endpoint policies -
true
orfalse
. - Filters
[]Get
Vpc Endpoint Service Filter - Service string
- acceptance
Required Boolean - Whether or not VPC endpoint connection requests to the service must be accepted by the service owner -
true
orfalse
. - arn String
- ARN of the VPC endpoint service.
- availability
Zones List<String> - Availability Zones in which the service is available.
- base
Endpoint List<String>Dns Names - The DNS names for the service.
- id String
- The provider-assigned unique ID for this managed resource.
- manages
Vpc BooleanEndpoints - Whether or not the service manages its VPC endpoints -
true
orfalse
. - owner String
- AWS account ID of the service owner or
amazon
. - private
Dns StringName - Private DNS name for the service.
- service
Id String - ID of the endpoint service.
- service
Name String - service
Type String - supported
Ip List<String>Address Types - The supported IP address types.
- Map<String,String>
- Map of tags assigned to the resource.
- vpc
Endpoint BooleanPolicy Supported - Whether or not the service supports endpoint policies -
true
orfalse
. - filters
List<Get
Vpc Endpoint Service Filter> - service String
- acceptance
Required boolean - Whether or not VPC endpoint connection requests to the service must be accepted by the service owner -
true
orfalse
. - arn string
- ARN of the VPC endpoint service.
- availability
Zones string[] - Availability Zones in which the service is available.
- base
Endpoint string[]Dns Names - The DNS names for the service.
- id string
- The provider-assigned unique ID for this managed resource.
- manages
Vpc booleanEndpoints - Whether or not the service manages its VPC endpoints -
true
orfalse
. - owner string
- AWS account ID of the service owner or
amazon
. - private
Dns stringName - Private DNS name for the service.
- service
Id string - ID of the endpoint service.
- service
Name string - service
Type string - supported
Ip string[]Address Types - The supported IP address types.
- {[key: string]: string}
- Map of tags assigned to the resource.
- vpc
Endpoint booleanPolicy Supported - Whether or not the service supports endpoint policies -
true
orfalse
. - filters
Get
Vpc Endpoint Service Filter[] - service string
- acceptance_
required bool - Whether or not VPC endpoint connection requests to the service must be accepted by the service owner -
true
orfalse
. - arn str
- ARN of the VPC endpoint service.
- availability_
zones Sequence[str] - Availability Zones in which the service is available.
- base_
endpoint_ Sequence[str]dns_ names - The DNS names for the service.
- id str
- The provider-assigned unique ID for this managed resource.
- manages_
vpc_ boolendpoints - Whether or not the service manages its VPC endpoints -
true
orfalse
. - owner str
- AWS account ID of the service owner or
amazon
. - private_
dns_ strname - Private DNS name for the service.
- service_
id str - ID of the endpoint service.
- service_
name str - service_
type str - supported_
ip_ Sequence[str]address_ types - The supported IP address types.
- Mapping[str, str]
- Map of tags assigned to the resource.
- vpc_
endpoint_ boolpolicy_ supported - Whether or not the service supports endpoint policies -
true
orfalse
. - filters
Sequence[Get
Vpc Endpoint Service Filter] - service str
- acceptance
Required Boolean - Whether or not VPC endpoint connection requests to the service must be accepted by the service owner -
true
orfalse
. - arn String
- ARN of the VPC endpoint service.
- availability
Zones List<String> - Availability Zones in which the service is available.
- base
Endpoint List<String>Dns Names - The DNS names for the service.
- id String
- The provider-assigned unique ID for this managed resource.
- manages
Vpc BooleanEndpoints - Whether or not the service manages its VPC endpoints -
true
orfalse
. - owner String
- AWS account ID of the service owner or
amazon
. - private
Dns StringName - Private DNS name for the service.
- service
Id String - ID of the endpoint service.
- service
Name String - service
Type String - supported
Ip List<String>Address Types - The supported IP address types.
- Map<String>
- Map of tags assigned to the resource.
- vpc
Endpoint BooleanPolicy Supported - Whether or not the service supports endpoint policies -
true
orfalse
. - filters List<Property Map>
- service String
Supporting Types
GetVpcEndpointServiceFilter
- Name string
- Name of the filter field. Valid values can be found in the EC2 DescribeVpcEndpointServices API Reference.
- Values List<string>
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- Name string
- Name of the filter field. Valid values can be found in the EC2 DescribeVpcEndpointServices API Reference.
- Values []string
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name String
- Name of the filter field. Valid values can be found in the EC2 DescribeVpcEndpointServices API Reference.
- values List<String>
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name string
- Name of the filter field. Valid values can be found in the EC2 DescribeVpcEndpointServices API Reference.
- values string[]
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name str
- Name of the filter field. Valid values can be found in the EC2 DescribeVpcEndpointServices API Reference.
- values Sequence[str]
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name String
- Name of the filter field. Valid values can be found in the EC2 DescribeVpcEndpointServices API Reference.
- values List<String>
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.