1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. resourcemanager
  5. DelegatedAdministrator
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

alicloud.resourcemanager.DelegatedAdministrator

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

    Provides a Resource Manager Delegated Administrator resource.

    For information about Resource Manager Delegated Administrator and how to use it, see What is Delegated Administrator.

    NOTE: Available since v1.181.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = alicloud.resourcemanager.getAccounts({
        status: "CreateSuccess",
    });
    const defaultDelegatedAdministrator = new alicloud.resourcemanager.DelegatedAdministrator("default", {
        accountId: _default.then(_default => _default.accounts?.[0]?.accountId),
        servicePrincipal: "cloudfw.aliyuncs.com",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.resourcemanager.get_accounts(status="CreateSuccess")
    default_delegated_administrator = alicloud.resourcemanager.DelegatedAdministrator("default",
        account_id=default.accounts[0].account_id,
        service_principal="cloudfw.aliyuncs.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := resourcemanager.GetAccounts(ctx, &resourcemanager.GetAccountsArgs{
    			Status: pulumi.StringRef("CreateSuccess"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = resourcemanager.NewDelegatedAdministrator(ctx, "default", &resourcemanager.DelegatedAdministratorArgs{
    			AccountId:        pulumi.String(_default.Accounts[0].AccountId),
    			ServicePrincipal: pulumi.String("cloudfw.aliyuncs.com"),
    		})
    		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 @default = AliCloud.ResourceManager.GetAccounts.Invoke(new()
        {
            Status = "CreateSuccess",
        });
    
        var defaultDelegatedAdministrator = new AliCloud.ResourceManager.DelegatedAdministrator("default", new()
        {
            AccountId = @default.Apply(@default => @default.Apply(getAccountsResult => getAccountsResult.Accounts[0]?.AccountId)),
            ServicePrincipal = "cloudfw.aliyuncs.com",
        });
    
    });
    
    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.resourcemanager.DelegatedAdministrator;
    import com.pulumi.alicloud.resourcemanager.DelegatedAdministratorArgs;
    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 default = ResourcemanagerFunctions.getAccounts(GetAccountsArgs.builder()
                .status("CreateSuccess")
                .build());
    
            var defaultDelegatedAdministrator = new DelegatedAdministrator("defaultDelegatedAdministrator", DelegatedAdministratorArgs.builder()
                .accountId(default_.accounts()[0].accountId())
                .servicePrincipal("cloudfw.aliyuncs.com")
                .build());
    
        }
    }
    
    resources:
      defaultDelegatedAdministrator:
        type: alicloud:resourcemanager:DelegatedAdministrator
        name: default
        properties:
          accountId: ${default.accounts[0].accountId}
          servicePrincipal: cloudfw.aliyuncs.com
    variables:
      default:
        fn::invoke:
          function: alicloud:resourcemanager:getAccounts
          arguments:
            status: CreateSuccess
    

    Create DelegatedAdministrator Resource

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

    Constructor syntax

    new DelegatedAdministrator(name: string, args: DelegatedAdministratorArgs, opts?: CustomResourceOptions);
    @overload
    def DelegatedAdministrator(resource_name: str,
                               args: DelegatedAdministratorArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def DelegatedAdministrator(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               account_id: Optional[str] = None,
                               service_principal: Optional[str] = None)
    func NewDelegatedAdministrator(ctx *Context, name string, args DelegatedAdministratorArgs, opts ...ResourceOption) (*DelegatedAdministrator, error)
    public DelegatedAdministrator(string name, DelegatedAdministratorArgs args, CustomResourceOptions? opts = null)
    public DelegatedAdministrator(String name, DelegatedAdministratorArgs args)
    public DelegatedAdministrator(String name, DelegatedAdministratorArgs args, CustomResourceOptions options)
    
    type: alicloud:resourcemanager:DelegatedAdministrator
    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 DelegatedAdministratorArgs
    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 DelegatedAdministratorArgs
    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 DelegatedAdministratorArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DelegatedAdministratorArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DelegatedAdministratorArgs
    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 delegatedAdministratorResource = new AliCloud.ResourceManager.DelegatedAdministrator("delegatedAdministratorResource", new()
    {
        AccountId = "string",
        ServicePrincipal = "string",
    });
    
    example, err := resourcemanager.NewDelegatedAdministrator(ctx, "delegatedAdministratorResource", &resourcemanager.DelegatedAdministratorArgs{
    	AccountId:        pulumi.String("string"),
    	ServicePrincipal: pulumi.String("string"),
    })
    
    var delegatedAdministratorResource = new DelegatedAdministrator("delegatedAdministratorResource", DelegatedAdministratorArgs.builder()
        .accountId("string")
        .servicePrincipal("string")
        .build());
    
    delegated_administrator_resource = alicloud.resourcemanager.DelegatedAdministrator("delegatedAdministratorResource",
        account_id="string",
        service_principal="string")
    
    const delegatedAdministratorResource = new alicloud.resourcemanager.DelegatedAdministrator("delegatedAdministratorResource", {
        accountId: "string",
        servicePrincipal: "string",
    });
    
    type: alicloud:resourcemanager:DelegatedAdministrator
    properties:
        accountId: string
        servicePrincipal: string
    

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

    AccountId string
    The Alibaba Cloud account ID of the member in the resource directory.
    ServicePrincipal string
    The identifier of the trusted service.
    AccountId string
    The Alibaba Cloud account ID of the member in the resource directory.
    ServicePrincipal string
    The identifier of the trusted service.
    accountId String
    The Alibaba Cloud account ID of the member in the resource directory.
    servicePrincipal String
    The identifier of the trusted service.
    accountId string
    The Alibaba Cloud account ID of the member in the resource directory.
    servicePrincipal string
    The identifier of the trusted service.
    account_id str
    The Alibaba Cloud account ID of the member in the resource directory.
    service_principal str
    The identifier of the trusted service.
    accountId String
    The Alibaba Cloud account ID of the member in the resource directory.
    servicePrincipal String
    The identifier of the trusted service.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DelegatedAdministrator 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 str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DelegatedAdministrator Resource

    Get an existing DelegatedAdministrator 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?: DelegatedAdministratorState, opts?: CustomResourceOptions): DelegatedAdministrator
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            service_principal: Optional[str] = None) -> DelegatedAdministrator
    func GetDelegatedAdministrator(ctx *Context, name string, id IDInput, state *DelegatedAdministratorState, opts ...ResourceOption) (*DelegatedAdministrator, error)
    public static DelegatedAdministrator Get(string name, Input<string> id, DelegatedAdministratorState? state, CustomResourceOptions? opts = null)
    public static DelegatedAdministrator get(String name, Output<String> id, DelegatedAdministratorState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:resourcemanager:DelegatedAdministrator    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:
    AccountId string
    The Alibaba Cloud account ID of the member in the resource directory.
    ServicePrincipal string
    The identifier of the trusted service.
    AccountId string
    The Alibaba Cloud account ID of the member in the resource directory.
    ServicePrincipal string
    The identifier of the trusted service.
    accountId String
    The Alibaba Cloud account ID of the member in the resource directory.
    servicePrincipal String
    The identifier of the trusted service.
    accountId string
    The Alibaba Cloud account ID of the member in the resource directory.
    servicePrincipal string
    The identifier of the trusted service.
    account_id str
    The Alibaba Cloud account ID of the member in the resource directory.
    service_principal str
    The identifier of the trusted service.
    accountId String
    The Alibaba Cloud account ID of the member in the resource directory.
    servicePrincipal String
    The identifier of the trusted service.

    Import

    Resource Manager Delegated Administrator can be imported using the id, e.g.

    $ pulumi import alicloud:resourcemanager/delegatedAdministrator:DelegatedAdministrator example <account_id>:<service_principal>
    

    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.85.0 published on Tuesday, Sep 9, 2025 by Pulumi