// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** 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.AwsNative.Redshift
{
    /// <summary>
    /// Describes an endpoint authorization for authorizing Redshift-managed VPC endpoint access to a cluster across AWS accounts.
    /// </summary>
    [AwsNativeResourceType("aws-native:redshift:EndpointAuthorization")]
    public partial class EndpointAuthorization : Pulumi.CustomResource
    {
        /// <summary>
        /// The target AWS account ID to grant or revoke access for.
        /// </summary>
        [Output("account")]
        public Output<string> Account { get; private set; } = null!;

        /// <summary>
        /// Indicates whether all VPCs in the grantee account are allowed access to the cluster.
        /// </summary>
        [Output("allowedAllVPCs")]
        public Output<bool> AllowedAllVPCs { get; private set; } = null!;

        /// <summary>
        /// The VPCs allowed access to the cluster.
        /// </summary>
        [Output("allowedVPCs")]
        public Output<ImmutableArray<string>> AllowedVPCs { get; private set; } = null!;

        /// <summary>
        /// The time (UTC) when the authorization was created.
        /// </summary>
        [Output("authorizeTime")]
        public Output<string> AuthorizeTime { get; private set; } = null!;

        /// <summary>
        /// The cluster identifier.
        /// </summary>
        [Output("clusterIdentifier")]
        public Output<string> ClusterIdentifier { get; private set; } = null!;

        /// <summary>
        /// The status of the cluster.
        /// </summary>
        [Output("clusterStatus")]
        public Output<string> ClusterStatus { get; private set; } = null!;

        /// <summary>
        /// The number of Redshift-managed VPC endpoints created for the authorization.
        /// </summary>
        [Output("endpointCount")]
        public Output<int> EndpointCount { get; private set; } = null!;

        /// <summary>
        ///  Indicates whether to force the revoke action. If true, the Redshift-managed VPC endpoints associated with the endpoint authorization are also deleted.
        /// </summary>
        [Output("force")]
        public Output<bool?> Force { get; private set; } = null!;

        /// <summary>
        /// The AWS account ID of the grantee of the cluster.
        /// </summary>
        [Output("grantee")]
        public Output<string> Grantee { get; private set; } = null!;

        /// <summary>
        /// The AWS account ID of the cluster owner.
        /// </summary>
        [Output("grantor")]
        public Output<string> Grantor { get; private set; } = null!;

        /// <summary>
        /// The status of the authorization action.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// The virtual private cloud (VPC) identifiers to grant or revoke access to.
        /// </summary>
        [Output("vpcIds")]
        public Output<ImmutableArray<string>> VpcIds { get; private set; } = null!;


        /// <summary>
        /// Create a EndpointAuthorization 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 EndpointAuthorization(string name, EndpointAuthorizationArgs args, CustomResourceOptions? options = null)
            : base("aws-native:redshift:EndpointAuthorization", name, args ?? new EndpointAuthorizationArgs(), MakeResourceOptions(options, ""))
        {
        }

        private EndpointAuthorization(string name, Input<string> id, CustomResourceOptions? options = null)
            : base("aws-native:redshift:EndpointAuthorization", name, null, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            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 EndpointAuthorization 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="options">A bag of options that control this resource's behavior</param>
        public static EndpointAuthorization Get(string name, Input<string> id, CustomResourceOptions? options = null)
        {
            return new EndpointAuthorization(name, id, options);
        }
    }

    public sealed class EndpointAuthorizationArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The target AWS account ID to grant or revoke access for.
        /// </summary>
        [Input("account", required: true)]
        public Input<string> Account { get; set; } = null!;

        /// <summary>
        /// The cluster identifier.
        /// </summary>
        [Input("clusterIdentifier", required: true)]
        public Input<string> ClusterIdentifier { get; set; } = null!;

        /// <summary>
        ///  Indicates whether to force the revoke action. If true, the Redshift-managed VPC endpoints associated with the endpoint authorization are also deleted.
        /// </summary>
        [Input("force")]
        public Input<bool>? Force { get; set; }

        [Input("vpcIds")]
        private InputList<string>? _vpcIds;

        /// <summary>
        /// The virtual private cloud (VPC) identifiers to grant or revoke access to.
        /// </summary>
        public InputList<string> VpcIds
        {
            get => _vpcIds ?? (_vpcIds = new InputList<string>());
            set => _vpcIds = value;
        }

        public EndpointAuthorizationArgs()
        {
        }
    }
}
