<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks// *** 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.Ram
{
    /// <summary>
    /// Provides a RAM Group membership resource.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // Create a RAM Group membership.
    ///     var @group = new AliCloud.Ram.Group("group", new()
    ///     {
    ///         Comments = "this is a group comments.",
    ///         Force = true,
    ///     });
    /// 
    ///     var user = new AliCloud.Ram.User("user", new()
    ///     {
    ///         DisplayName = "user_display_name",
    ///         Mobile = "86-18688888888",
    ///         Email = "efpyi@example.com",
    ///         Comments = "yoyoyo",
    ///         Force = true,
    ///     });
    /// 
    ///     var user1 = new AliCloud.Ram.User("user1", new()
    ///     {
    ///         DisplayName = "user_display_name1",
    ///         Mobile = "86-18688888889",
    ///         Email = "efpyi@example.com",
    ///         Comments = "yoyoyo",
    ///         Force = true,
    ///     });
    /// 
    ///     var membership = new AliCloud.Ram.GroupMembership("membership", new()
    ///     {
    ///         GroupName = @group.Name,
    ///         UserNames = new[]
    ///         {
    ///             user.Name,
    ///             user1.Name,
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// RAM Group membership can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:ram/groupMembership:GroupMembership example my-group
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:ram/groupMembership:GroupMembership")]
    public partial class GroupMembership : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Name of the RAM group. This name can have a string of 1 to 64 characters, must contain only alphanumeric characters or hyphen "-", and must not begin with a hyphen.
        /// </summary>
        [Output("groupName")]
        public Output<string> GroupName { get; private set; } = null!;

        /// <summary>
        /// Set of user name which will be added to group. Each name can have a string of 1 to 64 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin with a hyphen.
        /// </summary>
        [Output("userNames")]
        public Output<ImmutableArray<string>> UserNames { get; private set; } = null!;


        /// <summary>
        /// Create a GroupMembership 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 GroupMembership(string name, GroupMembershipArgs args, CustomResourceOptions? options = null)
            : base("alicloud:ram/groupMembership:GroupMembership", name, args ?? new GroupMembershipArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class GroupMembershipArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Name of the RAM group. This name can have a string of 1 to 64 characters, must contain only alphanumeric characters or hyphen "-", and must not begin with a hyphen.
        /// </summary>
        [Input("groupName", required: true)]
        public Input<string> GroupName { get; set; } = null!;

        [Input("userNames", required: true)]
        private InputList<string>? _userNames;

        /// <summary>
        /// Set of user name which will be added to group. Each name can have a string of 1 to 64 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin with a hyphen.
        /// </summary>
        public InputList<string> UserNames
        {
            get => _userNames ?? (_userNames = new InputList<string>());
            set => _userNames = value;
        }

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

    public sealed class GroupMembershipState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Name of the RAM group. This name can have a string of 1 to 64 characters, must contain only alphanumeric characters or hyphen "-", and must not begin with a hyphen.
        /// </summary>
        [Input("groupName")]
        public Input<string>? GroupName { get; set; }

        [Input("userNames")]
        private InputList<string>? _userNames;

        /// <summary>
        /// Set of user name which will be added to group. Each name can have a string of 1 to 64 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin with a hyphen.
        /// </summary>
        public InputList<string> UserNames
        {
            get => _userNames ?? (_userNames = new InputList<string>());
            set => _userNames = value;
        }

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