@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
152 lines • 5.19 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.ResolverRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a Route53 Resolver rule.
*
* ## Example Usage
*
* ### System rule
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const sys = new aws.route53.ResolverRule("sys", {
* domainName: "subdomain.example.com",
* ruleType: "SYSTEM",
* });
* ```
*
* ### Forward rule
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const fwd = new aws.route53.ResolverRule("fwd", {
* domainName: "example.com",
* name: "example",
* ruleType: "FORWARD",
* resolverEndpointId: foo.id,
* targetIps: [{
* ip: "123.45.67.89",
* }],
* tags: {
* Environment: "Prod",
* },
* });
* ```
*
* ### IPv6 Forward rule
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const fwd = new aws.route53.ResolverRule("fwd", {
* domainName: "example.com",
* name: "example",
* ruleType: "FORWARD",
* resolverEndpointId: foo.id,
* targetIps: [{
* ipv6: "2600:1f18:1686:2000:4e60:6e3e:258:da36",
* }],
* tags: {
* Environment: "Prod",
* },
* });
* ```
*
* ## Import
*
* ### Identity Schema
*
* #### Required
*
* * `id` - (String) ID of the Route53 Resolver rule.
*
* #### Optional
*
* * `account_id` (String) AWS Account where this resource is managed.
*
* * `region` (String) Region where this resource is managed.
*
* Using `pulumi import`, import Route53 Resolver rules using the `id`. For example:
*
* console
*
* % pulumi import aws_route53_resolver_rule.example rslvr-rr-0123456789abcdef0
*/
class ResolverRule extends pulumi.CustomResource {
/**
* Get an existing ResolverRule 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 ResolverRule(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ResolverRule. 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'] === ResolverRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["domainName"] = state?.domainName;
resourceInputs["name"] = state?.name;
resourceInputs["ownerId"] = state?.ownerId;
resourceInputs["region"] = state?.region;
resourceInputs["resolverEndpointId"] = state?.resolverEndpointId;
resourceInputs["ruleType"] = state?.ruleType;
resourceInputs["shareStatus"] = state?.shareStatus;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["targetIps"] = state?.targetIps;
}
else {
const args = argsOrState;
if (args?.domainName === undefined && !opts.urn) {
throw new Error("Missing required property 'domainName'");
}
if (args?.ruleType === undefined && !opts.urn) {
throw new Error("Missing required property 'ruleType'");
}
resourceInputs["domainName"] = args?.domainName;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["resolverEndpointId"] = args?.resolverEndpointId;
resourceInputs["ruleType"] = args?.ruleType;
resourceInputs["tags"] = args?.tags;
resourceInputs["targetIps"] = args?.targetIps;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["ownerId"] = undefined /*out*/;
resourceInputs["shareStatus"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ResolverRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.ResolverRule = ResolverRule;
/** @internal */
ResolverRule.__pulumiType = 'aws:route53/resolverRule:ResolverRule';
//# sourceMappingURL=resolverRule.js.map