1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cfg
  5. Aggregator
Alibaba Cloud v3.88.0 published on Saturday, Nov 1, 2025 by Pulumi

alicloud.cfg.Aggregator

Start a Neo task
Explain and create an alicloud.cfg.Aggregator resource
alicloud logo
Alibaba Cloud v3.88.0 published on Saturday, Nov 1, 2025 by Pulumi

    Provides a Cloud Config (Config) Aggregator resource.

    For information about Cloud Config (Config) Aggregator and how to use it, see What is Aggregator.

    NOTE: Available since v1.124.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf_example";
    const _default = alicloud.resourcemanager.getAccounts({
        status: "CreateSuccess",
    });
    const last = _default.then(_default => _default.accounts).length.apply(length => length - 1);
    const defaultAggregator = new alicloud.cfg.Aggregator("default", {
        aggregatorAccounts: [{
            accountId: _default.then(_default => _default.accounts[last].accountId),
            accountName: _default.then(_default => _default.accounts[last].displayName),
            accountType: "ResourceDirectory",
        }],
        aggregatorName: name,
        description: name,
        aggregatorType: "CUSTOM",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf_example"
    default = alicloud.resourcemanager.get_accounts(status="CreateSuccess")
    last = len(default.accounts).apply(lambda length: length - 1)
    default_aggregator = alicloud.cfg.Aggregator("default",
        aggregator_accounts=[{
            "account_id": default.accounts[last].account_id,
            "account_name": default.accounts[last].display_name,
            "account_type": "ResourceDirectory",
        }],
        aggregator_name=name,
        description=name,
        aggregator_type="CUSTOM")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cfg"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf_example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := resourcemanager.GetAccounts(ctx, &resourcemanager.GetAccountsArgs{
    			Status: pulumi.StringRef("CreateSuccess"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		last := len(_default.Accounts).ApplyT(func(length int) (float64, error) {
    			return length - 1, nil
    		}).(pulumi.Float64Output)
    		_, err = cfg.NewAggregator(ctx, "default", &cfg.AggregatorArgs{
    			AggregatorAccounts: cfg.AggregatorAggregatorAccountArray{
    				&cfg.AggregatorAggregatorAccountArgs{
    					AccountId:   pulumi.String(_default.Accounts[last].AccountId),
    					AccountName: pulumi.String(_default.Accounts[last].DisplayName),
    					AccountType: pulumi.String("ResourceDirectory"),
    				},
    			},
    			AggregatorName: pulumi.String(name),
    			Description:    pulumi.String(name),
    			AggregatorType: pulumi.String("CUSTOM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf_example";
        var @default = AliCloud.ResourceManager.GetAccounts.Invoke(new()
        {
            Status = "CreateSuccess",
        });
    
        var last = @default.Apply(@default => @default.Apply(getAccountsResult => getAccountsResult.Accounts)).Length.Apply(length => length - 1);
    
        var defaultAggregator = new AliCloud.Cfg.Aggregator("default", new()
        {
            AggregatorAccounts = new[]
            {
                new AliCloud.Cfg.Inputs.AggregatorAggregatorAccountArgs
                {
                    AccountId = @default.Apply(@default => @default.Apply(getAccountsResult => getAccountsResult.Accounts)[last].AccountId),
                    AccountName = @default.Apply(@default => @default.Apply(getAccountsResult => getAccountsResult.Accounts)[last].DisplayName),
                    AccountType = "ResourceDirectory",
                },
            },
            AggregatorName = name,
            Description = name,
            AggregatorType = "CUSTOM",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
    import com.pulumi.alicloud.resourcemanager.inputs.GetAccountsArgs;
    import com.pulumi.alicloud.cfg.Aggregator;
    import com.pulumi.alicloud.cfg.AggregatorArgs;
    import com.pulumi.alicloud.cfg.inputs.AggregatorAggregatorAccountArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("tf_example");
            final var default = ResourcemanagerFunctions.getAccounts(GetAccountsArgs.builder()
                .status("CreateSuccess")
                .build());
    
            final var last = default_.accounts().length().applyValue(_length -> _length - 1);
    
            var defaultAggregator = new Aggregator("defaultAggregator", AggregatorArgs.builder()
                .aggregatorAccounts(AggregatorAggregatorAccountArgs.builder()
                    .accountId(default_.accounts()[last].accountId())
                    .accountName(default_.accounts()[last].displayName())
                    .accountType("ResourceDirectory")
                    .build())
                .aggregatorName(name)
                .description(name)
                .aggregatorType("CUSTOM")
                .build());
    
        }
    }
    
    Example coming soon!
    

    Create Aggregator Resource

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

    Constructor syntax

    new Aggregator(name: string, args: AggregatorArgs, opts?: CustomResourceOptions);
    @overload
    def Aggregator(resource_name: str,
                   args: AggregatorArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def Aggregator(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   aggregator_name: Optional[str] = None,
                   description: Optional[str] = None,
                   aggregator_accounts: Optional[Sequence[AggregatorAggregatorAccountArgs]] = None,
                   aggregator_type: Optional[str] = None,
                   folder_id: Optional[str] = None)
    func NewAggregator(ctx *Context, name string, args AggregatorArgs, opts ...ResourceOption) (*Aggregator, error)
    public Aggregator(string name, AggregatorArgs args, CustomResourceOptions? opts = null)
    public Aggregator(String name, AggregatorArgs args)
    public Aggregator(String name, AggregatorArgs args, CustomResourceOptions options)
    
    type: alicloud:cfg:Aggregator
    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 AggregatorArgs
    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 AggregatorArgs
    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 AggregatorArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AggregatorArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AggregatorArgs
    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 aggregatorResource = new AliCloud.Cfg.Aggregator("aggregatorResource", new()
    {
        AggregatorName = "string",
        Description = "string",
        AggregatorAccounts = new[]
        {
            new AliCloud.Cfg.Inputs.AggregatorAggregatorAccountArgs
            {
                AccountId = "string",
                AccountName = "string",
                AccountType = "string",
            },
        },
        AggregatorType = "string",
        FolderId = "string",
    });
    
    example, err := cfg.NewAggregator(ctx, "aggregatorResource", &cfg.AggregatorArgs{
    	AggregatorName: pulumi.String("string"),
    	Description:    pulumi.String("string"),
    	AggregatorAccounts: cfg.AggregatorAggregatorAccountArray{
    		&cfg.AggregatorAggregatorAccountArgs{
    			AccountId:   pulumi.String("string"),
    			AccountName: pulumi.String("string"),
    			AccountType: pulumi.String("string"),
    		},
    	},
    	AggregatorType: pulumi.String("string"),
    	FolderId:       pulumi.String("string"),
    })
    
    var aggregatorResource = new Aggregator("aggregatorResource", AggregatorArgs.builder()
        .aggregatorName("string")
        .description("string")
        .aggregatorAccounts(AggregatorAggregatorAccountArgs.builder()
            .accountId("string")
            .accountName("string")
            .accountType("string")
            .build())
        .aggregatorType("string")
        .folderId("string")
        .build());
    
    aggregator_resource = alicloud.cfg.Aggregator("aggregatorResource",
        aggregator_name="string",
        description="string",
        aggregator_accounts=[{
            "account_id": "string",
            "account_name": "string",
            "account_type": "string",
        }],
        aggregator_type="string",
        folder_id="string")
    
    const aggregatorResource = new alicloud.cfg.Aggregator("aggregatorResource", {
        aggregatorName: "string",
        description: "string",
        aggregatorAccounts: [{
            accountId: "string",
            accountName: "string",
            accountType: "string",
        }],
        aggregatorType: "string",
        folderId: "string",
    });
    
    type: alicloud:cfg:Aggregator
    properties:
        aggregatorAccounts:
            - accountId: string
              accountName: string
              accountType: string
        aggregatorName: string
        aggregatorType: string
        description: string
        folderId: string
    

    Aggregator 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 Aggregator resource accepts the following input properties:

    AggregatorName string
    The name of the account group.
    Description string
    The description of the account group.
    AggregatorAccounts List<Pulumi.AliCloud.Cfg.Inputs.AggregatorAggregatorAccount>

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    AggregatorType string
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    FolderId string
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.
    AggregatorName string
    The name of the account group.
    Description string
    The description of the account group.
    AggregatorAccounts []AggregatorAggregatorAccountArgs

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    AggregatorType string
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    FolderId string
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.
    aggregatorName String
    The name of the account group.
    description String
    The description of the account group.
    aggregatorAccounts List<AggregatorAggregatorAccount>

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    aggregatorType String
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    folderId String
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.
    aggregatorName string
    The name of the account group.
    description string
    The description of the account group.
    aggregatorAccounts AggregatorAggregatorAccount[]

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    aggregatorType string
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    folderId string
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.
    aggregator_name str
    The name of the account group.
    description str
    The description of the account group.
    aggregator_accounts Sequence[AggregatorAggregatorAccountArgs]

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    aggregator_type str
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    folder_id str
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.
    aggregatorName String
    The name of the account group.
    description String
    The description of the account group.
    aggregatorAccounts List<Property Map>

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    aggregatorType String
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    folderId String
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.

    Outputs

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

    CreateTime int
    (Available since v1.262.0) The timestamp when the account group was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the account group.
    CreateTime int
    (Available since v1.262.0) The timestamp when the account group was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the account group.
    createTime Integer
    (Available since v1.262.0) The timestamp when the account group was created.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the account group.
    createTime number
    (Available since v1.262.0) The timestamp when the account group was created.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the account group.
    create_time int
    (Available since v1.262.0) The timestamp when the account group was created.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the account group.
    createTime Number
    (Available since v1.262.0) The timestamp when the account group was created.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the account group.

    Look up Existing Aggregator Resource

    Get an existing Aggregator 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?: AggregatorState, opts?: CustomResourceOptions): Aggregator
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            aggregator_accounts: Optional[Sequence[AggregatorAggregatorAccountArgs]] = None,
            aggregator_name: Optional[str] = None,
            aggregator_type: Optional[str] = None,
            create_time: Optional[int] = None,
            description: Optional[str] = None,
            folder_id: Optional[str] = None,
            status: Optional[str] = None) -> Aggregator
    func GetAggregator(ctx *Context, name string, id IDInput, state *AggregatorState, opts ...ResourceOption) (*Aggregator, error)
    public static Aggregator Get(string name, Input<string> id, AggregatorState? state, CustomResourceOptions? opts = null)
    public static Aggregator get(String name, Output<String> id, AggregatorState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:cfg:Aggregator    get:      id: ${id}
    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:
    AggregatorAccounts List<Pulumi.AliCloud.Cfg.Inputs.AggregatorAggregatorAccount>

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    AggregatorName string
    The name of the account group.
    AggregatorType string
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    CreateTime int
    (Available since v1.262.0) The timestamp when the account group was created.
    Description string
    The description of the account group.
    FolderId string
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.
    Status string
    The status of the account group.
    AggregatorAccounts []AggregatorAggregatorAccountArgs

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    AggregatorName string
    The name of the account group.
    AggregatorType string
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    CreateTime int
    (Available since v1.262.0) The timestamp when the account group was created.
    Description string
    The description of the account group.
    FolderId string
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.
    Status string
    The status of the account group.
    aggregatorAccounts List<AggregatorAggregatorAccount>

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    aggregatorName String
    The name of the account group.
    aggregatorType String
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    createTime Integer
    (Available since v1.262.0) The timestamp when the account group was created.
    description String
    The description of the account group.
    folderId String
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.
    status String
    The status of the account group.
    aggregatorAccounts AggregatorAggregatorAccount[]

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    aggregatorName string
    The name of the account group.
    aggregatorType string
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    createTime number
    (Available since v1.262.0) The timestamp when the account group was created.
    description string
    The description of the account group.
    folderId string
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.
    status string
    The status of the account group.
    aggregator_accounts Sequence[AggregatorAggregatorAccountArgs]

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    aggregator_name str
    The name of the account group.
    aggregator_type str
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    create_time int
    (Available since v1.262.0) The timestamp when the account group was created.
    description str
    The description of the account group.
    folder_id str
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.
    status str
    The status of the account group.
    aggregatorAccounts List<Property Map>

    The member accounts of the account group. See aggregator_accounts below.

    NOTE: If aggregator_type is set to CUSTOM, aggregator_accounts is required.

    aggregatorName String
    The name of the account group.
    aggregatorType String
    The type of the account group. Default value: CUSTOM. Valid values:

    • RD: Global account group.
    • FOLDER: Folder account group.
    • CUSTOM: Custom account group.
    createTime Number
    (Available since v1.262.0) The timestamp when the account group was created.
    description String
    The description of the account group.
    folderId String
    The ID of the attached folder. You can specify multiple folder IDs. Separate the IDs with commas (,). NOTE: If aggregator_type is set to FOLDER, folder_id is required.
    status String
    The status of the account group.

    Supporting Types

    AggregatorAggregatorAccount, AggregatorAggregatorAccountArgs

    AccountId string
    The member ID.
    AccountName string
    The member name.
    AccountType string
    The affiliation of the member. Valid values: ResourceDirectory.
    AccountId string
    The member ID.
    AccountName string
    The member name.
    AccountType string
    The affiliation of the member. Valid values: ResourceDirectory.
    accountId String
    The member ID.
    accountName String
    The member name.
    accountType String
    The affiliation of the member. Valid values: ResourceDirectory.
    accountId string
    The member ID.
    accountName string
    The member name.
    accountType string
    The affiliation of the member. Valid values: ResourceDirectory.
    account_id str
    The member ID.
    account_name str
    The member name.
    account_type str
    The affiliation of the member. Valid values: ResourceDirectory.
    accountId String
    The member ID.
    accountName String
    The member name.
    accountType String
    The affiliation of the member. Valid values: ResourceDirectory.

    Import

    Cloud Config (Config) Aggregator can be imported using the id, e.g.

    $ pulumi import alicloud:cfg/aggregator:Aggregator example <id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.88.0 published on Saturday, Nov 1, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate