@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
97 lines • 4.37 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.TrafficPolicyInstance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a Route53 traffic policy instance resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.route53.TrafficPolicyInstance("test", {
* name: "test.example.com",
* trafficPolicyId: "b3gb108f-ea6f-45a5-baab-9d112d8b4037",
* trafficPolicyVersion: 1,
* hostedZoneId: "Z033120931TAQO548OGJC",
* ttl: 360,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Route53 traffic policy instance using its id. For example:
*
* ```sh
* $ pulumi import aws:route53/trafficPolicyInstance:TrafficPolicyInstance test df579d9a-6396-410e-ac22-e7ad60cf9e7e
* ```
*/
class TrafficPolicyInstance extends pulumi.CustomResource {
/**
* Get an existing TrafficPolicyInstance 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 TrafficPolicyInstance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of TrafficPolicyInstance. 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'] === TrafficPolicyInstance.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["hostedZoneId"] = state ? state.hostedZoneId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["trafficPolicyId"] = state ? state.trafficPolicyId : undefined;
resourceInputs["trafficPolicyVersion"] = state ? state.trafficPolicyVersion : undefined;
resourceInputs["ttl"] = state ? state.ttl : undefined;
}
else {
const args = argsOrState;
if ((!args || args.hostedZoneId === undefined) && !opts.urn) {
throw new Error("Missing required property 'hostedZoneId'");
}
if ((!args || args.trafficPolicyId === undefined) && !opts.urn) {
throw new Error("Missing required property 'trafficPolicyId'");
}
if ((!args || args.trafficPolicyVersion === undefined) && !opts.urn) {
throw new Error("Missing required property 'trafficPolicyVersion'");
}
if ((!args || args.ttl === undefined) && !opts.urn) {
throw new Error("Missing required property 'ttl'");
}
resourceInputs["hostedZoneId"] = args ? args.hostedZoneId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["trafficPolicyId"] = args ? args.trafficPolicyId : undefined;
resourceInputs["trafficPolicyVersion"] = args ? args.trafficPolicyVersion : undefined;
resourceInputs["ttl"] = args ? args.ttl : undefined;
resourceInputs["arn"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TrafficPolicyInstance.__pulumiType, name, resourceInputs, opts);
}
}
exports.TrafficPolicyInstance = TrafficPolicyInstance;
/** @internal */
TrafficPolicyInstance.__pulumiType = 'aws:route53/trafficPolicyInstance:TrafficPolicyInstance';
//# sourceMappingURL=trafficPolicyInstance.js.map