1. Registry
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. threatdetection
  6. MonitorAccount
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
alicloud logo alicloud logo
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi

    Provides a Threat Detection Monitor Account resource.

    Multi-account management account. The member accounts in the resource directory are added to the monitor account list of Threat Detection (Security Center), so that the security administrator account can manage the security of these member accounts in a unified manner.

    For information about Threat Detection Monitor Account and how to use it, see What is Monitor Account.

    NOTE: Available since v1.292.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") || "terraform-example";
    // The IDs of the member accounts in the resource directory. Multiple IDs must be separated by commas (,).
    const memberAccountIds = config.require("memberAccountIds");
    const _default = new alicloud.threatdetection.MonitorAccount("default", {accountIds: memberAccountIds});
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    # The IDs of the member accounts in the resource directory. Multiple IDs must be separated by commas (,).
    member_account_ids = config.require("memberAccountIds")
    default = alicloud.threatdetection.MonitorAccount("default", account_ids=member_account_ids)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/threatdetection"
    	"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 := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		// The IDs of the member accounts in the resource directory. Multiple IDs must be separated by commas (,).
    		memberAccountIds := cfg.Require("memberAccountIds")
    		_, err := threatdetection.NewMonitorAccount(ctx, "default", &threatdetection.MonitorAccountArgs{
    			AccountIds: pulumi.String(memberAccountIds),
    		})
    		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") ?? "terraform-example";
        // The IDs of the member accounts in the resource directory. Multiple IDs must be separated by commas (,).
        var memberAccountIds = config.Require("memberAccountIds");
        var @default = new AliCloud.ThreatDetection.MonitorAccount("default", new()
        {
            AccountIds = memberAccountIds,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.threatdetection.MonitorAccount;
    import com.pulumi.alicloud.threatdetection.MonitorAccountArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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("terraform-example");
            final var memberAccountIds = config.require("memberAccountIds");
            var default_ = new MonitorAccount("default", MonitorAccountArgs.builder()
                .accountIds(memberAccountIds)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
      memberAccountIds:
        type: string
    resources:
      default:
        type: alicloud:threatdetection:MonitorAccount
        properties:
          accountIds: ${memberAccountIds}
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    resource "alicloud_threatdetection_monitoraccount" "default" {
      account_ids = var.memberAccountIds
    }
    variable "name" {
      type    = string
      default = "terraform-example"
    }
    variable "memberAccountIds" {
      type        = string
      description = "The IDs of the member accounts in the resource directory. Multiple IDs must be separated by commas (,)."
    }
    

    Deleting alicloud.threatdetection.MonitorAccount or removing it from your configuration

    Terraform cannot destroy resource alicloud.threatdetection.MonitorAccount. Terraform will remove this resource from the state file, however resources may remain.

    📚 Need more examples? VIEW MORE EXAMPLES

    Create MonitorAccount Resource

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

    Constructor syntax

    new MonitorAccount(name: string, args?: MonitorAccountArgs, opts?: CustomResourceOptions);
    @overload
    def MonitorAccount(resource_name: str,
                       args: Optional[MonitorAccountArgs] = None,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def MonitorAccount(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       account_ids: Optional[str] = None)
    func NewMonitorAccount(ctx *Context, name string, args *MonitorAccountArgs, opts ...ResourceOption) (*MonitorAccount, error)
    public MonitorAccount(string name, MonitorAccountArgs? args = null, CustomResourceOptions? opts = null)
    public MonitorAccount(String name, MonitorAccountArgs args)
    public MonitorAccount(String name, MonitorAccountArgs args, CustomResourceOptions options)
    
    type: alicloud:threatdetection:MonitorAccount
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "alicloud_threatdetection_monitor_account" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args MonitorAccountArgs
    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 MonitorAccountArgs
    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 MonitorAccountArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MonitorAccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MonitorAccountArgs
    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 monitorAccountResource = new AliCloud.ThreatDetection.MonitorAccount("monitorAccountResource", new()
    {
        AccountIds = "string",
    });
    
    example, err := threatdetection.NewMonitorAccount(ctx, "monitorAccountResource", &threatdetection.MonitorAccountArgs{
    	AccountIds: pulumi.String("string"),
    })
    
    resource "alicloud_threatdetection_monitor_account" "monitorAccountResource" {
      lifecycle {
        create_before_destroy = true
      }
      account_ids = "string"
    }
    
    var monitorAccountResource = new MonitorAccount("monitorAccountResource", MonitorAccountArgs.builder()
        .accountIds("string")
        .build());
    
    monitor_account_resource = alicloud.threatdetection.MonitorAccount("monitorAccountResource", account_ids="string")
    
    const monitorAccountResource = new alicloud.threatdetection.MonitorAccount("monitorAccountResource", {accountIds: "string"});
    
    type: alicloud:threatdetection:MonitorAccount
    properties:
        accountIds: string
    

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

    AccountIds string
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    AccountIds string
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    account_ids string
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    accountIds String
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    accountIds string
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    account_ids str
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    accountIds String
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing MonitorAccount Resource

    Get an existing MonitorAccount 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?: MonitorAccountState, opts?: CustomResourceOptions): MonitorAccount
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_ids: Optional[str] = None) -> MonitorAccount
    func GetMonitorAccount(ctx *Context, name string, id IDInput, state *MonitorAccountState, opts ...ResourceOption) (*MonitorAccount, error)
    public static MonitorAccount Get(string name, Input<string> id, MonitorAccountState? state, CustomResourceOptions? opts = null)
    public static MonitorAccount get(String name, Output<String> id, MonitorAccountState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:threatdetection:MonitorAccount    get:      id: ${id}
    import {
      to = alicloud_threatdetection_monitor_account.example
      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:
    AccountIds string
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    AccountIds string
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    account_ids string
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    accountIds String
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    accountIds string
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    account_ids str
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.
    accountIds String
    The list of member account IDs in the resource directory. You can call ListAccountsInResourceDirectory to obtain the member account IDs. Multiple member account IDs must be separated by commas (,). The monitor account list is fully replaced by the incoming list. If this parameter is not specified, the existing monitor account list is cleared.

    Import

    Threat Detection Monitor Account can be imported using the id, e.g.

    $ terraform import alicloud_threat_detection_monitor_account.example <Alibaba Cloud Account 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 alicloud logo
    Viewing docs for Alibaba Cloud v3.108.0
    published on Thursday, Sep 17, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial