pulumi_wasm_providers_aws_mini::ec2

Module vpc_endpoint

source
Expand description

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

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let s3 = vpc_endpoint::create(
        "s3",
        VpcEndpointArgs::builder()
            .service_name("com.amazonaws.us-west-2.s3")
            .vpc_id("${main.id}")
            .build_struct(),
    );
}

§Basic w/ Tags

resources:
  s3:
    type: aws:ec2:VpcEndpoint
    properties:
      vpcId: ${main.id}
      serviceName: com.amazonaws.us-west-2.s3
      tags:
        Environment: test

§Interface Endpoint Type

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let ec2 = vpc_endpoint::create(
        "ec2",
        VpcEndpointArgs::builder()
            .private_dns_enabled(true)
            .security_group_ids(vec!["${sg1.id}",])
            .service_name("com.amazonaws.us-west-2.ec2")
            .vpc_endpoint_type("Interface")
            .vpc_id("${main.id}")
            .build_struct(),
    );
}

§Interface Endpoint Type with User-Defined IP Address

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let ec2 = vpc_endpoint::create(
        "ec2",
        VpcEndpointArgs::builder()
            .service_name("com.amazonaws.us-west-2.ec2")
            .subnet_configurations(
                vec![
                    VpcEndpointSubnetConfiguration::builder().ipv4("10.0.1.10")
                    .subnetId("${example1.id}").build_struct(),
                    VpcEndpointSubnetConfiguration::builder().ipv4("10.0.2.10")
                    .subnetId("${example2.id}").build_struct(),
                ],
            )
            .subnet_ids(vec!["${example1.id}", "${example2.id}",])
            .vpc_endpoint_type("Interface")
            .vpc_id("${example.id}")
            .build_struct(),
    );
}

§Gateway Load Balancer Endpoint Type

resources:
  example:
    type: aws:ec2:VpcEndpointService
    properties:
      acceptanceRequired: false
      allowedPrincipals:
        - ${current.arn}
      gatewayLoadBalancerArns:
        - ${exampleAwsLb.arn}
  exampleVpcEndpoint:
    type: aws:ec2:VpcEndpoint
    name: example
    properties:
      serviceName: ${example.serviceName}
      subnetIds:
        - ${exampleAwsSubnet.id}
      vpcEndpointType: ${example.serviceType}
      vpcId: ${exampleAwsVpc.id}
variables:
  current:
    fn::invoke:
      function: aws:getCallerIdentity
      arguments: {}

§Import

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

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

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments