1. Packages
  2. AWS
  3. API Docs
  4. cloudtrail
  5. OrganizationDelegatedAdminAccount
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.cloudtrail.OrganizationDelegatedAdminAccount

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Provides a resource to manage an AWS CloudTrail Delegated Administrator.

    Example Usage

    Basic usage:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const delegated = aws.getCallerIdentity({});
    const example = new aws.cloudtrail.OrganizationDelegatedAdminAccount("example", {accountId: delegated.then(delegated => delegated.accountId)});
    
    import pulumi
    import pulumi_aws as aws
    
    delegated = aws.get_caller_identity()
    example = aws.cloudtrail.OrganizationDelegatedAdminAccount("example", account_id=delegated.account_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudtrail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		delegated, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = cloudtrail.NewOrganizationDelegatedAdminAccount(ctx, "example", &cloudtrail.OrganizationDelegatedAdminAccountArgs{
    			AccountId: pulumi.String(delegated.AccountId),
    		})
    		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 delegated = Aws.GetCallerIdentity.Invoke();
    
        var example = new Aws.CloudTrail.OrganizationDelegatedAdminAccount("example", new()
        {
            AccountId = delegated.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.AwsFunctions;
    import com.pulumi.aws.inputs.GetCallerIdentityArgs;
    import com.pulumi.aws.cloudtrail.OrganizationDelegatedAdminAccount;
    import com.pulumi.aws.cloudtrail.OrganizationDelegatedAdminAccountArgs;
    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 delegated = AwsFunctions.getCallerIdentity();
    
            var example = new OrganizationDelegatedAdminAccount("example", OrganizationDelegatedAdminAccountArgs.builder()
                .accountId(delegated.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:cloudtrail:OrganizationDelegatedAdminAccount
        properties:
          accountId: ${delegated.accountId}
    variables:
      delegated:
        fn::invoke:
          Function: aws:getCallerIdentity
          Arguments: {}
    

    Create OrganizationDelegatedAdminAccount Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new OrganizationDelegatedAdminAccount(name: string, args: OrganizationDelegatedAdminAccountArgs, opts?: CustomResourceOptions);
    @overload
    def OrganizationDelegatedAdminAccount(resource_name: str,
                                          args: OrganizationDelegatedAdminAccountArgs,
                                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrganizationDelegatedAdminAccount(resource_name: str,
                                          opts: Optional[ResourceOptions] = None,
                                          account_id: Optional[str] = None)
    func NewOrganizationDelegatedAdminAccount(ctx *Context, name string, args OrganizationDelegatedAdminAccountArgs, opts ...ResourceOption) (*OrganizationDelegatedAdminAccount, error)
    public OrganizationDelegatedAdminAccount(string name, OrganizationDelegatedAdminAccountArgs args, CustomResourceOptions? opts = null)
    public OrganizationDelegatedAdminAccount(String name, OrganizationDelegatedAdminAccountArgs args)
    public OrganizationDelegatedAdminAccount(String name, OrganizationDelegatedAdminAccountArgs args, CustomResourceOptions options)
    
    type: aws:cloudtrail:OrganizationDelegatedAdminAccount
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args OrganizationDelegatedAdminAccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args OrganizationDelegatedAdminAccountArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args OrganizationDelegatedAdminAccountArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrganizationDelegatedAdminAccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrganizationDelegatedAdminAccountArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var organizationDelegatedAdminAccountResource = new Aws.CloudTrail.OrganizationDelegatedAdminAccount("organizationDelegatedAdminAccountResource", new()
    {
        AccountId = "string",
    });
    
    example, err := cloudtrail.NewOrganizationDelegatedAdminAccount(ctx, "organizationDelegatedAdminAccountResource", &cloudtrail.OrganizationDelegatedAdminAccountArgs{
    	AccountId: pulumi.String("string"),
    })
    
    var organizationDelegatedAdminAccountResource = new OrganizationDelegatedAdminAccount("organizationDelegatedAdminAccountResource", OrganizationDelegatedAdminAccountArgs.builder()
        .accountId("string")
        .build());
    
    organization_delegated_admin_account_resource = aws.cloudtrail.OrganizationDelegatedAdminAccount("organizationDelegatedAdminAccountResource", account_id="string")
    
    const organizationDelegatedAdminAccountResource = new aws.cloudtrail.OrganizationDelegatedAdminAccount("organizationDelegatedAdminAccountResource", {accountId: "string"});
    
    type: aws:cloudtrail:OrganizationDelegatedAdminAccount
    properties:
        accountId: string
    

    OrganizationDelegatedAdminAccount Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The OrganizationDelegatedAdminAccount resource accepts the following input properties:

    AccountId string
    An organization member account ID that you want to designate as a delegated administrator.
    AccountId string
    An organization member account ID that you want to designate as a delegated administrator.
    accountId String
    An organization member account ID that you want to designate as a delegated administrator.
    accountId string
    An organization member account ID that you want to designate as a delegated administrator.
    account_id str
    An organization member account ID that you want to designate as a delegated administrator.
    accountId String
    An organization member account ID that you want to designate as a delegated administrator.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the OrganizationDelegatedAdminAccount resource produces the following output properties:

    Arn string
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    Email string
    The email address that is associated with the delegated administrator's AWS account.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The friendly name of the delegated administrator's account.
    ServicePrincipal string
    The AWS CloudTrail service principal name.
    Arn string
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    Email string
    The email address that is associated with the delegated administrator's AWS account.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The friendly name of the delegated administrator's account.
    ServicePrincipal string
    The AWS CloudTrail service principal name.
    arn String
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    email String
    The email address that is associated with the delegated administrator's AWS account.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The friendly name of the delegated administrator's account.
    servicePrincipal String
    The AWS CloudTrail service principal name.
    arn string
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    email string
    The email address that is associated with the delegated administrator's AWS account.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The friendly name of the delegated administrator's account.
    servicePrincipal string
    The AWS CloudTrail service principal name.
    arn str
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    email str
    The email address that is associated with the delegated administrator's AWS account.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The friendly name of the delegated administrator's account.
    service_principal str
    The AWS CloudTrail service principal name.
    arn String
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    email String
    The email address that is associated with the delegated administrator's AWS account.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The friendly name of the delegated administrator's account.
    servicePrincipal String
    The AWS CloudTrail service principal name.

    Look up Existing OrganizationDelegatedAdminAccount Resource

    Get an existing OrganizationDelegatedAdminAccount resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: OrganizationDelegatedAdminAccountState, opts?: CustomResourceOptions): OrganizationDelegatedAdminAccount
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            arn: Optional[str] = None,
            email: Optional[str] = None,
            name: Optional[str] = None,
            service_principal: Optional[str] = None) -> OrganizationDelegatedAdminAccount
    func GetOrganizationDelegatedAdminAccount(ctx *Context, name string, id IDInput, state *OrganizationDelegatedAdminAccountState, opts ...ResourceOption) (*OrganizationDelegatedAdminAccount, error)
    public static OrganizationDelegatedAdminAccount Get(string name, Input<string> id, OrganizationDelegatedAdminAccountState? state, CustomResourceOptions? opts = null)
    public static OrganizationDelegatedAdminAccount get(String name, Output<String> id, OrganizationDelegatedAdminAccountState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccountId string
    An organization member account ID that you want to designate as a delegated administrator.
    Arn string
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    Email string
    The email address that is associated with the delegated administrator's AWS account.
    Name string
    The friendly name of the delegated administrator's account.
    ServicePrincipal string
    The AWS CloudTrail service principal name.
    AccountId string
    An organization member account ID that you want to designate as a delegated administrator.
    Arn string
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    Email string
    The email address that is associated with the delegated administrator's AWS account.
    Name string
    The friendly name of the delegated administrator's account.
    ServicePrincipal string
    The AWS CloudTrail service principal name.
    accountId String
    An organization member account ID that you want to designate as a delegated administrator.
    arn String
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    email String
    The email address that is associated with the delegated administrator's AWS account.
    name String
    The friendly name of the delegated administrator's account.
    servicePrincipal String
    The AWS CloudTrail service principal name.
    accountId string
    An organization member account ID that you want to designate as a delegated administrator.
    arn string
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    email string
    The email address that is associated with the delegated administrator's AWS account.
    name string
    The friendly name of the delegated administrator's account.
    servicePrincipal string
    The AWS CloudTrail service principal name.
    account_id str
    An organization member account ID that you want to designate as a delegated administrator.
    arn str
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    email str
    The email address that is associated with the delegated administrator's AWS account.
    name str
    The friendly name of the delegated administrator's account.
    service_principal str
    The AWS CloudTrail service principal name.
    accountId String
    An organization member account ID that you want to designate as a delegated administrator.
    arn String
    The Amazon Resource Name (ARN) of the delegated administrator's account.
    email String
    The email address that is associated with the delegated administrator's AWS account.
    name String
    The friendly name of the delegated administrator's account.
    servicePrincipal String
    The AWS CloudTrail service principal name.

    Import

    Using pulumi import, import delegated administrators using the delegate account id. For example:

    $ pulumi import aws:cloudtrail/organizationDelegatedAdminAccount:OrganizationDelegatedAdminAccount example 12345678901
    

    To learn more about importing existing cloud resources, see Importing resources.

    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 v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi