import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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 `routeTableId`), * Security Groups - (an association between a VPC endpoint and a single `securityGroupId`), * and Subnets - (an association between a VPC endpoint and a single `subnetId`) and * a VPC Endpoint resource with `routeTableIds` and `subnetIds` 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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const s3 = new aws.ec2.VpcEndpoint("s3", { * vpcId: main.id, * serviceName: "com.amazonaws.us-west-2.s3", * }); * ``` * * ### Basic w/ Tags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const s3 = new aws.ec2.VpcEndpoint("s3", { * vpcId: main.id, * serviceName: "com.amazonaws.us-west-2.s3", * tags: { * Environment: "test", * }, * }); * ``` * * ### Cross-region enabled AWS services * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const s3 = new aws.ec2.VpcEndpoint("s3", { * region: "us-west-2", * vpcId: main.id, * serviceName: "com.amazonaws.us-east-2.s3", * serviceRegion: "us-east-2", * tags: { * Environment: "test", * }, * }); * ``` * * ### Interface Endpoint Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const ec2 = new aws.ec2.VpcEndpoint("ec2", { * vpcId: main.id, * serviceName: "com.amazonaws.us-west-2.ec2", * vpcEndpointType: "Interface", * securityGroupIds: [sg1.id], * privateDnsEnabled: true, * }); * ``` * * ### Interface Endpoint Type with User-Defined IP Address * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const ec2 = new aws.ec2.VpcEndpoint("ec2", { * subnetConfigurations: [ * { * ipv4: "10.0.1.10", * subnetId: example1.id, * }, * { * ipv4: "10.0.2.10", * subnetId: example2.id, * }, * ], * vpcId: example.id, * serviceName: "com.amazonaws.us-west-2.ec2", * vpcEndpointType: "Interface", * subnetIds: [ * example1.id, * example2.id, * ], * }); * ``` * * ### Gateway Load Balancer Endpoint Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getCallerIdentity({}); * const example = new aws.ec2.VpcEndpointService("example", { * acceptanceRequired: false, * allowedPrincipals: [current.then(current => current.arn)], * gatewayLoadBalancerArns: [exampleAwsLb.arn], * }); * const exampleVpcEndpoint = new aws.ec2.VpcEndpoint("example", { * serviceName: example.serviceName, * subnetIds: [exampleAwsSubnet.id], * vpcEndpointType: example.serviceType, * vpcId: exampleAwsVpc.id, * }); * ``` * * ### VPC Lattice Resource Configuration Endpoint Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.VpcEndpoint("example", { * resourceConfigurationArn: exampleAwsVpclatticeResourceConfiguration.arn, * subnetIds: [exampleAwsSubnet.id], * vpcEndpointType: "Resource", * vpcId: exampleAwsVpc.id, * }); * ``` * * ### VPC Lattice Service Network Endpoint Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.VpcEndpoint("example", { * serviceNetworkArn: exampleAwsVpclatticeServiceNetwork.arn, * subnetIds: [exampleAwsSubnet.id], * vpcEndpointType: "ServiceNetwork", * vpcId: exampleAwsVpc.id, * }); * ``` * * ### VPC Lattice Tunnel Endpoint Type * * A `Tunnel` endpoint connects to exactly one `CIDR` type `aws.vpclattice.ResourceConfiguration`, and consumers must send GENEVE-encapsulated traffic (UDP port 6081) to it. See [Access a network segment through a tunnel VPC endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/use-cidr-endpoint.html). * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.VpcEndpoint("example", { * resourceConfigurationArn: exampleAwsVpclatticeResourceConfiguration.arn, * securityGroupIds: [exampleAwsSecurityGroup.id], * subnetIds: [ * example1.id, * example2.id, * ], * vpcEndpointType: "Tunnel", * vpcId: exampleAwsVpc.id, * }); * ``` * * ### Non-AWS Service * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const ptfeService = new aws.ec2.VpcEndpoint("ptfe_service", { * vpcId: vpcId, * serviceName: ptfeServiceConfig, * vpcEndpointType: "Interface", * securityGroupIds: [ptfeServiceAwsSecurityGroup.id], * subnetIds: [subnetIds], * privateDnsEnabled: false, * }); * const internal = aws.route53.getZone({ * name: "vpc.internal.", * privateZone: true, * vpcId: vpcId, * }); * const ptfeServiceRecord = new aws.route53.Record("ptfe_service", { * zoneId: internal.then(internal => internal.zoneId), * name: internal.then(internal => `ptfe.${internal.name}`), * type: aws.route53.RecordType.CNAME, * ttl: 300, * records: [ptfeService.dnsEntries[0].dns_name], * }); * ``` * * > **NOTE The `dnsEntry` output is a list of maps:** This provider interpolation support for lists of maps requires the `lookup` and `[]` until full support of lists of maps is available * * ## Import * * ### Identity Schema * * #### Required * * * `id` - (String) ID of the VPC endpoint. * * #### Optional * * * `accountId` (String) AWS Account where this resource is managed. * * `region` (String) Region where this resource is managed. * * Using `pulumi import`, import VPC Endpoints using the VPC endpoint `id`. For example: * * ```sh * $ pulumi import aws:ec2/vpcEndpoint:VpcEndpoint example vpce-3ecf2a57 * ``` */ export declare class VpcEndpoint extends pulumi.CustomResource { /** * Get an existing VpcEndpoint resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: VpcEndpointState, opts?: pulumi.CustomResourceOptions): VpcEndpoint; /** * Check whether an existing VpcEndpoint resource with the given ID exists. * * @param id The _unique_ provider ID of the resource to check. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static exists(id: pulumi.Input, state?: VpcEndpointState, opts?: pulumi.CustomResourceOptions): pulumi.Output; /** * Returns true if the given object is an instance of VpcEndpoint. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is VpcEndpoint; /** * ARN of the VPC endpoint. */ readonly arn: pulumi.Output; /** * Whether to accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account). */ readonly autoAccept: pulumi.Output; /** * List of CIDR blocks for the exposed AWS service. Applicable for endpoints of type `Gateway`. */ readonly cidrBlocks: pulumi.Output; /** * DNS entries for the VPC Endpoint. Applicable for endpoints of type `Interface`. See `dnsEntry` below. */ readonly dnsEntries: pulumi.Output; /** * DNS options for the endpoint. See `dnsOptions` below. */ readonly dnsOptions: pulumi.Output; /** * IP address type for the endpoint. Valid values are `ipv4`, `dualstack`, and `ipv6`. */ readonly ipAddressType: pulumi.Output; /** * One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type `Interface`. */ readonly networkInterfaceIds: pulumi.Output; /** * ID of the AWS account that owns the VPC endpoint. */ readonly ownerId: pulumi.Output; /** * 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](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) for more details. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. */ readonly policy: pulumi.Output; /** * Prefix list ID of the exposed AWS service. Applicable for endpoints of type `Gateway`. */ readonly prefixListId: pulumi.Output; /** * Whether to associate a private hosted zone with the specified VPC. Available for AWS services and AWS Marketplace partner services only. Applicable for endpoints of type `Interface`. Most users will want this enabled to allow services within the VPC to automatically use the endpoint. Defaults to `false`. If `vpcEndpointType` is anything other than `Interface`, changing this value forces a new resource to be created. */ readonly privateDnsEnabled: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; /** * Whether or not the VPC Endpoint is being managed by its service - `true` or `false`. */ readonly requesterManaged: pulumi.Output; /** * ARN of a Resource Configuration to connect this VPC Endpoint to. Exactly one of `resourceConfigurationArn`, `serviceName` or `serviceNetworkArn` is required. Applicable for endpoints of type `Resource` and `Tunnel`. For `Tunnel` endpoints, the resource configuration must be of type `CIDR`. */ readonly resourceConfigurationArn: pulumi.Output; /** * One or more route table IDs. Applicable for endpoints of type `Gateway`. */ readonly routeTableIds: pulumi.Output; /** * ID of one or more security groups to associate with the network interface. Applicable for endpoints of type `Interface`, `Resource`, `ServiceNetwork`, and `Tunnel`. If no security groups are specified, the VPC's [default security group](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html#DefaultSecurityGroup) is associated with the endpoint. */ readonly securityGroupIds: pulumi.Output; /** * Service name. For AWS services the service name is usually in the form `com.amazonaws..` (the SageMaker AI Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker..notebook`). Exactly one of `resourceConfigurationArn`, `serviceName` or `serviceNetworkArn` is required. */ readonly serviceName: pulumi.Output; /** * ARN of a Service Network to connect this VPC Endpoint to. Exactly one of `resourceConfigurationArn`, `serviceName` or `serviceNetworkArn` is required. */ readonly serviceNetworkArn: pulumi.Output; /** * AWS region of the VPC Endpoint Service. If specified, the VPC endpoint will connect to the service in the provided region. Applicable for endpoints of type `Interface`. */ readonly serviceRegion: pulumi.Output; /** * State of the VPC endpoint. */ readonly state: pulumi.Output; /** * Subnet configuration for the endpoint, used to select specific IPv4 and/or IPv6 addresses to the endpoint. See subnetConfiguration below. */ readonly subnetConfigurations: pulumi.Output; /** * ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type `GatewayLoadBalancer`, `Interface`, `Resource`, `ServiceNetwork`, and `Tunnel`. Interface type endpoints cannot function without being assigned to a subnet. For `Tunnel` endpoints, the subnets must be in the Availability Zones of the resource gateway associated with the resource configuration. */ readonly subnetIds: pulumi.Output; /** * Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ readonly tagsAll: pulumi.Output<{ [key: string]: string; }>; /** * VPC endpoint type, `Gateway`, `GatewayLoadBalancer`, `Interface`, `Resource`, `ServiceNetwork` or `Tunnel`. Defaults to `Gateway`. */ readonly vpcEndpointType: pulumi.Output; /** * ID of the VPC in which the endpoint will be used. */ readonly vpcId: pulumi.Output; /** * Create a VpcEndpoint resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: VpcEndpointArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering VpcEndpoint resources. */ export interface VpcEndpointState { /** * ARN of the VPC endpoint. */ arn?: pulumi.Input; /** * Whether to accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account). */ autoAccept?: pulumi.Input; /** * List of CIDR blocks for the exposed AWS service. Applicable for endpoints of type `Gateway`. */ cidrBlocks?: pulumi.Input[] | undefined>; /** * DNS entries for the VPC Endpoint. Applicable for endpoints of type `Interface`. See `dnsEntry` below. */ dnsEntries?: pulumi.Input[] | undefined>; /** * DNS options for the endpoint. See `dnsOptions` below. */ dnsOptions?: pulumi.Input; /** * IP address type for the endpoint. Valid values are `ipv4`, `dualstack`, and `ipv6`. */ ipAddressType?: pulumi.Input; /** * One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type `Interface`. */ networkInterfaceIds?: pulumi.Input[] | undefined>; /** * ID of the AWS account that owns the VPC endpoint. */ ownerId?: pulumi.Input; /** * 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](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) for more details. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. */ policy?: pulumi.Input; /** * Prefix list ID of the exposed AWS service. Applicable for endpoints of type `Gateway`. */ prefixListId?: pulumi.Input; /** * Whether to associate a private hosted zone with the specified VPC. Available for AWS services and AWS Marketplace partner services only. Applicable for endpoints of type `Interface`. Most users will want this enabled to allow services within the VPC to automatically use the endpoint. Defaults to `false`. If `vpcEndpointType` is anything other than `Interface`, changing this value forces a new resource to be created. */ privateDnsEnabled?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * Whether or not the VPC Endpoint is being managed by its service - `true` or `false`. */ requesterManaged?: pulumi.Input; /** * ARN of a Resource Configuration to connect this VPC Endpoint to. Exactly one of `resourceConfigurationArn`, `serviceName` or `serviceNetworkArn` is required. Applicable for endpoints of type `Resource` and `Tunnel`. For `Tunnel` endpoints, the resource configuration must be of type `CIDR`. */ resourceConfigurationArn?: pulumi.Input; /** * One or more route table IDs. Applicable for endpoints of type `Gateway`. */ routeTableIds?: pulumi.Input[] | undefined>; /** * ID of one or more security groups to associate with the network interface. Applicable for endpoints of type `Interface`, `Resource`, `ServiceNetwork`, and `Tunnel`. If no security groups are specified, the VPC's [default security group](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html#DefaultSecurityGroup) is associated with the endpoint. */ securityGroupIds?: pulumi.Input[] | undefined>; /** * Service name. For AWS services the service name is usually in the form `com.amazonaws..` (the SageMaker AI Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker..notebook`). Exactly one of `resourceConfigurationArn`, `serviceName` or `serviceNetworkArn` is required. */ serviceName?: pulumi.Input; /** * ARN of a Service Network to connect this VPC Endpoint to. Exactly one of `resourceConfigurationArn`, `serviceName` or `serviceNetworkArn` is required. */ serviceNetworkArn?: pulumi.Input; /** * AWS region of the VPC Endpoint Service. If specified, the VPC endpoint will connect to the service in the provided region. Applicable for endpoints of type `Interface`. */ serviceRegion?: pulumi.Input; /** * State of the VPC endpoint. */ state?: pulumi.Input; /** * Subnet configuration for the endpoint, used to select specific IPv4 and/or IPv6 addresses to the endpoint. See subnetConfiguration below. */ subnetConfigurations?: pulumi.Input[] | undefined>; /** * ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type `GatewayLoadBalancer`, `Interface`, `Resource`, `ServiceNetwork`, and `Tunnel`. Interface type endpoints cannot function without being assigned to a subnet. For `Tunnel` endpoints, the subnets must be in the Availability Zones of the resource gateway associated with the resource configuration. */ subnetIds?: pulumi.Input[] | undefined>; /** * Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ tagsAll?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * VPC endpoint type, `Gateway`, `GatewayLoadBalancer`, `Interface`, `Resource`, `ServiceNetwork` or `Tunnel`. Defaults to `Gateway`. */ vpcEndpointType?: pulumi.Input; /** * ID of the VPC in which the endpoint will be used. */ vpcId?: pulumi.Input; } /** * The set of arguments for constructing a VpcEndpoint resource. */ export interface VpcEndpointArgs { /** * Whether to accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account). */ autoAccept?: pulumi.Input; /** * DNS options for the endpoint. See `dnsOptions` below. */ dnsOptions?: pulumi.Input; /** * IP address type for the endpoint. Valid values are `ipv4`, `dualstack`, and `ipv6`. */ ipAddressType?: pulumi.Input; /** * 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](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) for more details. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. */ policy?: pulumi.Input; /** * Whether to associate a private hosted zone with the specified VPC. Available for AWS services and AWS Marketplace partner services only. Applicable for endpoints of type `Interface`. Most users will want this enabled to allow services within the VPC to automatically use the endpoint. Defaults to `false`. If `vpcEndpointType` is anything other than `Interface`, changing this value forces a new resource to be created. */ privateDnsEnabled?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * ARN of a Resource Configuration to connect this VPC Endpoint to. Exactly one of `resourceConfigurationArn`, `serviceName` or `serviceNetworkArn` is required. Applicable for endpoints of type `Resource` and `Tunnel`. For `Tunnel` endpoints, the resource configuration must be of type `CIDR`. */ resourceConfigurationArn?: pulumi.Input; /** * One or more route table IDs. Applicable for endpoints of type `Gateway`. */ routeTableIds?: pulumi.Input[] | undefined>; /** * ID of one or more security groups to associate with the network interface. Applicable for endpoints of type `Interface`, `Resource`, `ServiceNetwork`, and `Tunnel`. If no security groups are specified, the VPC's [default security group](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html#DefaultSecurityGroup) is associated with the endpoint. */ securityGroupIds?: pulumi.Input[] | undefined>; /** * Service name. For AWS services the service name is usually in the form `com.amazonaws..` (the SageMaker AI Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker..notebook`). Exactly one of `resourceConfigurationArn`, `serviceName` or `serviceNetworkArn` is required. */ serviceName?: pulumi.Input; /** * ARN of a Service Network to connect this VPC Endpoint to. Exactly one of `resourceConfigurationArn`, `serviceName` or `serviceNetworkArn` is required. */ serviceNetworkArn?: pulumi.Input; /** * AWS region of the VPC Endpoint Service. If specified, the VPC endpoint will connect to the service in the provided region. Applicable for endpoints of type `Interface`. */ serviceRegion?: pulumi.Input; /** * Subnet configuration for the endpoint, used to select specific IPv4 and/or IPv6 addresses to the endpoint. See subnetConfiguration below. */ subnetConfigurations?: pulumi.Input[] | undefined>; /** * ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type `GatewayLoadBalancer`, `Interface`, `Resource`, `ServiceNetwork`, and `Tunnel`. Interface type endpoints cannot function without being assigned to a subnet. For `Tunnel` endpoints, the subnets must be in the Availability Zones of the resource gateway associated with the resource configuration. */ subnetIds?: pulumi.Input[] | undefined>; /** * Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * VPC endpoint type, `Gateway`, `GatewayLoadBalancer`, `Interface`, `Resource`, `ServiceNetwork` or `Tunnel`. Defaults to `Gateway`. */ vpcEndpointType?: pulumi.Input; /** * ID of the VPC in which the endpoint will be used. */ vpcId: pulumi.Input; } //# sourceMappingURL=vpcEndpoint.d.ts.map