// *** 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.Yandex
{
    /// <summary>
    /// Allows creation and management of the IAM policy for an existing Yandex Resource
    /// Manager folder.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Yandex = Pulumi.Yandex;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var project1 = Yandex.GetResourcemanagerFolder.Invoke(new()
    ///     {
    ///         FolderId = "my_folder_id",
    ///     });
    /// 
    ///     var admin = Yandex.GetIamPolicy.Invoke(new()
    ///     {
    ///         Bindings = new[]
    ///         {
    ///             new Yandex.Inputs.GetIamPolicyBindingInputArgs
    ///             {
    ///                 Members = new[]
    ///                 {
    ///                     "userAccount:some_user_id",
    ///                 },
    ///                 Role = "editor",
    ///             },
    ///         },
    ///     });
    /// 
    ///     var folderAdminPolicy = new Yandex.ResourcemanagerFolderIamPolicy("folderAdminPolicy", new()
    ///     {
    ///         FolderId = data.Yandex_folder.Project1.Id,
    ///         PolicyData = admin.Apply(getIamPolicyResult =&gt; getIamPolicyResult.PolicyData),
    ///     });
    /// 
    /// });
    /// ```
    /// </summary>
    [YandexResourceType("yandex:index/resourcemanagerFolderIamPolicy:ResourcemanagerFolderIamPolicy")]
    public partial class ResourcemanagerFolderIamPolicy : global::Pulumi.CustomResource
    {
        /// <summary>
        /// ID of the folder that the policy is attached to.
        /// </summary>
        [Output("folderId")]
        public Output<string> FolderId { get; private set; } = null!;

        /// <summary>
        /// The `yandex.getIamPolicy` data source that represents
        /// the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
        /// </summary>
        [Output("policyData")]
        public Output<string> PolicyData { get; private set; } = null!;


        /// <summary>
        /// Create a ResourcemanagerFolderIamPolicy 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 ResourcemanagerFolderIamPolicy(string name, ResourcemanagerFolderIamPolicyArgs args, CustomResourceOptions? options = null)
            : base("yandex:index/resourcemanagerFolderIamPolicy:ResourcemanagerFolderIamPolicy", name, args ?? new ResourcemanagerFolderIamPolicyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ResourcemanagerFolderIamPolicy(string name, Input<string> id, ResourcemanagerFolderIamPolicyState? state = null, CustomResourceOptions? options = null)
            : base("yandex:index/resourcemanagerFolderIamPolicy:ResourcemanagerFolderIamPolicy", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "https://github.com/regrau/pulumi-yandex/releases",
            };
            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 ResourcemanagerFolderIamPolicy 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 ResourcemanagerFolderIamPolicy Get(string name, Input<string> id, ResourcemanagerFolderIamPolicyState? state = null, CustomResourceOptions? options = null)
        {
            return new ResourcemanagerFolderIamPolicy(name, id, state, options);
        }
    }

    public sealed class ResourcemanagerFolderIamPolicyArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// ID of the folder that the policy is attached to.
        /// </summary>
        [Input("folderId", required: true)]
        public Input<string> FolderId { get; set; } = null!;

        /// <summary>
        /// The `yandex.getIamPolicy` data source that represents
        /// the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
        /// </summary>
        [Input("policyData", required: true)]
        public Input<string> PolicyData { get; set; } = null!;

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

    public sealed class ResourcemanagerFolderIamPolicyState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// ID of the folder that the policy is attached to.
        /// </summary>
        [Input("folderId")]
        public Input<string>? FolderId { get; set; }

        /// <summary>
        /// The `yandex.getIamPolicy` data source that represents
        /// the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
        /// </summary>
        [Input("policyData")]
        public Input<string>? PolicyData { get; set; }

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