1. Packages
  2. Cloudamqp Provider
  3. API Docs
  4. Vpc
CloudAMQP v3.20.4 published on Tuesday, Mar 4, 2025 by Pulumi

cloudamqp.Vpc

Explore with Pulumi AI

This resource allows you to manage standalone VPC.

New Cloudamqp instances can be added to the managed VPC. Set the instance vpc_id attribute to the managed vpc identifier , see example below, when creating the instance.

Only available for dedicated subscription plans.

Pricing is available at cloudamqp.com.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudamqp from "@pulumi/cloudamqp";

// Managed VPC resource
const vpc = new cloudamqp.Vpc("vpc", {
    name: "<VPC name>",
    region: "amazon-web-services::us-east-1",
    subnet: "10.56.72.0/24",
    tags: [],
});
//  New instance, need to be created with a vpc
const instance = new cloudamqp.Instance("instance", {
    name: "<Instance name>",
    plan: "bunny-1",
    region: "amazon-web-services::us-east-1",
    nodes: 1,
    tags: [],
    rmqVersion: "3.9.13",
    vpcId: vpcCloudamqVpc.id,
    keepAssociatedVpc: true,
});
// Additional VPC information
const vpcInfo = cloudamqp.getVpcInfoOutput({
    vpcId: vpc.id,
});
Copy
import pulumi
import pulumi_cloudamqp as cloudamqp

# Managed VPC resource
vpc = cloudamqp.Vpc("vpc",
    name="<VPC name>",
    region="amazon-web-services::us-east-1",
    subnet="10.56.72.0/24",
    tags=[])
#  New instance, need to be created with a vpc
instance = cloudamqp.Instance("instance",
    name="<Instance name>",
    plan="bunny-1",
    region="amazon-web-services::us-east-1",
    nodes=1,
    tags=[],
    rmq_version="3.9.13",
    vpc_id=vpc_cloudamq_vpc["id"],
    keep_associated_vpc=True)
# Additional VPC information
vpc_info = cloudamqp.get_vpc_info_output(vpc_id=vpc.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-cloudamqp/sdk/v3/go/cloudamqp"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Managed VPC resource
		vpc, err := cloudamqp.NewVpc(ctx, "vpc", &cloudamqp.VpcArgs{
			Name:   pulumi.String("<VPC name>"),
			Region: pulumi.String("amazon-web-services::us-east-1"),
			Subnet: pulumi.String("10.56.72.0/24"),
			Tags:   pulumi.StringArray{},
		})
		if err != nil {
			return err
		}
		// New instance, need to be created with a vpc
		_, err = cloudamqp.NewInstance(ctx, "instance", &cloudamqp.InstanceArgs{
			Name:              pulumi.String("<Instance name>"),
			Plan:              pulumi.String("bunny-1"),
			Region:            pulumi.String("amazon-web-services::us-east-1"),
			Nodes:             pulumi.Int(1),
			Tags:              pulumi.StringArray{},
			RmqVersion:        pulumi.String("3.9.13"),
			VpcId:             pulumi.Any(vpcCloudamqVpc.Id),
			KeepAssociatedVpc: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		// Additional VPC information
		_ = cloudamqp.GetVpcInfoOutput(ctx, cloudamqp.GetVpcInfoOutputArgs{
			VpcId: vpc.ID(),
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using CloudAmqp = Pulumi.CloudAmqp;

return await Deployment.RunAsync(() => 
{
    // Managed VPC resource
    var vpc = new CloudAmqp.Vpc("vpc", new()
    {
        Name = "<VPC name>",
        Region = "amazon-web-services::us-east-1",
        Subnet = "10.56.72.0/24",
        Tags = new[] {},
    });

    //  New instance, need to be created with a vpc
    var instance = new CloudAmqp.Instance("instance", new()
    {
        Name = "<Instance name>",
        Plan = "bunny-1",
        Region = "amazon-web-services::us-east-1",
        Nodes = 1,
        Tags = new[] {},
        RmqVersion = "3.9.13",
        VpcId = vpcCloudamqVpc.Id,
        KeepAssociatedVpc = true,
    });

    // Additional VPC information
    var vpcInfo = CloudAmqp.GetVpcInfo.Invoke(new()
    {
        VpcId = vpc.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudamqp.Vpc;
import com.pulumi.cloudamqp.VpcArgs;
import com.pulumi.cloudamqp.Instance;
import com.pulumi.cloudamqp.InstanceArgs;
import com.pulumi.cloudamqp.CloudamqpFunctions;
import com.pulumi.cloudamqp.inputs.GetVpcInfoArgs;
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) {
        // Managed VPC resource
        var vpc = new Vpc("vpc", VpcArgs.builder()
            .name("<VPC name>")
            .region("amazon-web-services::us-east-1")
            .subnet("10.56.72.0/24")
            .tags()
            .build());

        //  New instance, need to be created with a vpc
        var instance = new Instance("instance", InstanceArgs.builder()
            .name("<Instance name>")
            .plan("bunny-1")
            .region("amazon-web-services::us-east-1")
            .nodes(1)
            .tags()
            .rmqVersion("3.9.13")
            .vpcId(vpcCloudamqVpc.id())
            .keepAssociatedVpc(true)
            .build());

        // Additional VPC information
        final var vpcInfo = CloudamqpFunctions.getVpcInfo(GetVpcInfoArgs.builder()
            .vpcId(vpc.id())
            .build());

    }
}
Copy
resources:
  # Managed VPC resource
  vpc:
    type: cloudamqp:Vpc
    properties:
      name: <VPC name>
      region: amazon-web-services::us-east-1
      subnet: 10.56.72.0/24
      tags: []
  #  New instance, need to be created with a vpc
  instance:
    type: cloudamqp:Instance
    properties:
      name: <Instance name>
      plan: bunny-1
      region: amazon-web-services::us-east-1
      nodes: 1
      tags: []
      rmqVersion: 3.9.13
      vpcId: ${vpcCloudamqVpc.id}
      keepAssociatedVpc: true
variables:
  # Additional VPC information
  vpcInfo:
    fn::invoke:
      function: cloudamqp:getVpcInfo
      arguments:
        vpcId: ${vpc.id}
Copy

Create Vpc Resource

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

Constructor syntax

new Vpc(name: string, args: VpcArgs, opts?: CustomResourceOptions);
@overload
def Vpc(resource_name: str,
        args: VpcArgs,
        opts: Optional[ResourceOptions] = None)

@overload
def Vpc(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        region: Optional[str] = None,
        subnet: Optional[str] = None,
        name: Optional[str] = None,
        tags: Optional[Sequence[str]] = None)
func NewVpc(ctx *Context, name string, args VpcArgs, opts ...ResourceOption) (*Vpc, error)
public Vpc(string name, VpcArgs args, CustomResourceOptions? opts = null)
public Vpc(String name, VpcArgs args)
public Vpc(String name, VpcArgs args, CustomResourceOptions options)
type: cloudamqp:Vpc
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. VpcArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. VpcArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. VpcArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. VpcArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. VpcArgs
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 vpcResource = new CloudAmqp.Vpc("vpcResource", new()
{
    Region = "string",
    Subnet = "string",
    Name = "string",
    Tags = new[]
    {
        "string",
    },
});
Copy
example, err := cloudamqp.NewVpc(ctx, "vpcResource", &cloudamqp.VpcArgs{
	Region: pulumi.String("string"),
	Subnet: pulumi.String("string"),
	Name:   pulumi.String("string"),
	Tags: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var vpcResource = new Vpc("vpcResource", VpcArgs.builder()
    .region("string")
    .subnet("string")
    .name("string")
    .tags("string")
    .build());
Copy
vpc_resource = cloudamqp.Vpc("vpcResource",
    region="string",
    subnet="string",
    name="string",
    tags=["string"])
Copy
const vpcResource = new cloudamqp.Vpc("vpcResource", {
    region: "string",
    subnet: "string",
    name: "string",
    tags: ["string"],
});
Copy
type: cloudamqp:Vpc
properties:
    name: string
    region: string
    subnet: string
    tags:
        - string
Copy

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

Region
This property is required.
Changes to this property will trigger replacement.
string
The hosted region for the managed standalone VPC
Subnet
This property is required.
Changes to this property will trigger replacement.
string
The VPC subnet
Name string
The name of the VPC.
Tags List<string>
Tag the VPC with optional tags
Region
This property is required.
Changes to this property will trigger replacement.
string
The hosted region for the managed standalone VPC
Subnet
This property is required.
Changes to this property will trigger replacement.
string
The VPC subnet
Name string
The name of the VPC.
Tags []string
Tag the VPC with optional tags
region
This property is required.
Changes to this property will trigger replacement.
String
The hosted region for the managed standalone VPC
subnet
This property is required.
Changes to this property will trigger replacement.
String
The VPC subnet
name String
The name of the VPC.
tags List<String>
Tag the VPC with optional tags
region
This property is required.
Changes to this property will trigger replacement.
string
The hosted region for the managed standalone VPC
subnet
This property is required.
Changes to this property will trigger replacement.
string
The VPC subnet
name string
The name of the VPC.
tags string[]
Tag the VPC with optional tags
region
This property is required.
Changes to this property will trigger replacement.
str
The hosted region for the managed standalone VPC
subnet
This property is required.
Changes to this property will trigger replacement.
str
The VPC subnet
name str
The name of the VPC.
tags Sequence[str]
Tag the VPC with optional tags
region
This property is required.
Changes to this property will trigger replacement.
String
The hosted region for the managed standalone VPC
subnet
This property is required.
Changes to this property will trigger replacement.
String
The VPC subnet
name String
The name of the VPC.
tags List<String>
Tag the VPC with optional tags

Outputs

All input properties are implicitly available as output properties. Additionally, the Vpc resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
VpcName string
VPC name given when hosted at the cloud provider
Id string
The provider-assigned unique ID for this managed resource.
VpcName string
VPC name given when hosted at the cloud provider
id String
The provider-assigned unique ID for this managed resource.
vpcName String
VPC name given when hosted at the cloud provider
id string
The provider-assigned unique ID for this managed resource.
vpcName string
VPC name given when hosted at the cloud provider
id str
The provider-assigned unique ID for this managed resource.
vpc_name str
VPC name given when hosted at the cloud provider
id String
The provider-assigned unique ID for this managed resource.
vpcName String
VPC name given when hosted at the cloud provider

Look up Existing Vpc Resource

Get an existing Vpc 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?: VpcState, opts?: CustomResourceOptions): Vpc
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        region: Optional[str] = None,
        subnet: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        vpc_name: Optional[str] = None) -> Vpc
func GetVpc(ctx *Context, name string, id IDInput, state *VpcState, opts ...ResourceOption) (*Vpc, error)
public static Vpc Get(string name, Input<string> id, VpcState? state, CustomResourceOptions? opts = null)
public static Vpc get(String name, Output<String> id, VpcState state, CustomResourceOptions options)
resources:  _:    type: cloudamqp:Vpc    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Name string
The name of the VPC.
Region Changes to this property will trigger replacement. string
The hosted region for the managed standalone VPC
Subnet Changes to this property will trigger replacement. string
The VPC subnet
Tags List<string>
Tag the VPC with optional tags
VpcName string
VPC name given when hosted at the cloud provider
Name string
The name of the VPC.
Region Changes to this property will trigger replacement. string
The hosted region for the managed standalone VPC
Subnet Changes to this property will trigger replacement. string
The VPC subnet
Tags []string
Tag the VPC with optional tags
VpcName string
VPC name given when hosted at the cloud provider
name String
The name of the VPC.
region Changes to this property will trigger replacement. String
The hosted region for the managed standalone VPC
subnet Changes to this property will trigger replacement. String
The VPC subnet
tags List<String>
Tag the VPC with optional tags
vpcName String
VPC name given when hosted at the cloud provider
name string
The name of the VPC.
region Changes to this property will trigger replacement. string
The hosted region for the managed standalone VPC
subnet Changes to this property will trigger replacement. string
The VPC subnet
tags string[]
Tag the VPC with optional tags
vpcName string
VPC name given when hosted at the cloud provider
name str
The name of the VPC.
region Changes to this property will trigger replacement. str
The hosted region for the managed standalone VPC
subnet Changes to this property will trigger replacement. str
The VPC subnet
tags Sequence[str]
Tag the VPC with optional tags
vpc_name str
VPC name given when hosted at the cloud provider
name String
The name of the VPC.
region Changes to this property will trigger replacement. String
The hosted region for the managed standalone VPC
subnet Changes to this property will trigger replacement. String
The VPC subnet
tags List<String>
Tag the VPC with optional tags
vpcName String
VPC name given when hosted at the cloud provider

Import

cloudamqp_vpc can be imported using the CloudAMQP VPC identifier.

$ pulumi import cloudamqp:index/vpc:Vpc <resource_name> <vpc_id>`
Copy

To retrieve the identifier for a VPC, either use CloudAMQP customer API.

Or use the data source cloudamqp_account_vpcs to list all available standalone VPCs for an account.

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

Package Details

Repository
CloudAMQP pulumi/pulumi-cloudamqp
License
Apache-2.0
Notes
This Pulumi package is based on the cloudamqp Terraform Provider.