@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
109 lines • 5.88 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.Organization = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to create an organization.
*
* !> **WARNING:** When migrating from a `featureSet` of `CONSOLIDATED_BILLING` to `ALL`, the Organization account owner will received an email stating the following: "You started the process to enable all features for your AWS organization. As part of that process, all member accounts that joined your organization by invitation must approve the change. You don’t need approval from member accounts that you directly created from within your AWS organization." After all member accounts have accepted the invitation, the Organization account owner must then finalize the changes via the [AWS Console](https://console.aws.amazon.com/organizations/home#/organization/settings/migration-progress). Until these steps are performed, the provider will perpetually show a difference, and the `DescribeOrganization` API will continue to show the `FeatureSet` as `CONSOLIDATED_BILLING`. See the [AWS Organizations documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) for more information.
*
* !> **WARNING:** [Warning from the AWS Docs](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html): "We recommend that you enable integration between AWS Organizations and the specified AWS service by using the console or commands that are provided by the specified service. Doing so ensures that the service is aware that it can create the resources that are required for the integration. How the service creates those resources in the organization's accounts depends on that service. For more information, see the documentation for the other AWS service."
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const org = new aws.organizations.Organization("org", {
* awsServiceAccessPrincipals: [
* "cloudtrail.amazonaws.com",
* "config.amazonaws.com",
* ],
* featureSet: "ALL",
* });
* ```
*
* ## Import
*
* ### Identity Schema
*
* #### Required
*
* * `id` (String) ID of the AWS Organizations organization.
*
* #### Optional
*
* * `account_id` (String) AWS Account where this resource is managed.
*
* Using `pulumi import`, import the AWS organization using the `id`. For example:
*
* console
*
* % pulumi import aws_organizations_organization.example o-1234567
*/
class Organization extends pulumi.CustomResource {
/**
* Get an existing Organization 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 Organization(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Organization. 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'] === Organization.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accounts"] = state?.accounts;
resourceInputs["arn"] = state?.arn;
resourceInputs["awsServiceAccessPrincipals"] = state?.awsServiceAccessPrincipals;
resourceInputs["enabledPolicyTypes"] = state?.enabledPolicyTypes;
resourceInputs["featureSet"] = state?.featureSet;
resourceInputs["masterAccountArn"] = state?.masterAccountArn;
resourceInputs["masterAccountEmail"] = state?.masterAccountEmail;
resourceInputs["masterAccountId"] = state?.masterAccountId;
resourceInputs["masterAccountName"] = state?.masterAccountName;
resourceInputs["nonMasterAccounts"] = state?.nonMasterAccounts;
resourceInputs["roots"] = state?.roots;
}
else {
const args = argsOrState;
resourceInputs["awsServiceAccessPrincipals"] = args?.awsServiceAccessPrincipals;
resourceInputs["enabledPolicyTypes"] = args?.enabledPolicyTypes;
resourceInputs["featureSet"] = args?.featureSet;
resourceInputs["accounts"] = undefined /*out*/;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["masterAccountArn"] = undefined /*out*/;
resourceInputs["masterAccountEmail"] = undefined /*out*/;
resourceInputs["masterAccountId"] = undefined /*out*/;
resourceInputs["masterAccountName"] = undefined /*out*/;
resourceInputs["nonMasterAccounts"] = undefined /*out*/;
resourceInputs["roots"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Organization.__pulumiType, name, resourceInputs, opts);
}
}
exports.Organization = Organization;
/** @internal */
Organization.__pulumiType = 'aws:organizations/organization:Organization';
//# sourceMappingURL=organization.js.map