// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.AliCloud.ResourceManager
{
    /// <summary>
    /// Provides a Resource Manager Delegated Administrator resource.
    /// 
    /// For information about Resource Manager Delegated Administrator and how to use it, see [What is Delegated Administrator](https://www.alibabacloud.com/help/en/resource-management/latest/registerdelegatedadministrator#doc-api-ResourceManager-RegisterDelegatedAdministrator).
    /// 
    /// &gt; **NOTE:** Available in v1.181.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var defaultAccounts = AliCloud.ResourceManager.GetAccounts.Invoke(new()
    ///     {
    ///         Status = "CreateSuccess",
    ///     });
    /// 
    ///     var defaultDelegatedAdministrator = new AliCloud.ResourceManager.DelegatedAdministrator("defaultDelegatedAdministrator", new()
    ///     {
    ///         AccountId = defaultAccounts.Apply(getAccountsResult =&gt; getAccountsResult.Accounts[0]?.AccountId),
    ///         ServicePrincipal = "cloudfw.aliyuncs.com",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Resource Manager Delegated Administrator can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:resourcemanager/delegatedAdministrator:DelegatedAdministrator example &lt;account_id&gt;:&lt;service_principal&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:resourcemanager/delegatedAdministrator:DelegatedAdministrator")]
    public partial class DelegatedAdministrator : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The ID of the member account in the resource directory.
        /// </summary>
        [Output("accountId")]
        public Output<string> AccountId { get; private set; } = null!;

        /// <summary>
        /// The identification of the trusted service. **NOTE:** Only some trusted services support delegated administrator accounts. For more information, see [Supported trusted services](https://www.alibabacloud.com/help/en/resource-management/latest/manage-trusted-services-overview).
        /// </summary>
        [Output("servicePrincipal")]
        public Output<string> ServicePrincipal { get; private set; } = null!;


        /// <summary>
        /// Create a DelegatedAdministrator resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public DelegatedAdministrator(string name, DelegatedAdministratorArgs args, CustomResourceOptions? options = null)
            : base("alicloud:resourcemanager/delegatedAdministrator:DelegatedAdministrator", name, args ?? new DelegatedAdministratorArgs(), MakeResourceOptions(options, ""))
        {
        }

        private DelegatedAdministrator(string name, Input<string> id, DelegatedAdministratorState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:resourcemanager/delegatedAdministrator:DelegatedAdministrator", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/rhysmdnz/pulumi-alicloud",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing DelegatedAdministrator resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static DelegatedAdministrator Get(string name, Input<string> id, DelegatedAdministratorState? state = null, CustomResourceOptions? options = null)
        {
            return new DelegatedAdministrator(name, id, state, options);
        }
    }

    public sealed class DelegatedAdministratorArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of the member account in the resource directory.
        /// </summary>
        [Input("accountId", required: true)]
        public Input<string> AccountId { get; set; } = null!;

        /// <summary>
        /// The identification of the trusted service. **NOTE:** Only some trusted services support delegated administrator accounts. For more information, see [Supported trusted services](https://www.alibabacloud.com/help/en/resource-management/latest/manage-trusted-services-overview).
        /// </summary>
        [Input("servicePrincipal", required: true)]
        public Input<string> ServicePrincipal { get; set; } = null!;

        public DelegatedAdministratorArgs()
        {
        }
        public static new DelegatedAdministratorArgs Empty => new DelegatedAdministratorArgs();
    }

    public sealed class DelegatedAdministratorState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of the member account in the resource directory.
        /// </summary>
        [Input("accountId")]
        public Input<string>? AccountId { get; set; }

        /// <summary>
        /// The identification of the trusted service. **NOTE:** Only some trusted services support delegated administrator accounts. For more information, see [Supported trusted services](https://www.alibabacloud.com/help/en/resource-management/latest/manage-trusted-services-overview).
        /// </summary>
        [Input("servicePrincipal")]
        public Input<string>? ServicePrincipal { get; set; }

        public DelegatedAdministratorState()
        {
        }
        public static new DelegatedAdministratorState Empty => new DelegatedAdministratorState();
    }
}
