1. Packages
  2. AWS
  3. API Docs
  4. organizations
  5. getAccount
AWS v7.15.0 published on Thursday, Dec 18, 2025 by Pulumi
aws logo
AWS v7.15.0 published on Thursday, Dec 18, 2025 by Pulumi

    Get information about an account in an organization.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.organizations.getAccount({
        accountId: "AWS ACCOUNT ID",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.organizations.get_account(account_id="AWS ACCOUNT ID")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := organizations.LookupAccount(ctx, &organizations.LookupAccountArgs{
    			AccountId: "AWS ACCOUNT ID",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Organizations.GetAccount.Invoke(new()
        {
            AccountId = "AWS ACCOUNT ID",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.organizations.OrganizationsFunctions;
    import com.pulumi.aws.organizations.inputs.GetAccountArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = OrganizationsFunctions.getAccount(GetAccountArgs.builder()
                .accountId("AWS ACCOUNT ID")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: aws:organizations:getAccount
          arguments:
            accountId: AWS ACCOUNT ID
    

    Using getAccount

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getAccount(args: GetAccountArgs, opts?: InvokeOptions): Promise<GetAccountResult>
    function getAccountOutput(args: GetAccountOutputArgs, opts?: InvokeOptions): Output<GetAccountResult>
    def get_account(account_id: Optional[str] = None,
                    tags: Optional[Mapping[str, str]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetAccountResult
    def get_account_output(account_id: Optional[pulumi.Input[str]] = None,
                    tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetAccountResult]
    func LookupAccount(ctx *Context, args *LookupAccountArgs, opts ...InvokeOption) (*LookupAccountResult, error)
    func LookupAccountOutput(ctx *Context, args *LookupAccountOutputArgs, opts ...InvokeOption) LookupAccountResultOutput

    > Note: This function is named LookupAccount in the Go SDK.

    public static class GetAccount 
    {
        public static Task<GetAccountResult> InvokeAsync(GetAccountArgs args, InvokeOptions? opts = null)
        public static Output<GetAccountResult> Invoke(GetAccountInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccountResult> getAccount(GetAccountArgs args, InvokeOptions options)
    public static Output<GetAccountResult> getAccount(GetAccountArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:organizations/getAccount:getAccount
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    Account ID number of a delegated administrator account in the organization.
    Tags Dictionary<string, string>
    Map of tags for the resource.
    AccountId string
    Account ID number of a delegated administrator account in the organization.
    Tags map[string]string
    Map of tags for the resource.
    accountId String
    Account ID number of a delegated administrator account in the organization.
    tags Map<String,String>
    Map of tags for the resource.
    accountId string
    Account ID number of a delegated administrator account in the organization.
    tags {[key: string]: string}
    Map of tags for the resource.
    account_id str
    Account ID number of a delegated administrator account in the organization.
    tags Mapping[str, str]
    Map of tags for the resource.
    accountId String
    Account ID number of a delegated administrator account in the organization.
    tags Map<String>
    Map of tags for the resource.

    getAccount Result

    The following output properties are available:

    AccountId string
    Arn string
    ARN of the organization.
    Email string
    Email address of the owner assigned to the new member account.
    Id string
    The provider-assigned unique ID for this managed resource.
    JoinedMethod string
    Method by which the account joined the organization.
    JoinedTimestamp string
    Date the account became a part of the organization.
    Name string
    Friendly name for the member account.
    ParentId string
    Parent Organizational Unit ID or Root ID for the account.
    State string
    State of the account in the organization.
    Tags Dictionary<string, string>
    Map of tags for the resource.
    AccountId string
    Arn string
    ARN of the organization.
    Email string
    Email address of the owner assigned to the new member account.
    Id string
    The provider-assigned unique ID for this managed resource.
    JoinedMethod string
    Method by which the account joined the organization.
    JoinedTimestamp string
    Date the account became a part of the organization.
    Name string
    Friendly name for the member account.
    ParentId string
    Parent Organizational Unit ID or Root ID for the account.
    State string
    State of the account in the organization.
    Tags map[string]string
    Map of tags for the resource.
    accountId String
    arn String
    ARN of the organization.
    email String
    Email address of the owner assigned to the new member account.
    id String
    The provider-assigned unique ID for this managed resource.
    joinedMethod String
    Method by which the account joined the organization.
    joinedTimestamp String
    Date the account became a part of the organization.
    name String
    Friendly name for the member account.
    parentId String
    Parent Organizational Unit ID or Root ID for the account.
    state String
    State of the account in the organization.
    tags Map<String,String>
    Map of tags for the resource.
    accountId string
    arn string
    ARN of the organization.
    email string
    Email address of the owner assigned to the new member account.
    id string
    The provider-assigned unique ID for this managed resource.
    joinedMethod string
    Method by which the account joined the organization.
    joinedTimestamp string
    Date the account became a part of the organization.
    name string
    Friendly name for the member account.
    parentId string
    Parent Organizational Unit ID or Root ID for the account.
    state string
    State of the account in the organization.
    tags {[key: string]: string}
    Map of tags for the resource.
    account_id str
    arn str
    ARN of the organization.
    email str
    Email address of the owner assigned to the new member account.
    id str
    The provider-assigned unique ID for this managed resource.
    joined_method str
    Method by which the account joined the organization.
    joined_timestamp str
    Date the account became a part of the organization.
    name str
    Friendly name for the member account.
    parent_id str
    Parent Organizational Unit ID or Root ID for the account.
    state str
    State of the account in the organization.
    tags Mapping[str, str]
    Map of tags for the resource.
    accountId String
    arn String
    ARN of the organization.
    email String
    Email address of the owner assigned to the new member account.
    id String
    The provider-assigned unique ID for this managed resource.
    joinedMethod String
    Method by which the account joined the organization.
    joinedTimestamp String
    Date the account became a part of the organization.
    name String
    Friendly name for the member account.
    parentId String
    Parent Organizational Unit ID or Root ID for the account.
    state String
    State of the account in the organization.
    tags Map<String>
    Map of tags for the resource.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v7.15.0 published on Thursday, Dec 18, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate