<filename>sdk/dotnet/ResourceManager/ServiceLinkedRole.cs// *** 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 Service Linked Role.
    /// 
    /// For information about Resource Manager Service Linked Role and how to use it, see [What is Service Linked Role.](https://www.alibabacloud.com/help/en/doc-detail/171226.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.157.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var @default = new AliCloud.ResourceManager.ServiceLinkedRole("default", new()
    ///     {
    ///         ServiceName = "ops.elasticsearch.aliyuncs.com",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Resource Manager Service Linked Role can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:resourcemanager/serviceLinkedRole:ServiceLinkedRole default &lt;service_name&gt;:&lt;role_name&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:resourcemanager/serviceLinkedRole:ServiceLinkedRole")]
    public partial class ServiceLinkedRole : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The Alibaba Cloud Resource Name (ARN) of the role.
        /// </summary>
        [Output("arn")]
        public Output<string> Arn { get; private set; } = null!;

        /// <summary>
        /// The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
        /// </summary>
        [Output("customSuffix")]
        public Output<string?> CustomSuffix { get; private set; } = null!;

        /// <summary>
        /// The description of the service linked role.  This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// The ID of the role.
        /// </summary>
        [Output("roleId")]
        public Output<string> RoleId { get; private set; } = null!;

        /// <summary>
        /// The name of the role.
        /// </summary>
        [Output("roleName")]
        public Output<string> RoleName { get; private set; } = null!;

        /// <summary>
        /// The service name. For more information about the service name, see [Cloud services that support service linked roles](https://www.alibabacloud.com/help/en/doc-detail/160674.htm)
        /// </summary>
        [Output("serviceName")]
        public Output<string> ServiceName { get; private set; } = null!;


        /// <summary>
        /// Create a ServiceLinkedRole 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 ServiceLinkedRole(string name, ServiceLinkedRoleArgs args, CustomResourceOptions? options = null)
            : base("alicloud:resourcemanager/serviceLinkedRole:ServiceLinkedRole", name, args ?? new ServiceLinkedRoleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ServiceLinkedRole(string name, Input<string> id, ServiceLinkedRoleState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:resourcemanager/serviceLinkedRole:ServiceLinkedRole", 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 ServiceLinkedRole 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 ServiceLinkedRole Get(string name, Input<string> id, ServiceLinkedRoleState? state = null, CustomResourceOptions? options = null)
        {
            return new ServiceLinkedRole(name, id, state, options);
        }
    }

    public sealed class ServiceLinkedRoleArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
        /// </summary>
        [Input("customSuffix")]
        public Input<string>? CustomSuffix { get; set; }

        /// <summary>
        /// The description of the service linked role.  This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The service name. For more information about the service name, see [Cloud services that support service linked roles](https://www.alibabacloud.com/help/en/doc-detail/160674.htm)
        /// </summary>
        [Input("serviceName", required: true)]
        public Input<string> ServiceName { get; set; } = null!;

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

    public sealed class ServiceLinkedRoleState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The Alibaba Cloud Resource Name (ARN) of the role.
        /// </summary>
        [Input("arn")]
        public Input<string>? Arn { get; set; }

        /// <summary>
        /// The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
        /// </summary>
        [Input("customSuffix")]
        public Input<string>? CustomSuffix { get; set; }

        /// <summary>
        /// The description of the service linked role.  This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The ID of the role.
        /// </summary>
        [Input("roleId")]
        public Input<string>? RoleId { get; set; }

        /// <summary>
        /// The name of the role.
        /// </summary>
        [Input("roleName")]
        public Input<string>? RoleName { get; set; }

        /// <summary>
        /// The service name. For more information about the service name, see [Cloud services that support service linked roles](https://www.alibabacloud.com/help/en/doc-detail/160674.htm)
        /// </summary>
        [Input("serviceName")]
        public Input<string>? ServiceName { get; set; }

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