1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. resourcemanager
  5. DelegatedAdministrator
Alibaba Cloud v3.38.0 published on Friday, Jun 2, 2023 by Pulumi

alicloud.resourcemanager.DelegatedAdministrator

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.38.0 published on Friday, Jun 2, 2023 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 in v1.181.0+.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var defaultAccounts = AliCloud.ResourceManager.GetAccounts.Invoke(new()
        {
            Status = "CreateSuccess",
        });
    
        var defaultDelegatedAdministrator = new AliCloud.ResourceManager.DelegatedAdministrator("defaultDelegatedAdministrator", new()
        {
            AccountId = defaultAccounts.Apply(getAccountsResult => getAccountsResult.Accounts[0]?.AccountId),
            ServicePrincipal = "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 {
    		defaultAccounts, err := resourcemanager.GetAccounts(ctx, &resourcemanager.GetAccountsArgs{
    			Status: pulumi.StringRef("CreateSuccess"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = resourcemanager.NewDelegatedAdministrator(ctx, "defaultDelegatedAdministrator", &resourcemanager.DelegatedAdministratorArgs{
    			AccountId:        *pulumi.String(defaultAccounts.Accounts[0].AccountId),
    			ServicePrincipal: pulumi.String("cloudfw.aliyuncs.com"),
    		})
    		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.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 defaultAccounts = ResourcemanagerFunctions.getAccounts(GetAccountsArgs.builder()
                .status("CreateSuccess")
                .build());
    
            var defaultDelegatedAdministrator = new DelegatedAdministrator("defaultDelegatedAdministrator", DelegatedAdministratorArgs.builder()        
                .accountId(defaultAccounts.applyValue(getAccountsResult -> getAccountsResult.accounts()[0].accountId()))
                .servicePrincipal("cloudfw.aliyuncs.com")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default_accounts = alicloud.resourcemanager.get_accounts(status="CreateSuccess")
    default_delegated_administrator = alicloud.resourcemanager.DelegatedAdministrator("defaultDelegatedAdministrator",
        account_id=default_accounts.accounts[0].account_id,
        service_principal="cloudfw.aliyuncs.com")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const defaultAccounts = alicloud.resourcemanager.getAccounts({
        status: "CreateSuccess",
    });
    const defaultDelegatedAdministrator = new alicloud.resourcemanager.DelegatedAdministrator("defaultDelegatedAdministrator", {
        accountId: defaultAccounts.then(defaultAccounts => defaultAccounts.accounts?.[0]?.accountId),
        servicePrincipal: "cloudfw.aliyuncs.com",
    });
    
    resources:
      defaultDelegatedAdministrator:
        type: alicloud:resourcemanager:DelegatedAdministrator
        properties:
          accountId: ${defaultAccounts.accounts[0].accountId}
          servicePrincipal: cloudfw.aliyuncs.com
    variables:
      defaultAccounts:
        fn::invoke:
          Function: alicloud:resourcemanager:getAccounts
          Arguments:
            status: CreateSuccess
    

    Create DelegatedAdministrator Resource

    new DelegatedAdministrator(name: string, args: DelegatedAdministratorArgs, opts?: CustomResourceOptions);
    @overload
    def DelegatedAdministrator(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               account_id: Optional[str] = None,
                               service_principal: Optional[str] = None)
    @overload
    def DelegatedAdministrator(resource_name: str,
                               args: DelegatedAdministratorArgs,
                               opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    The DelegatedAdministrator resource accepts the following input properties:

    AccountId string

    The ID of the member account in the resource directory.

    ServicePrincipal string

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    AccountId string

    The ID of the member account in the resource directory.

    ServicePrincipal string

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    accountId String

    The ID of the member account in the resource directory.

    servicePrincipal String

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    accountId string

    The ID of the member account in the resource directory.

    servicePrincipal string

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    account_id str

    The ID of the member account in the resource directory.

    service_principal str

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    accountId String

    The ID of the member account in the resource directory.

    servicePrincipal String

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    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)
    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.
    The following state arguments are supported:
    AccountId string

    The ID of the member account in the resource directory.

    ServicePrincipal string

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    AccountId string

    The ID of the member account in the resource directory.

    ServicePrincipal string

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    accountId String

    The ID of the member account in the resource directory.

    servicePrincipal String

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    accountId string

    The ID of the member account in the resource directory.

    servicePrincipal string

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    account_id str

    The ID of the member account in the resource directory.

    service_principal str

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    accountId String

    The ID of the member account in the resource directory.

    servicePrincipal String

    The identification of the trusted service. NOTE: Only some trusted services support delegated administrator accounts. For more information, see Supported trusted services.

    Import

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

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

    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.38.0 published on Friday, Jun 2, 2023 by Pulumi