@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
157 lines • 7.39 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Vpc = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a VPC resource.
*
* ## Example Usage
*
* Basic usage:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const main = new aws.ec2.Vpc("main", {cidrBlock: "10.0.0.0/16"});
* ```
*
* Basic usage with tags:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const main = new aws.ec2.Vpc("main", {
* cidrBlock: "10.0.0.0/16",
* instanceTenancy: "default",
* tags: {
* Name: "main",
* },
* });
* ```
*
* VPC with CIDR from AWS IPAM:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getRegion({});
* const test = new aws.ec2.VpcIpam("test", {operatingRegions: [{
* regionName: current.then(current => current.region),
* }]});
* const testVpcIpamPool = new aws.ec2.VpcIpamPool("test", {
* addressFamily: "ipv4",
* ipamScopeId: test.privateDefaultScopeId,
* locale: current.then(current => current.region),
* });
* const testVpcIpamPoolCidr = new aws.ec2.VpcIpamPoolCidr("test", {
* ipamPoolId: testVpcIpamPool.id,
* cidr: "172.20.0.0/16",
* });
* const testVpc = new aws.ec2.Vpc("test", {
* ipv4IpamPoolId: testVpcIpamPool.id,
* ipv4NetmaskLength: 28,
* }, {
* dependsOn: [testVpcIpamPoolCidr],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import VPCs using the VPC `id`. For example:
*
* ```sh
* $ pulumi import aws:ec2/vpc:Vpc test_vpc vpc-a01106c2
* ```
*/
class Vpc extends pulumi.CustomResource {
/**
* Get an existing Vpc 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, id, state, opts) {
return new Vpc(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Vpc. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Vpc.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["assignGeneratedIpv6CidrBlock"] = state ? state.assignGeneratedIpv6CidrBlock : undefined;
resourceInputs["cidrBlock"] = state ? state.cidrBlock : undefined;
resourceInputs["defaultNetworkAclId"] = state ? state.defaultNetworkAclId : undefined;
resourceInputs["defaultRouteTableId"] = state ? state.defaultRouteTableId : undefined;
resourceInputs["defaultSecurityGroupId"] = state ? state.defaultSecurityGroupId : undefined;
resourceInputs["dhcpOptionsId"] = state ? state.dhcpOptionsId : undefined;
resourceInputs["enableDnsHostnames"] = state ? state.enableDnsHostnames : undefined;
resourceInputs["enableDnsSupport"] = state ? state.enableDnsSupport : undefined;
resourceInputs["enableNetworkAddressUsageMetrics"] = state ? state.enableNetworkAddressUsageMetrics : undefined;
resourceInputs["instanceTenancy"] = state ? state.instanceTenancy : undefined;
resourceInputs["ipv4IpamPoolId"] = state ? state.ipv4IpamPoolId : undefined;
resourceInputs["ipv4NetmaskLength"] = state ? state.ipv4NetmaskLength : undefined;
resourceInputs["ipv6AssociationId"] = state ? state.ipv6AssociationId : undefined;
resourceInputs["ipv6CidrBlock"] = state ? state.ipv6CidrBlock : undefined;
resourceInputs["ipv6CidrBlockNetworkBorderGroup"] = state ? state.ipv6CidrBlockNetworkBorderGroup : undefined;
resourceInputs["ipv6IpamPoolId"] = state ? state.ipv6IpamPoolId : undefined;
resourceInputs["ipv6NetmaskLength"] = state ? state.ipv6NetmaskLength : undefined;
resourceInputs["mainRouteTableId"] = state ? state.mainRouteTableId : undefined;
resourceInputs["ownerId"] = state ? state.ownerId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
}
else {
const args = argsOrState;
resourceInputs["assignGeneratedIpv6CidrBlock"] = args ? args.assignGeneratedIpv6CidrBlock : undefined;
resourceInputs["cidrBlock"] = args ? args.cidrBlock : undefined;
resourceInputs["enableDnsHostnames"] = args ? args.enableDnsHostnames : undefined;
resourceInputs["enableDnsSupport"] = args ? args.enableDnsSupport : undefined;
resourceInputs["enableNetworkAddressUsageMetrics"] = args ? args.enableNetworkAddressUsageMetrics : undefined;
resourceInputs["instanceTenancy"] = args ? args.instanceTenancy : undefined;
resourceInputs["ipv4IpamPoolId"] = args ? args.ipv4IpamPoolId : undefined;
resourceInputs["ipv4NetmaskLength"] = args ? args.ipv4NetmaskLength : undefined;
resourceInputs["ipv6CidrBlock"] = args ? args.ipv6CidrBlock : undefined;
resourceInputs["ipv6CidrBlockNetworkBorderGroup"] = args ? args.ipv6CidrBlockNetworkBorderGroup : undefined;
resourceInputs["ipv6IpamPoolId"] = args ? args.ipv6IpamPoolId : undefined;
resourceInputs["ipv6NetmaskLength"] = args ? args.ipv6NetmaskLength : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["defaultNetworkAclId"] = undefined /*out*/;
resourceInputs["defaultRouteTableId"] = undefined /*out*/;
resourceInputs["defaultSecurityGroupId"] = undefined /*out*/;
resourceInputs["dhcpOptionsId"] = undefined /*out*/;
resourceInputs["ipv6AssociationId"] = undefined /*out*/;
resourceInputs["mainRouteTableId"] = undefined /*out*/;
resourceInputs["ownerId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Vpc.__pulumiType, name, resourceInputs, opts);
}
}
exports.Vpc = Vpc;
/** @internal */
Vpc.__pulumiType = 'aws:ec2/vpc:Vpc';
//# sourceMappingURL=vpc.js.map