1. Packages
  2. Neon Provider
  3. API Docs
  4. VpcEndpointRestriction
neon 0.9.0 published on Tuesday, May 6, 2025 by kislerdm

neon.VpcEndpointRestriction

Explore with Pulumi AI

neon logo
neon 0.9.0 published on Tuesday, May 6, 2025 by kislerdm

    Sets or updates a VPC endpoint restriction for a Neon project. When a VPC endpoint restriction is set, the project only accepts connections from the specified VPC. A VPC endpoint can be set as a restriction only after it is assigned to the parent organization of the Neon project.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as neon from "@pulumi/neon";
    
    const exampleVpcEndpointAssignment = new neon.VpcEndpointAssignment("exampleVpcEndpointAssignment", {
        orgId: "org-foo-bar-01234567",
        regionId: "aws-us-east-1",
        vpcEndpointId: "vpce-1234567890abcdef0",
        label: "example",
    });
    const exampleVpcEndpointRestriction = new neon.VpcEndpointRestriction("exampleVpcEndpointRestriction", {
        projectId: "cold-bread-99644485",
        vpcEndpointId: exampleVpcEndpointAssignment.vpcEndpointId,
        label: "example",
    });
    
    import pulumi
    import pulumi_neon as neon
    
    example_vpc_endpoint_assignment = neon.VpcEndpointAssignment("exampleVpcEndpointAssignment",
        org_id="org-foo-bar-01234567",
        region_id="aws-us-east-1",
        vpc_endpoint_id="vpce-1234567890abcdef0",
        label="example")
    example_vpc_endpoint_restriction = neon.VpcEndpointRestriction("exampleVpcEndpointRestriction",
        project_id="cold-bread-99644485",
        vpc_endpoint_id=example_vpc_endpoint_assignment.vpc_endpoint_id,
        label="example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/neon/neon"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleVpcEndpointAssignment, err := neon.NewVpcEndpointAssignment(ctx, "exampleVpcEndpointAssignment", &neon.VpcEndpointAssignmentArgs{
    			OrgId:         pulumi.String("org-foo-bar-01234567"),
    			RegionId:      pulumi.String("aws-us-east-1"),
    			VpcEndpointId: pulumi.String("vpce-1234567890abcdef0"),
    			Label:         pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = neon.NewVpcEndpointRestriction(ctx, "exampleVpcEndpointRestriction", &neon.VpcEndpointRestrictionArgs{
    			ProjectId:     pulumi.String("cold-bread-99644485"),
    			VpcEndpointId: exampleVpcEndpointAssignment.VpcEndpointId,
    			Label:         pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Neon = Pulumi.Neon;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleVpcEndpointAssignment = new Neon.VpcEndpointAssignment("exampleVpcEndpointAssignment", new()
        {
            OrgId = "org-foo-bar-01234567",
            RegionId = "aws-us-east-1",
            VpcEndpointId = "vpce-1234567890abcdef0",
            Label = "example",
        });
    
        var exampleVpcEndpointRestriction = new Neon.VpcEndpointRestriction("exampleVpcEndpointRestriction", new()
        {
            ProjectId = "cold-bread-99644485",
            VpcEndpointId = exampleVpcEndpointAssignment.VpcEndpointId,
            Label = "example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.neon.VpcEndpointAssignment;
    import com.pulumi.neon.VpcEndpointAssignmentArgs;
    import com.pulumi.neon.VpcEndpointRestriction;
    import com.pulumi.neon.VpcEndpointRestrictionArgs;
    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 exampleVpcEndpointAssignment = new VpcEndpointAssignment("exampleVpcEndpointAssignment", VpcEndpointAssignmentArgs.builder()
                .orgId("org-foo-bar-01234567")
                .regionId("aws-us-east-1")
                .vpcEndpointId("vpce-1234567890abcdef0")
                .label("example")
                .build());
    
            var exampleVpcEndpointRestriction = new VpcEndpointRestriction("exampleVpcEndpointRestriction", VpcEndpointRestrictionArgs.builder()
                .projectId("cold-bread-99644485")
                .vpcEndpointId(exampleVpcEndpointAssignment.vpcEndpointId())
                .label("example")
                .build());
    
        }
    }
    
    resources:
      exampleVpcEndpointAssignment:
        type: neon:VpcEndpointAssignment
        properties:
          orgId: org-foo-bar-01234567
          regionId: aws-us-east-1
          vpcEndpointId: vpce-1234567890abcdef0
          label: example
      exampleVpcEndpointRestriction:
        type: neon:VpcEndpointRestriction
        properties:
          projectId: cold-bread-99644485
          vpcEndpointId: ${exampleVpcEndpointAssignment.vpcEndpointId}
          label: example
    

    Create VpcEndpointRestriction Resource

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

    Constructor syntax

    new VpcEndpointRestriction(name: string, args: VpcEndpointRestrictionArgs, opts?: CustomResourceOptions);
    @overload
    def VpcEndpointRestriction(resource_name: str,
                               args: VpcEndpointRestrictionArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcEndpointRestriction(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               label: Optional[str] = None,
                               project_id: Optional[str] = None,
                               vpc_endpoint_id: Optional[str] = None,
                               vpc_endpoint_restriction_id: Optional[str] = None)
    func NewVpcEndpointRestriction(ctx *Context, name string, args VpcEndpointRestrictionArgs, opts ...ResourceOption) (*VpcEndpointRestriction, error)
    public VpcEndpointRestriction(string name, VpcEndpointRestrictionArgs args, CustomResourceOptions? opts = null)
    public VpcEndpointRestriction(String name, VpcEndpointRestrictionArgs args)
    public VpcEndpointRestriction(String name, VpcEndpointRestrictionArgs args, CustomResourceOptions options)
    
    type: neon:VpcEndpointRestriction
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args VpcEndpointRestrictionArgs
    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 VpcEndpointRestrictionArgs
    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 VpcEndpointRestrictionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcEndpointRestrictionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcEndpointRestrictionArgs
    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 vpcEndpointRestrictionResource = new Neon.VpcEndpointRestriction("vpcEndpointRestrictionResource", new()
    {
        Label = "string",
        ProjectId = "string",
        VpcEndpointId = "string",
        VpcEndpointRestrictionId = "string",
    });
    
    example, err := neon.NewVpcEndpointRestriction(ctx, "vpcEndpointRestrictionResource", &neon.VpcEndpointRestrictionArgs{
    	Label:                    pulumi.String("string"),
    	ProjectId:                pulumi.String("string"),
    	VpcEndpointId:            pulumi.String("string"),
    	VpcEndpointRestrictionId: pulumi.String("string"),
    })
    
    var vpcEndpointRestrictionResource = new VpcEndpointRestriction("vpcEndpointRestrictionResource", VpcEndpointRestrictionArgs.builder()
        .label("string")
        .projectId("string")
        .vpcEndpointId("string")
        .vpcEndpointRestrictionId("string")
        .build());
    
    vpc_endpoint_restriction_resource = neon.VpcEndpointRestriction("vpcEndpointRestrictionResource",
        label="string",
        project_id="string",
        vpc_endpoint_id="string",
        vpc_endpoint_restriction_id="string")
    
    const vpcEndpointRestrictionResource = new neon.VpcEndpointRestriction("vpcEndpointRestrictionResource", {
        label: "string",
        projectId: "string",
        vpcEndpointId: "string",
        vpcEndpointRestrictionId: "string",
    });
    
    type: neon:VpcEndpointRestriction
    properties:
        label: string
        projectId: string
        vpcEndpointId: string
        vpcEndpointRestrictionId: string
    

    VpcEndpointRestriction 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 VpcEndpointRestriction resource accepts the following input properties:

    Label string
    A descriptive label for the VPC endpoint.
    ProjectId string
    The Neon project ID.
    VpcEndpointId string
    The VPC endpoint ID.
    VpcEndpointRestrictionId string
    The ID of this resource.
    Label string
    A descriptive label for the VPC endpoint.
    ProjectId string
    The Neon project ID.
    VpcEndpointId string
    The VPC endpoint ID.
    VpcEndpointRestrictionId string
    The ID of this resource.
    label String
    A descriptive label for the VPC endpoint.
    projectId String
    The Neon project ID.
    vpcEndpointId String
    The VPC endpoint ID.
    vpcEndpointRestrictionId String
    The ID of this resource.
    label string
    A descriptive label for the VPC endpoint.
    projectId string
    The Neon project ID.
    vpcEndpointId string
    The VPC endpoint ID.
    vpcEndpointRestrictionId string
    The ID of this resource.
    label str
    A descriptive label for the VPC endpoint.
    project_id str
    The Neon project ID.
    vpc_endpoint_id str
    The VPC endpoint ID.
    vpc_endpoint_restriction_id str
    The ID of this resource.
    label String
    A descriptive label for the VPC endpoint.
    projectId String
    The Neon project ID.
    vpcEndpointId String
    The VPC endpoint ID.
    vpcEndpointRestrictionId String
    The ID of this resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VpcEndpointRestriction 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 VpcEndpointRestriction Resource

    Get an existing VpcEndpointRestriction 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?: VpcEndpointRestrictionState, opts?: CustomResourceOptions): VpcEndpointRestriction
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            label: Optional[str] = None,
            project_id: Optional[str] = None,
            vpc_endpoint_id: Optional[str] = None,
            vpc_endpoint_restriction_id: Optional[str] = None) -> VpcEndpointRestriction
    func GetVpcEndpointRestriction(ctx *Context, name string, id IDInput, state *VpcEndpointRestrictionState, opts ...ResourceOption) (*VpcEndpointRestriction, error)
    public static VpcEndpointRestriction Get(string name, Input<string> id, VpcEndpointRestrictionState? state, CustomResourceOptions? opts = null)
    public static VpcEndpointRestriction get(String name, Output<String> id, VpcEndpointRestrictionState state, CustomResourceOptions options)
    resources:  _:    type: neon:VpcEndpointRestriction    get:      id: ${id}
    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.
    The following state arguments are supported:
    Label string
    A descriptive label for the VPC endpoint.
    ProjectId string
    The Neon project ID.
    VpcEndpointId string
    The VPC endpoint ID.
    VpcEndpointRestrictionId string
    The ID of this resource.
    Label string
    A descriptive label for the VPC endpoint.
    ProjectId string
    The Neon project ID.
    VpcEndpointId string
    The VPC endpoint ID.
    VpcEndpointRestrictionId string
    The ID of this resource.
    label String
    A descriptive label for the VPC endpoint.
    projectId String
    The Neon project ID.
    vpcEndpointId String
    The VPC endpoint ID.
    vpcEndpointRestrictionId String
    The ID of this resource.
    label string
    A descriptive label for the VPC endpoint.
    projectId string
    The Neon project ID.
    vpcEndpointId string
    The VPC endpoint ID.
    vpcEndpointRestrictionId string
    The ID of this resource.
    label str
    A descriptive label for the VPC endpoint.
    project_id str
    The Neon project ID.
    vpc_endpoint_id str
    The VPC endpoint ID.
    vpc_endpoint_restriction_id str
    The ID of this resource.
    label String
    A descriptive label for the VPC endpoint.
    projectId String
    The Neon project ID.
    vpcEndpointId String
    The VPC endpoint ID.
    vpcEndpointRestrictionId String
    The ID of this resource.

    Import

    The VPC endpoint restriction can be imported to the terraform state by its identifier.

    Import using the import block:

    For example:

    hcl

    import {

    to = neon_vpc_endpoint_restriction.example

    id = “vpce-1234567890abcdef0/cold-bread-99644485”

    }

    Import using the command pulumi import:

    commandline

    $ pulumi import neon:index/vpcEndpointRestriction:VpcEndpointRestriction example "vpce-1234567890abcdef0/cold-bread-99644485"
    

    Note that the resource ID is the concatenation of the VPC ID and the project ID separated by the slash sign.

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

    Package Details

    Repository
    neon kislerdm/terraform-provider-neon
    License
    Notes
    This Pulumi package is based on the neon Terraform Provider.
    neon logo
    neon 0.9.0 published on Tuesday, May 6, 2025 by kislerdm