Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

DelegatedAdministrator

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

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultAccounts = Output.Create(AliCloud.ResourceManager.GetAccounts.InvokeAsync(new AliCloud.ResourceManager.GetAccountsArgs
        {
            Status = "CreateSuccess",
        }));
        var defaultDelegatedAdministrator = new AliCloud.ResourceManager.DelegatedAdministrator("defaultDelegatedAdministrator", new AliCloud.ResourceManager.DelegatedAdministratorArgs
        {
            AccountId = defaultAccounts.Apply(defaultAccounts => defaultAccounts.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.clickhouse.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 a 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 an 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
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.