@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
107 lines • 6.03 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.OrganizationManagedRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a Config Organization Managed Rule. More information about these rules can be found in the [Enabling AWS Config Rules Across all Accounts in Your Organization](https://docs.aws.amazon.com/config/latest/developerguide/config-rule-multi-account-deployment.html) and [AWS Config Managed Rules](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html) documentation. For working with Organization Custom Rules (those invoking a custom Lambda Function), see the `aws.cfg.OrganizationCustomRule` resource.
*
* > **NOTE:** This resource must be created in the Organization master account and rules will include the master account unless its ID is added to the `excludedAccounts` argument.
*
* > **NOTE:** Every Organization account except those configured in the `excludedAccounts` argument must have a Configuration Recorder with proper IAM permissions before the rule will successfully create or update. See also the `aws.cfg.Recorder` resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.organizations.Organization("example", {
* awsServiceAccessPrincipals: ["config-multiaccountsetup.amazonaws.com"],
* featureSet: "ALL",
* });
* const exampleOrganizationManagedRule = new aws.cfg.OrganizationManagedRule("example", {
* name: "example",
* ruleIdentifier: "IAM_PASSWORD_POLICY",
* }, {
* dependsOn: [example],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Config Organization Managed Rules using the name. For example:
*
* ```sh
* $ pulumi import aws:cfg/organizationManagedRule:OrganizationManagedRule example example
* ```
*/
class OrganizationManagedRule extends pulumi.CustomResource {
/**
* Get an existing OrganizationManagedRule 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 OrganizationManagedRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of OrganizationManagedRule. 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'] === OrganizationManagedRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["excludedAccounts"] = state ? state.excludedAccounts : undefined;
resourceInputs["inputParameters"] = state ? state.inputParameters : undefined;
resourceInputs["maximumExecutionFrequency"] = state ? state.maximumExecutionFrequency : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["resourceIdScope"] = state ? state.resourceIdScope : undefined;
resourceInputs["resourceTypesScopes"] = state ? state.resourceTypesScopes : undefined;
resourceInputs["ruleIdentifier"] = state ? state.ruleIdentifier : undefined;
resourceInputs["tagKeyScope"] = state ? state.tagKeyScope : undefined;
resourceInputs["tagValueScope"] = state ? state.tagValueScope : undefined;
}
else {
const args = argsOrState;
if ((!args || args.ruleIdentifier === undefined) && !opts.urn) {
throw new Error("Missing required property 'ruleIdentifier'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["excludedAccounts"] = args ? args.excludedAccounts : undefined;
resourceInputs["inputParameters"] = args ? args.inputParameters : undefined;
resourceInputs["maximumExecutionFrequency"] = args ? args.maximumExecutionFrequency : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["resourceIdScope"] = args ? args.resourceIdScope : undefined;
resourceInputs["resourceTypesScopes"] = args ? args.resourceTypesScopes : undefined;
resourceInputs["ruleIdentifier"] = args ? args.ruleIdentifier : undefined;
resourceInputs["tagKeyScope"] = args ? args.tagKeyScope : undefined;
resourceInputs["tagValueScope"] = args ? args.tagValueScope : undefined;
resourceInputs["arn"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(OrganizationManagedRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.OrganizationManagedRule = OrganizationManagedRule;
/** @internal */
OrganizationManagedRule.__pulumiType = 'aws:cfg/organizationManagedRule:OrganizationManagedRule';
//# sourceMappingURL=organizationManagedRule.js.map