// *** 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.Ga
{
    /// <summary>
    /// Provides a Global Accelerator (GA) Accelerator Spare Ip Attachment resource.
    /// 
    /// For information about Global Accelerator (GA) Accelerator Spare Ip Attachment and how to use it, see [What is Accelerator Spare Ip Attachment](https://help.aliyun.com/document_detail/262120.html).
    /// 
    /// &gt; **NOTE:** Available in v1.167.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var defaultAccelerator = new AliCloud.Ga.Accelerator("defaultAccelerator", new()
    ///     {
    ///         Duration = 1,
    ///         Spec = "1",
    ///         AcceleratorName = @var.Name,
    ///         AutoUseCoupon = true,
    ///         Description = @var.Name,
    ///     });
    /// 
    ///     var defaultBandwidthPackage = new AliCloud.Ga.BandwidthPackage("defaultBandwidthPackage", new()
    ///     {
    ///         Bandwidth = 100,
    ///         Type = "Basic",
    ///         BandwidthType = "Basic",
    ///         PaymentType = "PayAsYouGo",
    ///         BillingType = "PayBy95",
    ///         Ratio = 30,
    ///         BandwidthPackageName = @var.Name,
    ///         AutoPay = true,
    ///         AutoUseCoupon = true,
    ///     });
    /// 
    ///     var defaultBandwidthPackageAttachment = new AliCloud.Ga.BandwidthPackageAttachment("defaultBandwidthPackageAttachment", new()
    ///     {
    ///         AcceleratorId = defaultAccelerator.Id,
    ///         BandwidthPackageId = defaultBandwidthPackage.Id,
    ///     });
    /// 
    ///     var defaultAcceleratorSpareIpAttachment = new AliCloud.Ga.AcceleratorSpareIpAttachment("defaultAcceleratorSpareIpAttachment", new()
    ///     {
    ///         AcceleratorId = defaultBandwidthPackageAttachment.AcceleratorId,
    ///         SpareIp = "127.0.0.1",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Global Accelerator (GA) Accelerator Spare Ip Attachment can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:ga/acceleratorSpareIpAttachment:AcceleratorSpareIpAttachment example &lt;accelerator_id&gt;:&lt;spare_ip&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:ga/acceleratorSpareIpAttachment:AcceleratorSpareIpAttachment")]
    public partial class AcceleratorSpareIpAttachment : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The ID of the global acceleration instance.
        /// </summary>
        [Output("acceleratorId")]
        public Output<string> AcceleratorId { get; private set; } = null!;

        /// <summary>
        /// The dry run.
        /// </summary>
        [Output("dryRun")]
        public Output<bool?> DryRun { get; private set; } = null!;

        /// <summary>
        /// The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
        /// </summary>
        [Output("spareIp")]
        public Output<string> SpareIp { get; private set; } = null!;

        /// <summary>
        /// The status of the standby CNAME IP address.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;


        /// <summary>
        /// Create a AcceleratorSpareIpAttachment 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 AcceleratorSpareIpAttachment(string name, AcceleratorSpareIpAttachmentArgs args, CustomResourceOptions? options = null)
            : base("alicloud:ga/acceleratorSpareIpAttachment:AcceleratorSpareIpAttachment", name, args ?? new AcceleratorSpareIpAttachmentArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class AcceleratorSpareIpAttachmentArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of the global acceleration instance.
        /// </summary>
        [Input("acceleratorId", required: true)]
        public Input<string> AcceleratorId { get; set; } = null!;

        /// <summary>
        /// The dry run.
        /// </summary>
        [Input("dryRun")]
        public Input<bool>? DryRun { get; set; }

        /// <summary>
        /// The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
        /// </summary>
        [Input("spareIp", required: true)]
        public Input<string> SpareIp { get; set; } = null!;

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

    public sealed class AcceleratorSpareIpAttachmentState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of the global acceleration instance.
        /// </summary>
        [Input("acceleratorId")]
        public Input<string>? AcceleratorId { get; set; }

        /// <summary>
        /// The dry run.
        /// </summary>
        [Input("dryRun")]
        public Input<bool>? DryRun { get; set; }

        /// <summary>
        /// The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
        /// </summary>
        [Input("spareIp")]
        public Input<string>? SpareIp { get; set; }

        /// <summary>
        /// The status of the standby CNAME IP address.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

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