<filename>sdk/dotnet/FC/FunctionAsyncInvokeConfig.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>
    /// Manages an asynchronous invocation configuration for a FC Function or Alias.\
    ///  For the detailed information, please refer to the [developer guide](https://www.alibabacloud.com/help/doc-detail/181866.htm).
    /// 
    /// &gt; **NOTE:** Available in 1.100.0+
    /// 
    /// ## Example Usage
    /// ### Destination Configuration
    /// 
    /// &gt; **NOTE** Ensure the FC Function RAM Role has necessary permissions for the destination, such as `mns:SendMessage`, `mns:PublishMessage` or `fc:InvokeFunction`, otherwise the API will return a generic error.
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new AliCloud.FC.FunctionAsyncInvokeConfig("example", new()
    ///     {
    ///         ServiceName = alicloud_fc_service.Example.Name,
    ///         FunctionName = alicloud_fc_function.Example.Name,
    ///         DestinationConfig = new AliCloud.FC.Inputs.FunctionAsyncInvokeConfigDestinationConfigArgs
    ///         {
    ///             OnFailure = new AliCloud.FC.Inputs.FunctionAsyncInvokeConfigDestinationConfigOnFailureArgs
    ///             {
    ///                 Destination = the_example_mns_queue_arn,
    ///             },
    ///             OnSuccess = new AliCloud.FC.Inputs.FunctionAsyncInvokeConfigDestinationConfigOnSuccessArgs
    ///             {
    ///                 Destination = the_example_mns_topic_arn,
    ///             },
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// ### Error Handling Configuration
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new AliCloud.FC.FunctionAsyncInvokeConfig("example", new()
    ///     {
    ///         ServiceName = alicloud_fc_service.Example.Name,
    ///         FunctionName = alicloud_fc_function.Example.Name,
    ///         MaximumEventAgeInSeconds = 60,
    ///         MaximumRetryAttempts = 0,
    ///     });
    /// 
    /// });
    /// ```
    /// ### Async Job Configuration
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new AliCloud.FC.FunctionAsyncInvokeConfig("example", new()
    ///     {
    ///         ServiceName = alicloud_fc_service.Example.Name,
    ///         FunctionName = alicloud_fc_function.Example.Name,
    ///         StatefulInvocation = true,
    ///     });
    /// 
    /// });
    /// ```
    /// ### Configuration for Function Latest Unpublished Version
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new AliCloud.FC.FunctionAsyncInvokeConfig("example", new()
    ///     {
    ///         ServiceName = alicloud_fc_service.Example.Name,
    ///         FunctionName = alicloud_fc_function.Example.Name,
    ///         Qualifier = "LATEST",
    ///     });
    /// 
    ///     // ... other configuration ...
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Function Compute Function Async Invoke Configs can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:fc/functionAsyncInvokeConfig:FunctionAsyncInvokeConfig example my_function
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:fc/functionAsyncInvokeConfig:FunctionAsyncInvokeConfig")]
    public partial class FunctionAsyncInvokeConfig : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The date this resource was created.
        /// </summary>
        [Output("createdTime")]
        public Output<string> CreatedTime { get; private set; } = null!;

        /// <summary>
        /// Configuration block with destination configuration. See below for details.
        /// </summary>
        [Output("destinationConfig")]
        public Output<Outputs.FunctionAsyncInvokeConfigDestinationConfig?> DestinationConfig { get; private set; } = null!;

        /// <summary>
        /// Name of the Function Compute Function.
        /// </summary>
        [Output("functionName")]
        public Output<string> FunctionName { get; private set; } = null!;

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

        /// <summary>
        /// Maximum age of a request that Function Compute sends to a function for processing in seconds. Valid values between 1 and 2592000 (between 60 and 21600 before v1.167.0).
        /// </summary>
        [Output("maximumEventAgeInSeconds")]
        public Output<int?> MaximumEventAgeInSeconds { get; private set; } = null!;

        /// <summary>
        /// Maximum number of times to retry when the function returns an error. Valid values between 0 and 8 (between 0 and 2 before v1.167.0). Defaults to 2.
        /// </summary>
        [Output("maximumRetryAttempts")]
        public Output<int?> MaximumRetryAttempts { get; private set; } = null!;

        /// <summary>
        /// Function Compute Function published version, `LATEST`, or Function Compute Alias name. The default value is `LATEST`.
        /// </summary>
        [Output("qualifier")]
        public Output<string?> Qualifier { get; private set; } = null!;

        /// <summary>
        /// Name of the Function Compute Function, omitting any version or alias qualifier.
        /// </summary>
        [Output("serviceName")]
        public Output<string> ServiceName { get; private set; } = null!;

        /// <summary>
        /// Function Compute async job configuration(also known as Task Mode). valid values true or false, default `false`
        /// </summary>
        [Output("statefulInvocation")]
        public Output<bool?> StatefulInvocation { get; private set; } = null!;


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

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

    public sealed class FunctionAsyncInvokeConfigArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Configuration block with destination configuration. See below for details.
        /// </summary>
        [Input("destinationConfig")]
        public Input<Inputs.FunctionAsyncInvokeConfigDestinationConfigArgs>? DestinationConfig { get; set; }

        /// <summary>
        /// Name of the Function Compute Function.
        /// </summary>
        [Input("functionName", required: true)]
        public Input<string> FunctionName { get; set; } = null!;

        /// <summary>
        /// Maximum age of a request that Function Compute sends to a function for processing in seconds. Valid values between 1 and 2592000 (between 60 and 21600 before v1.167.0).
        /// </summary>
        [Input("maximumEventAgeInSeconds")]
        public Input<int>? MaximumEventAgeInSeconds { get; set; }

        /// <summary>
        /// Maximum number of times to retry when the function returns an error. Valid values between 0 and 8 (between 0 and 2 before v1.167.0). Defaults to 2.
        /// </summary>
        [Input("maximumRetryAttempts")]
        public Input<int>? MaximumRetryAttempts { get; set; }

        /// <summary>
        /// Function Compute Function published version, `LATEST`, or Function Compute Alias name. The default value is `LATEST`.
        /// </summary>
        [Input("qualifier")]
        public Input<string>? Qualifier { get; set; }

        /// <summary>
        /// Name of the Function Compute Function, omitting any version or alias qualifier.
        /// </summary>
        [Input("serviceName", required: true)]
        public Input<string> ServiceName { get; set; } = null!;

        /// <summary>
        /// Function Compute async job configuration(also known as Task Mode). valid values true or false, default `false`
        /// </summary>
        [Input("statefulInvocation")]
        public Input<bool>? StatefulInvocation { get; set; }

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

    public sealed class FunctionAsyncInvokeConfigState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The date this resource was created.
        /// </summary>
        [Input("createdTime")]
        public Input<string>? CreatedTime { get; set; }

        /// <summary>
        /// Configuration block with destination configuration. See below for details.
        /// </summary>
        [Input("destinationConfig")]
        public Input<Inputs.FunctionAsyncInvokeConfigDestinationConfigGetArgs>? DestinationConfig { get; set; }

        /// <summary>
        /// Name of the Function Compute Function.
        /// </summary>
        [Input("functionName")]
        public Input<string>? FunctionName { get; set; }

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

        /// <summary>
        /// Maximum age of a request that Function Compute sends to a function for processing in seconds. Valid values between 1 and 2592000 (between 60 and 21600 before v1.167.0).
        /// </summary>
        [Input("maximumEventAgeInSeconds")]
        public Input<int>? MaximumEventAgeInSeconds { get; set; }

        /// <summary>
        /// Maximum number of times to retry when the function returns an error. Valid values between 0 and 8 (between 0 and 2 before v1.167.0). Defaults to 2.
        /// </summary>
        [Input("maximumRetryAttempts")]
        public Input<int>? MaximumRetryAttempts { get; set; }

        /// <summary>
        /// Function Compute Function published version, `LATEST`, or Function Compute Alias name. The default value is `LATEST`.
        /// </summary>
        [Input("qualifier")]
        public Input<string>? Qualifier { get; set; }

        /// <summary>
        /// Name of the Function Compute Function, omitting any version or alias qualifier.
        /// </summary>
        [Input("serviceName")]
        public Input<string>? ServiceName { get; set; }

        /// <summary>
        /// Function Compute async job configuration(also known as Task Mode). valid values true or false, default `false`
        /// </summary>
        [Input("statefulInvocation")]
        public Input<bool>? StatefulInvocation { get; set; }

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