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

alicloud.cloudsso.DelegateAccount

Explore with Pulumi AI

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

    Provides a Cloud SSO Delegate Account resource.

    Delegated Administrator Account.

    For information about Cloud SSO Delegate Account and how to use it, see What is Delegate Account.

    NOTE: Available since v1.259.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";
    const _default = alicloud.resourcemanager.getAccounts({
        status: "CreateSuccess",
    });
    const defaultDelegatedAdministrator = new alicloud.resourcemanager.DelegatedAdministrator("default", {
        accountId: _default.then(_default => _default.accounts?.[0]?.accountId),
        servicePrincipal: "cloudsso.aliyuncs.com",
    });
    const defaultDelegateAccount = new alicloud.cloudsso.DelegateAccount("default", {accountId: defaultDelegatedAdministrator.accountId});
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.resourcemanager.get_accounts(status="CreateSuccess")
    default_delegated_administrator = alicloud.resourcemanager.DelegatedAdministrator("default",
        account_id=default.accounts[0].account_id,
        service_principal="cloudsso.aliyuncs.com")
    default_delegate_account = alicloud.cloudsso.DelegateAccount("default", account_id=default_delegated_administrator.account_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudsso"
    	"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 := "terraform-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
    		}
    		defaultDelegatedAdministrator, err := resourcemanager.NewDelegatedAdministrator(ctx, "default", &resourcemanager.DelegatedAdministratorArgs{
    			AccountId:        pulumi.String(_default.Accounts[0].AccountId),
    			ServicePrincipal: pulumi.String("cloudsso.aliyuncs.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudsso.NewDelegateAccount(ctx, "default", &cloudsso.DelegateAccountArgs{
    			AccountId: defaultDelegatedAdministrator.AccountId,
    		})
    		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";
        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 = "cloudsso.aliyuncs.com",
        });
    
        var defaultDelegateAccount = new AliCloud.CloudSso.DelegateAccount("default", new()
        {
            AccountId = defaultDelegatedAdministrator.AccountId,
        });
    
    });
    
    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 com.pulumi.alicloud.cloudsso.DelegateAccount;
    import com.pulumi.alicloud.cloudsso.DelegateAccountArgs;
    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("terraform-example");
            final var default = ResourcemanagerFunctions.getAccounts(GetAccountsArgs.builder()
                .status("CreateSuccess")
                .build());
    
            var defaultDelegatedAdministrator = new DelegatedAdministrator("defaultDelegatedAdministrator", DelegatedAdministratorArgs.builder()
                .accountId(default_.accounts()[0].accountId())
                .servicePrincipal("cloudsso.aliyuncs.com")
                .build());
    
            var defaultDelegateAccount = new DelegateAccount("defaultDelegateAccount", DelegateAccountArgs.builder()
                .accountId(defaultDelegatedAdministrator.accountId())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultDelegatedAdministrator:
        type: alicloud:resourcemanager:DelegatedAdministrator
        name: default
        properties:
          accountId: ${default.accounts[0].accountId}
          servicePrincipal: cloudsso.aliyuncs.com
      defaultDelegateAccount:
        type: alicloud:cloudsso:DelegateAccount
        name: default
        properties:
          accountId: ${defaultDelegatedAdministrator.accountId}
    variables:
      default:
        fn::invoke:
          function: alicloud:resourcemanager:getAccounts
          arguments:
            status: CreateSuccess
    

    Create DelegateAccount Resource

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

    Constructor syntax

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

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

    AccountId string
    Delegate administrator account Id
    AccountId string
    Delegate administrator account Id
    accountId String
    Delegate administrator account Id
    accountId string
    Delegate administrator account Id
    account_id str
    Delegate administrator account Id
    accountId String
    Delegate administrator account Id

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DelegateAccount 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 DelegateAccount Resource

    Get an existing DelegateAccount 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?: DelegateAccountState, opts?: CustomResourceOptions): DelegateAccount
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None) -> DelegateAccount
    func GetDelegateAccount(ctx *Context, name string, id IDInput, state *DelegateAccountState, opts ...ResourceOption) (*DelegateAccount, error)
    public static DelegateAccount Get(string name, Input<string> id, DelegateAccountState? state, CustomResourceOptions? opts = null)
    public static DelegateAccount get(String name, Output<String> id, DelegateAccountState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:cloudsso:DelegateAccount    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
    Delegate administrator account Id
    AccountId string
    Delegate administrator account Id
    accountId String
    Delegate administrator account Id
    accountId string
    Delegate administrator account Id
    account_id str
    Delegate administrator account Id
    accountId String
    Delegate administrator account Id

    Import

    Cloud SSO Delegate Account can be imported using the id, e.g.

    $ pulumi import alicloud:cloudsso/delegateAccount:DelegateAccount 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.85.0 published on Tuesday, Sep 9, 2025 by Pulumi