@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
87 lines • 3.35 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.CidrLocation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a Route53 CIDR location resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.route53.CidrCollection("example", {name: "collection-1"});
* const exampleCidrLocation = new aws.route53.CidrLocation("example", {
* cidrCollectionId: example.id,
* name: "office",
* cidrBlocks: [
* "200.5.3.0/24",
* "200.6.3.0/24",
* ],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import CIDR locations using their the CIDR collection ID and location name. For example:
*
* ```sh
* $ pulumi import aws:route53/cidrLocation:CidrLocation example 9ac32814-3e67-0932-6048-8d779cc6f511,office
* ```
*/
class CidrLocation extends pulumi.CustomResource {
/**
* Get an existing CidrLocation 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 CidrLocation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of CidrLocation. 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'] === CidrLocation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cidrBlocks"] = state?.cidrBlocks;
resourceInputs["cidrCollectionId"] = state?.cidrCollectionId;
resourceInputs["name"] = state?.name;
}
else {
const args = argsOrState;
if (args?.cidrBlocks === undefined && !opts.urn) {
throw new Error("Missing required property 'cidrBlocks'");
}
if (args?.cidrCollectionId === undefined && !opts.urn) {
throw new Error("Missing required property 'cidrCollectionId'");
}
resourceInputs["cidrBlocks"] = args?.cidrBlocks;
resourceInputs["cidrCollectionId"] = args?.cidrCollectionId;
resourceInputs["name"] = args?.name;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CidrLocation.__pulumiType, name, resourceInputs, opts);
}
}
exports.CidrLocation = CidrLocation;
/** @internal */
CidrLocation.__pulumiType = 'aws:route53/cidrLocation:CidrLocation';
//# sourceMappingURL=cidrLocation.js.map