<reponame>Dwonczykj/gember_deploy// *** 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.Cos
{
    /// <summary>
    /// Provides a COS resource to create a COS bucket policy and set its attributes.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var cosPolicy = new Tencentcloud.Cos.BucketPolicy("cosPolicy", new Tencentcloud.Cos.BucketPolicyArgs
    ///         {
    ///             Bucket = "mycos-1258798060",
    ///             Policy = @"{
    ///   ""version"": ""2.0"",
    ///   ""Statement"": [
    ///     {
    ///       ""Principal"": {
    ///         ""qcs"": [
    ///           ""qcs::cam::uin/&lt;your-account-id&gt;:uin/&lt;your-account-id&gt;""
    ///         ]
    ///       },
    ///       ""Action"": [
    ///         ""name/cos:DeleteBucket"",
    ///         ""name/cos:PutBucketACL""
    ///       ],
    ///       ""Effect"": ""allow"",
    ///       ""Resource"": [
    ///         ""qcs::cos:&lt;bucket region&gt;:uid/&lt;your-account-id&gt;:&lt;bucket name&gt;/*""
    ///       ]
    ///     }
    ///   ]
    /// }
    /// 
    /// ",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// COS bucket policy can be imported, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import tencentcloud:Cos/bucketPolicy:BucketPolicy bucket bucket-name
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Cos/bucketPolicy:BucketPolicy")]
    public partial class BucketPolicy : Pulumi.CustomResource
    {
        /// <summary>
        /// The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example `mycos-1258798060`.
        /// </summary>
        [Output("bucket")]
        public Output<string> Bucket { get; private set; } = null!;

        /// <summary>
        /// The text of the policy. For more info please refer to [Tencent official doc](https://intl.cloud.tencent.com/document/product/436/18023).
        /// </summary>
        [Output("policy")]
        public Output<string> Policy { get; private set; } = null!;


        /// <summary>
        /// Create a BucketPolicy 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 BucketPolicy(string name, BucketPolicyArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Cos/bucketPolicy:BucketPolicy", name, args ?? new BucketPolicyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private BucketPolicy(string name, Input<string> id, BucketPolicyState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Cos/bucketPolicy:BucketPolicy", 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/tencentcloudstack",
            };
            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 BucketPolicy 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 BucketPolicy Get(string name, Input<string> id, BucketPolicyState? state = null, CustomResourceOptions? options = null)
        {
            return new BucketPolicy(name, id, state, options);
        }
    }

    public sealed class BucketPolicyArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example `mycos-1258798060`.
        /// </summary>
        [Input("bucket", required: true)]
        public Input<string> Bucket { get; set; } = null!;

        /// <summary>
        /// The text of the policy. For more info please refer to [Tencent official doc](https://intl.cloud.tencent.com/document/product/436/18023).
        /// </summary>
        [Input("policy", required: true)]
        public Input<string> Policy { get; set; } = null!;

        public BucketPolicyArgs()
        {
        }
    }

    public sealed class BucketPolicyState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example `mycos-1258798060`.
        /// </summary>
        [Input("bucket")]
        public Input<string>? Bucket { get; set; }

        /// <summary>
        /// The text of the policy. For more info please refer to [Tencent official doc](https://intl.cloud.tencent.com/document/product/436/18023).
        /// </summary>
        [Input("policy")]
        public Input<string>? Policy { get; set; }

        public BucketPolicyState()
        {
        }
    }
}
