<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks<filename>sdk/dotnet/Sae/Ingress.cs// *** 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.AliCloud.Sae
{
    /// <summary>
    /// Provides a Serverless App Engine (SAE) Ingress resource.
    /// 
    /// For information about Serverless App Engine (SAE) Ingress and how to use it, see [What is Ingress](https://help.aliyun.com/document_detail/97792.html).
    /// 
    /// &gt; **NOTE:** Available in v1.137.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var config = new Config();
    ///     var name = config.Get("name") ?? "example_value";
    ///     var defaultZones = AliCloud.GetZones.Invoke(new()
    ///     {
    ///         AvailableResourceCreation = "VSwitch",
    ///     });
    /// 
    ///     var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
    ///     {
    ///         CidrBlock = "172.16.0.0/12",
    ///     });
    /// 
    ///     var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
    ///     {
    ///         VpcId = defaultNetwork.Id,
    ///         CidrBlock = "172.16.0.0/21",
    ///         ZoneId = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
    ///         VswitchName = name,
    ///     });
    /// 
    ///     var defaultLoadBalancer = new AliCloud.Slb.LoadBalancer("defaultLoadBalancer", new()
    ///     {
    ///         Specification = "slb.s2.small",
    ///         VswitchId = data.Alicloud_vswitches.Default.Ids[0],
    ///     });
    /// 
    ///     var namespaceId = config.Get("namespaceId") ?? "cn-hangzhou:yourname";
    ///     var defaultNamespace = new AliCloud.Sae.Namespace("defaultNamespace", new()
    ///     {
    ///         NamespaceId = namespaceId,
    ///         NamespaceName = name,
    ///         NamespaceDescription = name,
    ///     });
    /// 
    ///     var defaultApplication = new AliCloud.Sae.Application("defaultApplication", new()
    ///     {
    ///         AppDescription = "your_app_description",
    ///         AppName = "your_app_name",
    ///         NamespaceId = "your_namespace_id",
    ///         PackageUrl = "your_package_url",
    ///         PackageType = "your_package_url",
    ///         Jdk = "jdk_specifications",
    ///         VswitchId = data.Alicloud_vswitches.Default.Ids[0],
    ///         Replicas = "your_replicas",
    ///         Cpu = "cpu_specifications",
    ///         Memory = "memory_specifications",
    ///     });
    /// 
    ///     var defaultIngress = new AliCloud.Sae.Ingress("defaultIngress", new()
    ///     {
    ///         SlbId = defaultLoadBalancer.Id,
    ///         NamespaceId = defaultNamespace.Id,
    ///         ListenerPort = "your_listener_port",
    ///         Rules = new[]
    ///         {
    ///             new AliCloud.Sae.Inputs.IngressRuleArgs
    ///             {
    ///                 AppId = defaultApplication.Id,
    ///                 ContainerPort = "your_container_port",
    ///                 Domain = "your_domain",
    ///                 AppName = "your_name",
    ///                 Path = "your_path",
    ///             },
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Serverless App Engine (SAE) Ingress can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:sae/ingress:Ingress example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:sae/ingress:Ingress")]
    public partial class Ingress : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Cert Id.
        /// </summary>
        [Output("certId")]
        public Output<string?> CertId { get; private set; } = null!;

        /// <summary>
        /// Default Rule.
        /// </summary>
        [Output("defaultRule")]
        public Output<Outputs.IngressDefaultRule?> DefaultRule { get; private set; } = null!;

        /// <summary>
        /// Description.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// SLB listening port.
        /// </summary>
        [Output("listenerPort")]
        public Output<int> ListenerPort { get; private set; } = null!;

        /// <summary>
        /// The Id of Namespace.It can contain 2 to 32 lowercase characters.The value is in format `{RegionId}:{namespace}`
        /// </summary>
        [Output("namespaceId")]
        public Output<string> NamespaceId { get; private set; } = null!;

        /// <summary>
        /// Forwarding rules. Forward traffic to the specified application according to the domain name and path.
        /// </summary>
        [Output("rules")]
        public Output<ImmutableArray<Outputs.IngressRule>> Rules { get; private set; } = null!;

        /// <summary>
        /// SLB ID.
        /// </summary>
        [Output("slbId")]
        public Output<string> SlbId { get; private set; } = null!;


        /// <summary>
        /// Create a Ingress 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 Ingress(string name, IngressArgs args, CustomResourceOptions? options = null)
            : base("alicloud:sae/ingress:Ingress", name, args ?? new IngressArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Ingress(string name, Input<string> id, IngressState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:sae/ingress:Ingress", 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/rhysmdnz/pulumi-alicloud",
            };
            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 Ingress 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 Ingress Get(string name, Input<string> id, IngressState? state = null, CustomResourceOptions? options = null)
        {
            return new Ingress(name, id, state, options);
        }
    }

    public sealed class IngressArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Cert Id.
        /// </summary>
        [Input("certId")]
        public Input<string>? CertId { get; set; }

        /// <summary>
        /// Default Rule.
        /// </summary>
        [Input("defaultRule")]
        public Input<Inputs.IngressDefaultRuleArgs>? DefaultRule { get; set; }

        /// <summary>
        /// Description.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// SLB listening port.
        /// </summary>
        [Input("listenerPort", required: true)]
        public Input<int> ListenerPort { get; set; } = null!;

        /// <summary>
        /// The Id of Namespace.It can contain 2 to 32 lowercase characters.The value is in format `{RegionId}:{namespace}`
        /// </summary>
        [Input("namespaceId", required: true)]
        public Input<string> NamespaceId { get; set; } = null!;

        [Input("rules", required: true)]
        private InputList<Inputs.IngressRuleArgs>? _rules;

        /// <summary>
        /// Forwarding rules. Forward traffic to the specified application according to the domain name and path.
        /// </summary>
        public InputList<Inputs.IngressRuleArgs> Rules
        {
            get => _rules ?? (_rules = new InputList<Inputs.IngressRuleArgs>());
            set => _rules = value;
        }

        /// <summary>
        /// SLB ID.
        /// </summary>
        [Input("slbId", required: true)]
        public Input<string> SlbId { get; set; } = null!;

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

    public sealed class IngressState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Cert Id.
        /// </summary>
        [Input("certId")]
        public Input<string>? CertId { get; set; }

        /// <summary>
        /// Default Rule.
        /// </summary>
        [Input("defaultRule")]
        public Input<Inputs.IngressDefaultRuleGetArgs>? DefaultRule { get; set; }

        /// <summary>
        /// Description.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// SLB listening port.
        /// </summary>
        [Input("listenerPort")]
        public Input<int>? ListenerPort { get; set; }

        /// <summary>
        /// The Id of Namespace.It can contain 2 to 32 lowercase characters.The value is in format `{RegionId}:{namespace}`
        /// </summary>
        [Input("namespaceId")]
        public Input<string>? NamespaceId { get; set; }

        [Input("rules")]
        private InputList<Inputs.IngressRuleGetArgs>? _rules;

        /// <summary>
        /// Forwarding rules. Forward traffic to the specified application according to the domain name and path.
        /// </summary>
        public InputList<Inputs.IngressRuleGetArgs> Rules
        {
            get => _rules ?? (_rules = new InputList<Inputs.IngressRuleGetArgs>());
            set => _rules = value;
        }

        /// <summary>
        /// SLB ID.
        /// </summary>
        [Input("slbId")]
        public Input<string>? SlbId { get; set; }

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