alicloud.cfg.Aggregator
Explore with Pulumi AI
Provides a Cloud Config Aggregator resource.
For information about Cloud Config Aggregate Config Rule and how to use it, see What is Aggregator.
NOTE: Available since v1.124.0.
Example Usage
Basic Usage
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 defaultAccounts = AliCloud.ResourceManager.GetAccounts.Invoke(new()
{
Status = "CreateSuccess",
});
var defaultAggregator = new AliCloud.Cfg.Aggregator("defaultAggregator", new()
{
AggregatorAccounts = new[]
{
new AliCloud.Cfg.Inputs.AggregatorAggregatorAccountArgs
{
AccountId = defaultAccounts.Apply(getAccountsResult => getAccountsResult.Accounts[0]?.AccountId),
AccountName = defaultAccounts.Apply(getAccountsResult => getAccountsResult.Accounts[0]?.DisplayName),
AccountType = "ResourceDirectory",
},
},
AggregatorName = name,
Description = name,
AggregatorType = "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
}
defaultAccounts, err := resourcemanager.GetAccounts(ctx, &resourcemanager.GetAccountsArgs{
Status: pulumi.StringRef("CreateSuccess"),
}, nil)
if err != nil {
return err
}
_, err = cfg.NewAggregator(ctx, "defaultAggregator", &cfg.AggregatorArgs{
AggregatorAccounts: cfg.AggregatorAggregatorAccountArray{
&cfg.AggregatorAggregatorAccountArgs{
AccountId: *pulumi.String(defaultAccounts.Accounts[0].AccountId),
AccountName: *pulumi.String(defaultAccounts.Accounts[0].DisplayName),
AccountType: pulumi.String("ResourceDirectory"),
},
},
AggregatorName: pulumi.String(name),
Description: pulumi.String(name),
AggregatorType: pulumi.String("CUSTOM"),
})
if err != nil {
return err
}
return nil
})
}
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 defaultAccounts = ResourcemanagerFunctions.getAccounts(GetAccountsArgs.builder()
.status("CreateSuccess")
.build());
var defaultAggregator = new Aggregator("defaultAggregator", AggregatorArgs.builder()
.aggregatorAccounts(AggregatorAggregatorAccountArgs.builder()
.accountId(defaultAccounts.applyValue(getAccountsResult -> getAccountsResult.accounts()[0].accountId()))
.accountName(defaultAccounts.applyValue(getAccountsResult -> getAccountsResult.accounts()[0].displayName()))
.accountType("ResourceDirectory")
.build())
.aggregatorName(name)
.description(name)
.aggregatorType("CUSTOM")
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf_example"
default_accounts = alicloud.resourcemanager.get_accounts(status="CreateSuccess")
default_aggregator = alicloud.cfg.Aggregator("defaultAggregator",
aggregator_accounts=[alicloud.cfg.AggregatorAggregatorAccountArgs(
account_id=default_accounts.accounts[0].account_id,
account_name=default_accounts.accounts[0].display_name,
account_type="ResourceDirectory",
)],
aggregator_name=name,
description=name,
aggregator_type="CUSTOM")
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 defaultAccounts = alicloud.resourcemanager.getAccounts({
status: "CreateSuccess",
});
const defaultAggregator = new alicloud.cfg.Aggregator("defaultAggregator", {
aggregatorAccounts: [{
accountId: defaultAccounts.then(defaultAccounts => defaultAccounts.accounts?.[0]?.accountId),
accountName: defaultAccounts.then(defaultAccounts => defaultAccounts.accounts?.[0]?.displayName),
accountType: "ResourceDirectory",
}],
aggregatorName: name,
description: name,
aggregatorType: "CUSTOM",
});
configuration:
name:
type: string
default: tf_example
resources:
defaultAggregator:
type: alicloud:cfg:Aggregator
properties:
aggregatorAccounts:
- accountId: ${defaultAccounts.accounts[0].accountId}
accountName: ${defaultAccounts.accounts[0].displayName}
accountType: ResourceDirectory
aggregatorName: ${name}
description: ${name}
aggregatorType: CUSTOM
variables:
defaultAccounts:
fn::invoke:
Function: alicloud:resourcemanager:getAccounts
Arguments:
status: CreateSuccess
Create Aggregator Resource
new Aggregator(name: string, args: AggregatorArgs, opts?: CustomResourceOptions);
@overload
def Aggregator(resource_name: str,
opts: Optional[ResourceOptions] = None,
aggregator_accounts: Optional[Sequence[AggregatorAggregatorAccountArgs]] = None,
aggregator_name: Optional[str] = None,
aggregator_type: Optional[str] = None,
description: Optional[str] = None)
@overload
def Aggregator(resource_name: str,
args: AggregatorArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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
The Aggregator resource accepts the following input properties:
- Aggregator
Name string The name of aggregator.
- Description string
The description of aggregator.
- Aggregator
Accounts List<Pulumi.Ali Cloud. Cfg. Inputs. Aggregator Aggregator Account> The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- Aggregator
Type string The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.
- Aggregator
Name string The name of aggregator.
- Description string
The description of aggregator.
- Aggregator
Accounts []AggregatorAggregator Account Args The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- Aggregator
Type string The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.
- aggregator
Name String The name of aggregator.
- description String
The description of aggregator.
- aggregator
Accounts List<AggregatorAggregator Account> The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- aggregator
Type String The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.
- aggregator
Name string The name of aggregator.
- description string
The description of aggregator.
- aggregator
Accounts AggregatorAggregator Account[] The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- aggregator
Type string The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.
- aggregator_
name str The name of aggregator.
- description str
The description of aggregator.
- aggregator_
accounts Sequence[AggregatorAggregator Account Args] The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- aggregator_
type str The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.
- aggregator
Name String The name of aggregator.
- description String
The description of aggregator.
- aggregator
Accounts List<Property Map> The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- aggregator
Type String The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Aggregator resource produces the following output properties:
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,
description: 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)
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.
- Aggregator
Accounts List<Pulumi.Ali Cloud. Cfg. Inputs. Aggregator Aggregator Account> The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- Aggregator
Name string The name of aggregator.
- Aggregator
Type string The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.- Description string
The description of aggregator.
- Status string
The status of the resource. Valid values:
0
: creating1
: normal2
: deleting.
- Aggregator
Accounts []AggregatorAggregator Account Args The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- Aggregator
Name string The name of aggregator.
- Aggregator
Type string The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.- Description string
The description of aggregator.
- Status string
The status of the resource. Valid values:
0
: creating1
: normal2
: deleting.
- aggregator
Accounts List<AggregatorAggregator Account> The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- aggregator
Name String The name of aggregator.
- aggregator
Type String The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.- description String
The description of aggregator.
- status String
The status of the resource. Valid values:
0
: creating1
: normal2
: deleting.
- aggregator
Accounts AggregatorAggregator Account[] The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- aggregator
Name string The name of aggregator.
- aggregator
Type string The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.- description string
The description of aggregator.
- status string
The status of the resource. Valid values:
0
: creating1
: normal2
: deleting.
- aggregator_
accounts Sequence[AggregatorAggregator Account Args] The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- aggregator_
name str The name of aggregator.
- aggregator_
type str The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.- description str
The description of aggregator.
- status str
The status of the resource. Valid values:
0
: creating1
: normal2
: deleting.
- aggregator
Accounts List<Property Map> The information of account in aggregator. If the aggregator_type is RD, it is optional and means add all members in the resource directory to the account group. See
aggregator_accounts
below. NOTE: the fieldaggregator_accounts
is not required from version 1.148.0.- aggregator
Name String The name of aggregator.
- aggregator
Type String The type of aggregator. Valid values:
CUSTOM
,RD
. The Default value:CUSTOM
.- description String
The description of aggregator.
- status String
The status of the resource. Valid values:
0
: creating1
: normal2
: deleting.
Supporting Types
AggregatorAggregatorAccount, AggregatorAggregatorAccountArgs
- Account
Id string Aggregator account Uid.
- Account
Name string Aggregator account name.
- Account
Type string Aggregator account source type. Valid values:
ResourceDirectory
.
- Account
Id string Aggregator account Uid.
- Account
Name string Aggregator account name.
- Account
Type string Aggregator account source type. Valid values:
ResourceDirectory
.
- account
Id String Aggregator account Uid.
- account
Name String Aggregator account name.
- account
Type String Aggregator account source type. Valid values:
ResourceDirectory
.
- account
Id string Aggregator account Uid.
- account
Name string Aggregator account name.
- account
Type string Aggregator account source type. Valid values:
ResourceDirectory
.
- account_
id str Aggregator account Uid.
- account_
name str Aggregator account name.
- account_
type str Aggregator account source type. Valid values:
ResourceDirectory
.
- account
Id String Aggregator account Uid.
- account
Name String Aggregator account name.
- account
Type String Aggregator account source type. Valid values:
ResourceDirectory
.
Import
Cloud Config Aggregator can be imported using the id, e.g.
$ pulumi import alicloud:cfg/aggregator:Aggregator example <id>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.