Try AWS Native preview for resources not in the classic version.
aws.ec2.VpcEndpointSubnetAssociation
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Provides a resource to create an association between a VPC endpoint and a subnet.
NOTE on VPC Endpoints and VPC Endpoint Subnet Associations: This provider provides both a standalone VPC Endpoint Subnet Association (an association between a VPC endpoint and a single
subnet_id
) and a VPC Endpoint resource with asubnet_ids
attribute. Do not use the same subnet ID in both a VPC Endpoint resource and a VPC Endpoint Subnet Association resource. Doing so will cause a conflict of associations and will overwrite the association.
Example Usage
Basic usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var snEc2 = new Aws.Ec2.VpcEndpointSubnetAssociation("snEc2", new()
{
VpcEndpointId = aws_vpc_endpoint.Ec2.Id,
SubnetId = aws_subnet.Sn.Id,
});
});
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.NewVpcEndpointSubnetAssociation(ctx, "snEc2", &ec2.VpcEndpointSubnetAssociationArgs{
VpcEndpointId: pulumi.Any(aws_vpc_endpoint.Ec2.Id),
SubnetId: pulumi.Any(aws_subnet.Sn.Id),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.VpcEndpointSubnetAssociation;
import com.pulumi.aws.ec2.VpcEndpointSubnetAssociationArgs;
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 snEc2 = new VpcEndpointSubnetAssociation("snEc2", VpcEndpointSubnetAssociationArgs.builder()
.vpcEndpointId(aws_vpc_endpoint.ec2().id())
.subnetId(aws_subnet.sn().id())
.build());
}
}
import pulumi
import pulumi_aws as aws
sn_ec2 = aws.ec2.VpcEndpointSubnetAssociation("snEc2",
vpc_endpoint_id=aws_vpc_endpoint["ec2"]["id"],
subnet_id=aws_subnet["sn"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const snEc2 = new aws.ec2.VpcEndpointSubnetAssociation("snEc2", {
vpcEndpointId: aws_vpc_endpoint.ec2.id,
subnetId: aws_subnet.sn.id,
});
resources:
snEc2:
type: aws:ec2:VpcEndpointSubnetAssociation
properties:
vpcEndpointId: ${aws_vpc_endpoint.ec2.id}
subnetId: ${aws_subnet.sn.id}
Create VpcEndpointSubnetAssociation Resource
new VpcEndpointSubnetAssociation(name: string, args: VpcEndpointSubnetAssociationArgs, opts?: CustomResourceOptions);
@overload
def VpcEndpointSubnetAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
subnet_id: Optional[str] = None,
vpc_endpoint_id: Optional[str] = None)
@overload
def VpcEndpointSubnetAssociation(resource_name: str,
args: VpcEndpointSubnetAssociationArgs,
opts: Optional[ResourceOptions] = None)
func NewVpcEndpointSubnetAssociation(ctx *Context, name string, args VpcEndpointSubnetAssociationArgs, opts ...ResourceOption) (*VpcEndpointSubnetAssociation, error)
public VpcEndpointSubnetAssociation(string name, VpcEndpointSubnetAssociationArgs args, CustomResourceOptions? opts = null)
public VpcEndpointSubnetAssociation(String name, VpcEndpointSubnetAssociationArgs args)
public VpcEndpointSubnetAssociation(String name, VpcEndpointSubnetAssociationArgs args, CustomResourceOptions options)
type: aws:ec2:VpcEndpointSubnetAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcEndpointSubnetAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VpcEndpointSubnetAssociationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VpcEndpointSubnetAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcEndpointSubnetAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcEndpointSubnetAssociationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
VpcEndpointSubnetAssociation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The VpcEndpointSubnetAssociation resource accepts the following input properties:
- Subnet
Id string The ID of the subnet to be associated with the VPC endpoint.
- Vpc
Endpoint stringId The ID of the VPC endpoint with which the subnet will be associated.
- Subnet
Id string The ID of the subnet to be associated with the VPC endpoint.
- Vpc
Endpoint stringId The ID of the VPC endpoint with which the subnet will be associated.
- subnet
Id String The ID of the subnet to be associated with the VPC endpoint.
- vpc
Endpoint StringId The ID of the VPC endpoint with which the subnet will be associated.
- subnet
Id string The ID of the subnet to be associated with the VPC endpoint.
- vpc
Endpoint stringId The ID of the VPC endpoint with which the subnet will be associated.
- subnet_
id str The ID of the subnet to be associated with the VPC endpoint.
- vpc_
endpoint_ strid The ID of the VPC endpoint with which the subnet will be associated.
- subnet
Id String The ID of the subnet to be associated with the VPC endpoint.
- vpc
Endpoint StringId The ID of the VPC endpoint with which the subnet will be associated.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcEndpointSubnetAssociation resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing VpcEndpointSubnetAssociation Resource
Get an existing VpcEndpointSubnetAssociation 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?: VpcEndpointSubnetAssociationState, opts?: CustomResourceOptions): VpcEndpointSubnetAssociation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
subnet_id: Optional[str] = None,
vpc_endpoint_id: Optional[str] = None) -> VpcEndpointSubnetAssociation
func GetVpcEndpointSubnetAssociation(ctx *Context, name string, id IDInput, state *VpcEndpointSubnetAssociationState, opts ...ResourceOption) (*VpcEndpointSubnetAssociation, error)
public static VpcEndpointSubnetAssociation Get(string name, Input<string> id, VpcEndpointSubnetAssociationState? state, CustomResourceOptions? opts = null)
public static VpcEndpointSubnetAssociation get(String name, Output<String> id, VpcEndpointSubnetAssociationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Subnet
Id string The ID of the subnet to be associated with the VPC endpoint.
- Vpc
Endpoint stringId The ID of the VPC endpoint with which the subnet will be associated.
- Subnet
Id string The ID of the subnet to be associated with the VPC endpoint.
- Vpc
Endpoint stringId The ID of the VPC endpoint with which the subnet will be associated.
- subnet
Id String The ID of the subnet to be associated with the VPC endpoint.
- vpc
Endpoint StringId The ID of the VPC endpoint with which the subnet will be associated.
- subnet
Id string The ID of the subnet to be associated with the VPC endpoint.
- vpc
Endpoint stringId The ID of the VPC endpoint with which the subnet will be associated.
- subnet_
id str The ID of the subnet to be associated with the VPC endpoint.
- vpc_
endpoint_ strid The ID of the VPC endpoint with which the subnet will be associated.
- subnet
Id String The ID of the subnet to be associated with the VPC endpoint.
- vpc
Endpoint StringId The ID of the VPC endpoint with which the subnet will be associated.
Import
Using pulumi import
, import VPC Endpoint Subnet Associations using vpc_endpoint_id
together with subnet_id
. For example:
$ pulumi import aws:ec2/vpcEndpointSubnetAssociation:VpcEndpointSubnetAssociation example vpce-aaaaaaaa/subnet-bbbbbbbbbbbbbbbbb
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.