<gh_stars>0// *** 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;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Cam
{
    public static class GetRolePolicyAttachments
    {
        /// <summary>
        /// Use this data source to query detailed information of CAM role policy attachments
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Cam.GetRolePolicyAttachments.InvokeAsync(new Tencentcloud.Cam.GetRolePolicyAttachmentsArgs
        ///         {
        ///             RoleId = tencentcloud_cam_role.Foo.Id,
        ///         }));
        ///         var bar = Output.Create(Tencentcloud.Cam.GetRolePolicyAttachments.InvokeAsync(new Tencentcloud.Cam.GetRolePolicyAttachmentsArgs
        ///         {
        ///             RoleId = tencentcloud_cam_role.Foo.Id,
        ///             PolicyId = tencentcloud_cam_policy.Foo.Id,
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetRolePolicyAttachmentsResult> InvokeAsync(GetRolePolicyAttachmentsArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetRolePolicyAttachmentsResult>("tencentcloud:Cam/getRolePolicyAttachments:getRolePolicyAttachments", args ?? new GetRolePolicyAttachmentsArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query detailed information of CAM role policy attachments
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Cam.GetRolePolicyAttachments.InvokeAsync(new Tencentcloud.Cam.GetRolePolicyAttachmentsArgs
        ///         {
        ///             RoleId = tencentcloud_cam_role.Foo.Id,
        ///         }));
        ///         var bar = Output.Create(Tencentcloud.Cam.GetRolePolicyAttachments.InvokeAsync(new Tencentcloud.Cam.GetRolePolicyAttachmentsArgs
        ///         {
        ///             RoleId = tencentcloud_cam_role.Foo.Id,
        ///             PolicyId = tencentcloud_cam_policy.Foo.Id,
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetRolePolicyAttachmentsResult> Invoke(GetRolePolicyAttachmentsInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetRolePolicyAttachmentsResult>("tencentcloud:Cam/getRolePolicyAttachments:getRolePolicyAttachments", args ?? new GetRolePolicyAttachmentsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetRolePolicyAttachmentsArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Mode of Creation of the CAM user policy attachment. `1` means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
        /// </summary>
        [Input("createMode")]
        public int? CreateMode { get; set; }

        /// <summary>
        /// ID of CAM policy to be queried.
        /// </summary>
        [Input("policyId")]
        public string? PolicyId { get; set; }

        /// <summary>
        /// Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
        /// </summary>
        [Input("policyType")]
        public string? PolicyType { get; set; }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public string? ResultOutputFile { get; set; }

        /// <summary>
        /// ID of the attached CAM role to be queried.
        /// </summary>
        [Input("roleId", required: true)]
        public string RoleId { get; set; } = null!;

        public GetRolePolicyAttachmentsArgs()
        {
        }
    }

    public sealed class GetRolePolicyAttachmentsInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Mode of Creation of the CAM user policy attachment. `1` means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
        /// </summary>
        [Input("createMode")]
        public Input<int>? CreateMode { get; set; }

        /// <summary>
        /// ID of CAM policy to be queried.
        /// </summary>
        [Input("policyId")]
        public Input<string>? PolicyId { get; set; }

        /// <summary>
        /// Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
        /// </summary>
        [Input("policyType")]
        public Input<string>? PolicyType { get; set; }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public Input<string>? ResultOutputFile { get; set; }

        /// <summary>
        /// ID of the attached CAM role to be queried.
        /// </summary>
        [Input("roleId", required: true)]
        public Input<string> RoleId { get; set; } = null!;

        public GetRolePolicyAttachmentsInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetRolePolicyAttachmentsResult
    {
        /// <summary>
        /// Mode of Creation of the CAM role policy attachment. `1` means the cam policy attachment is created by production, and the others indicate syntax strategy ways.
        /// </summary>
        public readonly int? CreateMode;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// Name of CAM role.
        /// </summary>
        public readonly string? PolicyId;
        /// <summary>
        /// Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
        /// </summary>
        public readonly string? PolicyType;
        public readonly string? ResultOutputFile;
        /// <summary>
        /// ID of CAM role.
        /// </summary>
        public readonly string RoleId;
        /// <summary>
        /// A list of CAM role policy attachments. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetRolePolicyAttachmentsRolePolicyAttachmentListResult> RolePolicyAttachmentLists;

        [OutputConstructor]
        private GetRolePolicyAttachmentsResult(
            int? createMode,

            string id,

            string? policyId,

            string? policyType,

            string? resultOutputFile,

            string roleId,

            ImmutableArray<Outputs.GetRolePolicyAttachmentsRolePolicyAttachmentListResult> rolePolicyAttachmentLists)
        {
            CreateMode = createMode;
            Id = id;
            PolicyId = policyId;
            PolicyType = policyType;
            ResultOutputFile = resultOutputFile;
            RoleId = roleId;
            RolePolicyAttachmentLists = rolePolicyAttachmentLists;
        }
    }
}
