UNPKG

@pulumi/aws

Version:

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

124 lines 4.73 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.ConfigurationAggregator = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an AWS Config Configuration Aggregator * * ## Example Usage * * ### Account Based Aggregation * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const account = new aws.cfg.ConfigurationAggregator("account", { * name: "example", * accountAggregationSource: { * accountIds: ["123456789012"], * regions: ["us-west-2"], * }, * }); * ``` * * ### Organization Based Aggregation * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const assumeRole = aws.iam.getPolicyDocument({ * statements: [{ * effect: "Allow", * principals: [{ * type: "Service", * identifiers: ["config.amazonaws.com"], * }], * actions: ["sts:AssumeRole"], * }], * }); * const organizationRole = new aws.iam.Role("organization", { * name: "example", * assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json), * }); * const organizationRolePolicyAttachment = new aws.iam.RolePolicyAttachment("organization", { * role: organizationRole.name, * policyArn: "arn:aws:iam::aws:policy/service-role/AWSConfigRoleForOrganizations", * }); * const organization = new aws.cfg.ConfigurationAggregator("organization", { * name: "example", * organizationAggregationSource: { * allRegions: true, * roleArn: organizationRole.arn, * }, * }, { * dependsOn: [organizationRolePolicyAttachment], * }); * ``` * * ## Import * * Using `pulumi import`, import Configuration Aggregators using the name. For example: * * ```sh * $ pulumi import aws:cfg/configurationAggregator:ConfigurationAggregator example foo * ``` */ class ConfigurationAggregator extends pulumi.CustomResource { /** * Get an existing ConfigurationAggregator 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 ConfigurationAggregator(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ConfigurationAggregator. 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'] === ConfigurationAggregator.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountAggregationSource"] = state?.accountAggregationSource; resourceInputs["arn"] = state?.arn; resourceInputs["name"] = state?.name; resourceInputs["organizationAggregationSource"] = state?.organizationAggregationSource; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; resourceInputs["accountAggregationSource"] = args?.accountAggregationSource; resourceInputs["name"] = args?.name; resourceInputs["organizationAggregationSource"] = args?.organizationAggregationSource; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ConfigurationAggregator.__pulumiType, name, resourceInputs, opts); } } exports.ConfigurationAggregator = ConfigurationAggregator; /** @internal */ ConfigurationAggregator.__pulumiType = 'aws:cfg/configurationAggregator:ConfigurationAggregator'; //# sourceMappingURL=configurationAggregator.js.map