@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
154 lines (153 loc) • 5.68 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as outputs from "../types/output";
/**
* Get information about the organization that the users account belongs to.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.organizations.getOrganization({});
* export const accountIds = example.then(example => example.accounts.map(__item => __item.id));
* ```
*
* ### Limit SNS Topic Access to an Organization
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.organizations.getOrganization({});
* const snsTopic = new aws.sns.Topic("sns_topic", {name: "my-sns-topic"});
* const snsTopicPolicy = pulumi.all([example, snsTopic.arn]).apply(([example, arn]) => aws.iam.getPolicyDocumentOutput({
* statements: [{
* effect: "Allow",
* actions: [
* "SNS:Subscribe",
* "SNS:Publish",
* ],
* conditions: [{
* test: "StringEquals",
* variable: "aws:PrincipalOrgID",
* values: [example.id],
* }],
* principals: [{
* type: "AWS",
* identifiers: ["*"],
* }],
* resources: [arn],
* }],
* }));
* const snsTopicPolicyTopicPolicy = new aws.sns.TopicPolicy("sns_topic_policy", {
* arn: snsTopic.arn,
* policy: snsTopicPolicy.apply(snsTopicPolicy => snsTopicPolicy.json),
* });
* ```
*/
export declare function getOrganization(opts?: pulumi.InvokeOptions): Promise<GetOrganizationResult>;
/**
* A collection of values returned by getOrganization.
*/
export interface GetOrganizationResult {
/**
* List of organization accounts including the master account. For a list excluding the master account, see the `nonMasterAccounts` attribute. All elements have these attributes:
*/
readonly accounts: outputs.organizations.GetOrganizationAccount[];
/**
* ARN of the root.
*/
readonly arn: string;
/**
* A list of AWS service principal names that have integration enabled with your organization. Organization must have `featureSet` set to `ALL`. For additional information, see the [AWS Organizations User Guide](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html).
*/
readonly awsServiceAccessPrincipals: string[];
/**
* A list of Organizations policy types that are enabled in the Organization Root. Organization must have `featureSet` set to `ALL`. For additional information about valid policy types (e.g., `SERVICE_CONTROL_POLICY`), see the [AWS Organizations API Reference](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnablePolicyType.html).
*/
readonly enabledPolicyTypes: string[];
/**
* FeatureSet of the organization.
*/
readonly featureSet: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* ARN of the account that is designated as the master account for the organization.
*/
readonly masterAccountArn: string;
/**
* The email address that is associated with the AWS account that is designated as the master account for the organization.
*/
readonly masterAccountEmail: string;
/**
* Unique identifier (ID) of the master account of an organization.
*/
readonly masterAccountId: string;
/**
* Name of the master account of an organization.
*/
readonly masterAccountName: string;
/**
* List of organization accounts excluding the master account. For a list including the master account, see the `accounts` attribute. All elements have these attributes:
*/
readonly nonMasterAccounts: outputs.organizations.GetOrganizationNonMasterAccount[];
/**
* List of organization roots. All elements have these attributes:
*/
readonly roots: outputs.organizations.GetOrganizationRoot[];
}
/**
* Get information about the organization that the users account belongs to.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.organizations.getOrganization({});
* export const accountIds = example.then(example => example.accounts.map(__item => __item.id));
* ```
*
* ### Limit SNS Topic Access to an Organization
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.organizations.getOrganization({});
* const snsTopic = new aws.sns.Topic("sns_topic", {name: "my-sns-topic"});
* const snsTopicPolicy = pulumi.all([example, snsTopic.arn]).apply(([example, arn]) => aws.iam.getPolicyDocumentOutput({
* statements: [{
* effect: "Allow",
* actions: [
* "SNS:Subscribe",
* "SNS:Publish",
* ],
* conditions: [{
* test: "StringEquals",
* variable: "aws:PrincipalOrgID",
* values: [example.id],
* }],
* principals: [{
* type: "AWS",
* identifiers: ["*"],
* }],
* resources: [arn],
* }],
* }));
* const snsTopicPolicyTopicPolicy = new aws.sns.TopicPolicy("sns_topic_policy", {
* arn: snsTopic.arn,
* policy: snsTopicPolicy.apply(snsTopicPolicy => snsTopicPolicy.json),
* });
* ```
*/
export declare function getOrganizationOutput(opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetOrganizationResult>;