// *** 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>
    /// Creates a Function Compute service alias. Creates an alias that points to the specified Function Compute service version.
    ///  For the detailed information, please refer to the [developer guide](https://www.alibabacloud.com/help/doc-detail/171635.htm).
    /// 
    /// &gt; **NOTE:** Available in 1.104.0+
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new AliCloud.FC.Alias("example", new()
    ///     {
    ///         AliasName = "my_alias",
    ///         Description = "a sample description",
    ///         RoutingConfig = new AliCloud.FC.Inputs.AliasRoutingConfigArgs
    ///         {
    ///             AdditionalVersionWeights = 
    ///             {
    ///                 { "2", 0.5 },
    ///             },
    ///         },
    ///         ServiceName = "my_service_name",
    ///         ServiceVersion = "1",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Function Compute alias can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:fc/alias:Alias example my_alias_id
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:fc/alias:Alias")]
    public partial class Alias : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Name for the alias you are creating.
        /// </summary>
        [Output("aliasName")]
        public Output<string> AliasName { get; private set; } = null!;

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

        /// <summary>
        /// The Function Compute alias' route configuration settings. Fields documented below.
        /// </summary>
        [Output("routingConfig")]
        public Output<Outputs.AliasRoutingConfig?> RoutingConfig { get; private set; } = null!;

        /// <summary>
        /// The Function Compute service name.
        /// </summary>
        [Output("serviceName")]
        public Output<string> ServiceName { get; private set; } = null!;

        /// <summary>
        /// The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
        /// </summary>
        [Output("serviceVersion")]
        public Output<string> ServiceVersion { get; private set; } = null!;


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

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

    public sealed class AliasArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Name for the alias you are creating.
        /// </summary>
        [Input("aliasName", required: true)]
        public Input<string> AliasName { get; set; } = null!;

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

        /// <summary>
        /// The Function Compute alias' route configuration settings. Fields documented below.
        /// </summary>
        [Input("routingConfig")]
        public Input<Inputs.AliasRoutingConfigArgs>? RoutingConfig { get; set; }

        /// <summary>
        /// The Function Compute service name.
        /// </summary>
        [Input("serviceName", required: true)]
        public Input<string> ServiceName { get; set; } = null!;

        /// <summary>
        /// The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
        /// </summary>
        [Input("serviceVersion", required: true)]
        public Input<string> ServiceVersion { get; set; } = null!;

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

    public sealed class AliasState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Name for the alias you are creating.
        /// </summary>
        [Input("aliasName")]
        public Input<string>? AliasName { get; set; }

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

        /// <summary>
        /// The Function Compute alias' route configuration settings. Fields documented below.
        /// </summary>
        [Input("routingConfig")]
        public Input<Inputs.AliasRoutingConfigGetArgs>? RoutingConfig { get; set; }

        /// <summary>
        /// The Function Compute service name.
        /// </summary>
        [Input("serviceName")]
        public Input<string>? ServiceName { get; set; }

        /// <summary>
        /// The Function Compute service version for which you are creating the alias. Pattern: (LATEST|[0-9]+).
        /// </summary>
        [Input("serviceVersion")]
        public Input<string>? ServiceVersion { get; set; }

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