<filename>sdk/dotnet/FC/CustomDomain.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.FC
{
    /// <summary>
    /// Provides an Alicloud Function Compute custom domain resource.
    ///  For the detailed information, please refer to the [developer guide](https://www.alibabacloud.com/help/doc-detail/90759.htm).
    /// 
    /// &gt; **NOTE:** Available in 1.98.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") ?? "tf-testaccalicloudfcservice";
    ///     var defaultService = new AliCloud.FC.Service("defaultService", new()
    ///     {
    ///         Description = $"{name}-description",
    ///     });
    /// 
    ///     var defaultBucket = new AliCloud.Oss.Bucket("defaultBucket", new()
    ///     {
    ///         BucketName = name,
    ///     });
    /// 
    ///     var defaultBucketObject = new AliCloud.Oss.BucketObject("defaultBucketObject", new()
    ///     {
    ///         Bucket = defaultBucket.Id,
    ///         Key = "fc/hello.zip",
    ///         Content = @"		# -*- coding: utf-8 -*-
    /// 	def handler(event, context):
    /// 		print ""hello world""
    /// 		return 'hello world'
    /// ",
    ///     });
    /// 
    ///     var defaultFunction = new AliCloud.FC.Function("defaultFunction", new()
    ///     {
    ///         Service = defaultService.Name,
    ///         OssBucket = defaultBucket.Id,
    ///         OssKey = defaultBucketObject.Key,
    ///         MemorySize = 512,
    ///         Runtime = "python2.7",
    ///         Handler = "hello.handler",
    ///     });
    /// 
    ///     var defaultCustomDomain = new AliCloud.FC.CustomDomain("defaultCustomDomain", new()
    ///     {
    ///         DomainName = "terraform.functioncompute.com",
    ///         Protocol = "HTTP",
    ///         RouteConfigs = new[]
    ///         {
    ///             new AliCloud.FC.Inputs.CustomDomainRouteConfigArgs
    ///             {
    ///                 Path = "/login/*",
    ///                 ServiceName = defaultService.Name,
    ///                 FunctionName = defaultFunction.Name,
    ///                 Qualifier = "v1",
    ///                 Methods = new[]
    ///                 {
    ///                     "GET",
    ///                     "POST",
    ///                 },
    ///             },
    ///         },
    ///         CertConfig = new AliCloud.FC.Inputs.CustomDomainCertConfigArgs
    ///         {
    ///             CertName = "your certificate name",
    ///             PrivateKey = "your private key",
    ///             Certificate = "your certificate data",
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Function Compute custom domain can be imported using the id or the domain name, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:fc/customDomain:CustomDomain foo my-fc-custom-domain
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:fc/customDomain:CustomDomain")]
    public partial class CustomDomain : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The account id.
        /// </summary>
        [Output("accountId")]
        public Output<string> AccountId { get; private set; } = null!;

        /// <summary>
        /// The api version of Function Compute.
        /// </summary>
        [Output("apiVersion")]
        public Output<string> ApiVersion { get; private set; } = null!;

        /// <summary>
        /// The configuration of HTTPS certificate.
        /// </summary>
        [Output("certConfig")]
        public Output<Outputs.CustomDomainCertConfig?> CertConfig { get; private set; } = null!;

        /// <summary>
        /// The date this resource was created.
        /// </summary>
        [Output("createdTime")]
        public Output<string> CreatedTime { get; private set; } = null!;

        /// <summary>
        /// The custom domain name. For example, "example.com".
        /// </summary>
        [Output("domainName")]
        public Output<string> DomainName { get; private set; } = null!;

        /// <summary>
        /// The date this resource was last modified.
        /// </summary>
        [Output("lastModifiedTime")]
        public Output<string> LastModifiedTime { get; private set; } = null!;

        /// <summary>
        /// The protocol, `HTTP` or `HTTP,HTTPS`.
        /// </summary>
        [Output("protocol")]
        public Output<string> Protocol { get; private set; } = null!;

        /// <summary>
        /// The configuration of domain route, mapping the path and Function Compute function.
        /// </summary>
        [Output("routeConfigs")]
        public Output<ImmutableArray<Outputs.CustomDomainRouteConfig>> RouteConfigs { get; private set; } = null!;


        /// <summary>
        /// Create a CustomDomain 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 CustomDomain(string name, CustomDomainArgs args, CustomResourceOptions? options = null)
            : base("alicloud:fc/customDomain:CustomDomain", name, args ?? new CustomDomainArgs(), MakeResourceOptions(options, ""))
        {
        }

        private CustomDomain(string name, Input<string> id, CustomDomainState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:fc/customDomain:CustomDomain", 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 CustomDomain 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 CustomDomain Get(string name, Input<string> id, CustomDomainState? state = null, CustomResourceOptions? options = null)
        {
            return new CustomDomain(name, id, state, options);
        }
    }

    public sealed class CustomDomainArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The configuration of HTTPS certificate.
        /// </summary>
        [Input("certConfig")]
        public Input<Inputs.CustomDomainCertConfigArgs>? CertConfig { get; set; }

        /// <summary>
        /// The custom domain name. For example, "example.com".
        /// </summary>
        [Input("domainName", required: true)]
        public Input<string> DomainName { get; set; } = null!;

        /// <summary>
        /// The protocol, `HTTP` or `HTTP,HTTPS`.
        /// </summary>
        [Input("protocol", required: true)]
        public Input<string> Protocol { get; set; } = null!;

        [Input("routeConfigs")]
        private InputList<Inputs.CustomDomainRouteConfigArgs>? _routeConfigs;

        /// <summary>
        /// The configuration of domain route, mapping the path and Function Compute function.
        /// </summary>
        public InputList<Inputs.CustomDomainRouteConfigArgs> RouteConfigs
        {
            get => _routeConfigs ?? (_routeConfigs = new InputList<Inputs.CustomDomainRouteConfigArgs>());
            set => _routeConfigs = value;
        }

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

    public sealed class CustomDomainState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The account id.
        /// </summary>
        [Input("accountId")]
        public Input<string>? AccountId { get; set; }

        /// <summary>
        /// The api version of Function Compute.
        /// </summary>
        [Input("apiVersion")]
        public Input<string>? ApiVersion { get; set; }

        /// <summary>
        /// The configuration of HTTPS certificate.
        /// </summary>
        [Input("certConfig")]
        public Input<Inputs.CustomDomainCertConfigGetArgs>? CertConfig { get; set; }

        /// <summary>
        /// The date this resource was created.
        /// </summary>
        [Input("createdTime")]
        public Input<string>? CreatedTime { get; set; }

        /// <summary>
        /// The custom domain name. For example, "example.com".
        /// </summary>
        [Input("domainName")]
        public Input<string>? DomainName { get; set; }

        /// <summary>
        /// The date this resource was last modified.
        /// </summary>
        [Input("lastModifiedTime")]
        public Input<string>? LastModifiedTime { get; set; }

        /// <summary>
        /// The protocol, `HTTP` or `HTTP,HTTPS`.
        /// </summary>
        [Input("protocol")]
        public Input<string>? Protocol { get; set; }

        [Input("routeConfigs")]
        private InputList<Inputs.CustomDomainRouteConfigGetArgs>? _routeConfigs;

        /// <summary>
        /// The configuration of domain route, mapping the path and Function Compute function.
        /// </summary>
        public InputList<Inputs.CustomDomainRouteConfigGetArgs> RouteConfigs
        {
            get => _routeConfigs ?? (_routeConfigs = new InputList<Inputs.CustomDomainRouteConfigGetArgs>());
            set => _routeConfigs = value;
        }

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