<reponame>astipkovits/pulumi-aviatrix<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;

namespace Pulumi.Aviatrix
{
    /// <summary>
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.IO;
    /// using Pulumi;
    /// using Aviatrix = Pulumi.Aviatrix;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // Create an Aviatrix AWS SAML Endpoint
    ///     var testSamlEndpoint = new Aviatrix.AviatrixSamlEndpoint("testSamlEndpoint", new()
    ///     {
    ///         EndpointName = "saml-test",
    ///         IdpMetadataType = "Text",
    ///         IdpMetadata = File.ReadAllText("idp_metadata.xml"),
    ///     });
    /// 
    /// });
    /// ```
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Aviatrix = Pulumi.Aviatrix;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // Create an Aviatrix AWS SAML Endpoint using Metadata UDL
    ///     var testSamlEndpoint = new Aviatrix.AviatrixSamlEndpoint("testSamlEndpoint", new()
    ///     {
    ///         EndpointName = "saml-test",
    ///         IdpMetadataType = "URL",
    ///         IdpMetadataUrl = "https://dev-xyzz.okta.com/app/asdfasdfwfwf/sso/saml/metadata",
    ///     });
    /// 
    /// });
    /// ```
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Aviatrix = Pulumi.Aviatrix;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // Create an Aviatrix AWS SAML Endpoint for Controller Login
    ///     var testSamlEndpoint = new Aviatrix.AviatrixSamlEndpoint("testSamlEndpoint", new()
    ///     {
    ///         AccessSetBy = "controller",
    ///         ControllerLogin = true,
    ///         EndpointName = "saml-test",
    ///         IdpMetadata = @var.Idp_metadata,
    ///         IdpMetadataType = "Text",
    ///         RbacGroups = new[]
    ///         {
    ///             "admin",
    ///             "read_only",
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// **saml_endpoint** can be imported using the SAML `endpoint_name`, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import aviatrix:index/aviatrixSamlEndpoint:AviatrixSamlEndpoint test saml-test
    /// ```
    /// </summary>
    [AviatrixResourceType("aviatrix:index/aviatrixSamlEndpoint:AviatrixSamlEndpoint")]
    public partial class AviatrixSamlEndpoint : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Access type. Valid values: "controller", "profile_attribute". Default value: "controller".
        /// </summary>
        [Output("accessSetBy")]
        public Output<string?> AccessSetBy { get; private set; } = null!;

        /// <summary>
        /// Valid values: true, false. Default value: false. Set true for creating a saml endpoint for controller login.
        /// </summary>
        [Output("controllerLogin")]
        public Output<bool?> ControllerLogin { get; private set; } = null!;

        /// <summary>
        /// Custom Entity ID. Required to be non-empty for 'Custom' Entity ID type, empty for 'Hostname' Entity ID type.
        /// </summary>
        [Output("customEntityId")]
        public Output<string?> CustomEntityId { get; private set; } = null!;

        /// <summary>
        /// Custom SAML Request Template in string.
        /// </summary>
        [Output("customSamlRequestTemplate")]
        public Output<string?> CustomSamlRequestTemplate { get; private set; } = null!;

        /// <summary>
        /// The SAML endpoint name.
        /// </summary>
        [Output("endpointName")]
        public Output<string> EndpointName { get; private set; } = null!;

        /// <summary>
        /// The IDP Metadata from SAML provider. Required if `idp_metadata_type` is "Text" and should be unset if type is "URL". Normally the metadata is in XML format which may contain special characters. Best practice is to use the file function to read from a local Metadata XML file.
        /// </summary>
        [Output("idpMetadata")]
        public Output<string?> IdpMetadata { get; private set; } = null!;

        /// <summary>
        /// The IDP Metadata type. Can be either "Text" or "URL".
        /// </summary>
        [Output("idpMetadataType")]
        public Output<string> IdpMetadataType { get; private set; } = null!;

        /// <summary>
        /// The IDP Metadata URL from SAML provider. Required if `idp_metadata_type` is "URL" and should be unset if type is "Text".
        /// </summary>
        [Output("idpMetadataUrl")]
        public Output<string?> IdpMetadataUrl { get; private set; } = null!;

        /// <summary>
        /// List of rbac groups. Required for controller login and "access_set_by" of "controller".
        /// </summary>
        [Output("rbacGroups")]
        public Output<ImmutableArray<string>> RbacGroups { get; private set; } = null!;

        /// <summary>
        /// Whether to sign SAML AuthnRequests
        /// </summary>
        [Output("signAuthnRequests")]
        public Output<bool?> SignAuthnRequests { get; private set; } = null!;


        /// <summary>
        /// Create a AviatrixSamlEndpoint 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 AviatrixSamlEndpoint(string name, AviatrixSamlEndpointArgs args, CustomResourceOptions? options = null)
            : base("aviatrix:index/aviatrixSamlEndpoint:AviatrixSamlEndpoint", name, args ?? new AviatrixSamlEndpointArgs(), MakeResourceOptions(options, ""))
        {
        }

        private AviatrixSamlEndpoint(string name, Input<string> id, AviatrixSamlEndpointState? state = null, CustomResourceOptions? options = null)
            : base("aviatrix:index/aviatrixSamlEndpoint:AviatrixSamlEndpoint", 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/astipkovits",
            };
            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 AviatrixSamlEndpoint 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 AviatrixSamlEndpoint Get(string name, Input<string> id, AviatrixSamlEndpointState? state = null, CustomResourceOptions? options = null)
        {
            return new AviatrixSamlEndpoint(name, id, state, options);
        }
    }

    public sealed class AviatrixSamlEndpointArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Access type. Valid values: "controller", "profile_attribute". Default value: "controller".
        /// </summary>
        [Input("accessSetBy")]
        public Input<string>? AccessSetBy { get; set; }

        /// <summary>
        /// Valid values: true, false. Default value: false. Set true for creating a saml endpoint for controller login.
        /// </summary>
        [Input("controllerLogin")]
        public Input<bool>? ControllerLogin { get; set; }

        /// <summary>
        /// Custom Entity ID. Required to be non-empty for 'Custom' Entity ID type, empty for 'Hostname' Entity ID type.
        /// </summary>
        [Input("customEntityId")]
        public Input<string>? CustomEntityId { get; set; }

        /// <summary>
        /// Custom SAML Request Template in string.
        /// </summary>
        [Input("customSamlRequestTemplate")]
        public Input<string>? CustomSamlRequestTemplate { get; set; }

        /// <summary>
        /// The SAML endpoint name.
        /// </summary>
        [Input("endpointName", required: true)]
        public Input<string> EndpointName { get; set; } = null!;

        /// <summary>
        /// The IDP Metadata from SAML provider. Required if `idp_metadata_type` is "Text" and should be unset if type is "URL". Normally the metadata is in XML format which may contain special characters. Best practice is to use the file function to read from a local Metadata XML file.
        /// </summary>
        [Input("idpMetadata")]
        public Input<string>? IdpMetadata { get; set; }

        /// <summary>
        /// The IDP Metadata type. Can be either "Text" or "URL".
        /// </summary>
        [Input("idpMetadataType", required: true)]
        public Input<string> IdpMetadataType { get; set; } = null!;

        /// <summary>
        /// The IDP Metadata URL from SAML provider. Required if `idp_metadata_type` is "URL" and should be unset if type is "Text".
        /// </summary>
        [Input("idpMetadataUrl")]
        public Input<string>? IdpMetadataUrl { get; set; }

        [Input("rbacGroups")]
        private InputList<string>? _rbacGroups;

        /// <summary>
        /// List of rbac groups. Required for controller login and "access_set_by" of "controller".
        /// </summary>
        public InputList<string> RbacGroups
        {
            get => _rbacGroups ?? (_rbacGroups = new InputList<string>());
            set => _rbacGroups = value;
        }

        /// <summary>
        /// Whether to sign SAML AuthnRequests
        /// </summary>
        [Input("signAuthnRequests")]
        public Input<bool>? SignAuthnRequests { get; set; }

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

    public sealed class AviatrixSamlEndpointState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Access type. Valid values: "controller", "profile_attribute". Default value: "controller".
        /// </summary>
        [Input("accessSetBy")]
        public Input<string>? AccessSetBy { get; set; }

        /// <summary>
        /// Valid values: true, false. Default value: false. Set true for creating a saml endpoint for controller login.
        /// </summary>
        [Input("controllerLogin")]
        public Input<bool>? ControllerLogin { get; set; }

        /// <summary>
        /// Custom Entity ID. Required to be non-empty for 'Custom' Entity ID type, empty for 'Hostname' Entity ID type.
        /// </summary>
        [Input("customEntityId")]
        public Input<string>? CustomEntityId { get; set; }

        /// <summary>
        /// Custom SAML Request Template in string.
        /// </summary>
        [Input("customSamlRequestTemplate")]
        public Input<string>? CustomSamlRequestTemplate { get; set; }

        /// <summary>
        /// The SAML endpoint name.
        /// </summary>
        [Input("endpointName")]
        public Input<string>? EndpointName { get; set; }

        /// <summary>
        /// The IDP Metadata from SAML provider. Required if `idp_metadata_type` is "Text" and should be unset if type is "URL". Normally the metadata is in XML format which may contain special characters. Best practice is to use the file function to read from a local Metadata XML file.
        /// </summary>
        [Input("idpMetadata")]
        public Input<string>? IdpMetadata { get; set; }

        /// <summary>
        /// The IDP Metadata type. Can be either "Text" or "URL".
        /// </summary>
        [Input("idpMetadataType")]
        public Input<string>? IdpMetadataType { get; set; }

        /// <summary>
        /// The IDP Metadata URL from SAML provider. Required if `idp_metadata_type` is "URL" and should be unset if type is "Text".
        /// </summary>
        [Input("idpMetadataUrl")]
        public Input<string>? IdpMetadataUrl { get; set; }

        [Input("rbacGroups")]
        private InputList<string>? _rbacGroups;

        /// <summary>
        /// List of rbac groups. Required for controller login and "access_set_by" of "controller".
        /// </summary>
        public InputList<string> RbacGroups
        {
            get => _rbacGroups ?? (_rbacGroups = new InputList<string>());
            set => _rbacGroups = value;
        }

        /// <summary>
        /// Whether to sign SAML AuthnRequests
        /// </summary>
        [Input("signAuthnRequests")]
        public Input<bool>? SignAuthnRequests { get; set; }

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