UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

96 lines 4.47 kB
"use strict"; // *** 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.ControlTowerControl = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Allows the application of pre-defined controls to organizational units. For more information on usage, please see the * [AWS Control Tower User Guide](https://docs.aws.amazon.com/controltower/latest/userguide/enable-guardrails.html). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getRegion({}); * const example = aws.organizations.getOrganization({}); * const exampleGetOrganizationalUnits = example.then(example => aws.organizations.getOrganizationalUnits({ * parentId: example.roots?.[0]?.id, * })); * const exampleControlTowerControl = new aws.controltower.ControlTowerControl("example", { * controlIdentifier: current.then(current => `arn:aws:controltower:${current.region}::control/AWS-GR_EC2_VOLUME_INUSE_CHECK`), * targetIdentifier: exampleGetOrganizationalUnits.then(exampleGetOrganizationalUnits => .filter(x => x.name == "Infrastructure").map(x => (x.arn))[0]), * parameters: [{ * key: "AllowedRegions", * value: JSON.stringify(["us-east-1"]), * }], * }); * ``` * * ## Import * * Using `pulumi import`, import Control Tower Controls using their `organizational_unit_arn/control_identifier`. For example: * * ```sh * $ pulumi import aws:controltower/controlTowerControl:ControlTowerControl example arn:aws:organizations::123456789101:ou/o-qqaejywet/ou-qg5o-ufbhdtv3,arn:aws:controltower:us-east-1::control/WTDSMKDKDNLE * ``` */ class ControlTowerControl extends pulumi.CustomResource { /** * Get an existing ControlTowerControl 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 ControlTowerControl(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ControlTowerControl. 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'] === ControlTowerControl.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["controlIdentifier"] = state?.controlIdentifier; resourceInputs["parameters"] = state?.parameters; resourceInputs["region"] = state?.region; resourceInputs["targetIdentifier"] = state?.targetIdentifier; } else { const args = argsOrState; if (args?.controlIdentifier === undefined && !opts.urn) { throw new Error("Missing required property 'controlIdentifier'"); } if (args?.targetIdentifier === undefined && !opts.urn) { throw new Error("Missing required property 'targetIdentifier'"); } resourceInputs["controlIdentifier"] = args?.controlIdentifier; resourceInputs["parameters"] = args?.parameters; resourceInputs["region"] = args?.region; resourceInputs["targetIdentifier"] = args?.targetIdentifier; resourceInputs["arn"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ControlTowerControl.__pulumiType, name, resourceInputs, opts); } } exports.ControlTowerControl = ControlTowerControl; /** @internal */ ControlTowerControl.__pulumiType = 'aws:controltower/controlTowerControl:ControlTowerControl'; //# sourceMappingURL=controlTowerControl.js.map