1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ga
  5. AcceleratorSpareIpAttachment
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.ga.AcceleratorSpareIpAttachment

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    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.

    NOTE: Available since v1.167.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = new alicloud.ga.Accelerator("default", {
        duration: 1,
        spec: "1",
        acceleratorName: "terraform-example",
        autoUseCoupon: true,
        description: "terraform-example",
    });
    const defaultBandwidthPackage = new alicloud.ga.BandwidthPackage("default", {
        bandwidth: 100,
        type: "Basic",
        bandwidthType: "Basic",
        paymentType: "PayAsYouGo",
        billingType: "PayBy95",
        ratio: 30,
        bandwidthPackageName: "terraform-example",
        autoPay: true,
        autoUseCoupon: true,
    });
    const defaultBandwidthPackageAttachment = new alicloud.ga.BandwidthPackageAttachment("default", {
        acceleratorId: _default.id,
        bandwidthPackageId: defaultBandwidthPackage.id,
    });
    const defaultAcceleratorSpareIpAttachment = new alicloud.ga.AcceleratorSpareIpAttachment("default", {
        acceleratorId: defaultBandwidthPackageAttachment.acceleratorId,
        spareIp: "127.0.0.1",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.ga.Accelerator("default",
        duration=1,
        spec="1",
        accelerator_name="terraform-example",
        auto_use_coupon=True,
        description="terraform-example")
    default_bandwidth_package = alicloud.ga.BandwidthPackage("default",
        bandwidth=100,
        type="Basic",
        bandwidth_type="Basic",
        payment_type="PayAsYouGo",
        billing_type="PayBy95",
        ratio=30,
        bandwidth_package_name="terraform-example",
        auto_pay=True,
        auto_use_coupon=True)
    default_bandwidth_package_attachment = alicloud.ga.BandwidthPackageAttachment("default",
        accelerator_id=default.id,
        bandwidth_package_id=default_bandwidth_package.id)
    default_accelerator_spare_ip_attachment = alicloud.ga.AcceleratorSpareIpAttachment("default",
        accelerator_id=default_bandwidth_package_attachment.accelerator_id,
        spare_ip="127.0.0.1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ga"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ga.NewAccelerator(ctx, "default", &ga.AcceleratorArgs{
    			Duration:        pulumi.Int(1),
    			Spec:            pulumi.String("1"),
    			AcceleratorName: pulumi.String("terraform-example"),
    			AutoUseCoupon:   pulumi.Bool(true),
    			Description:     pulumi.String("terraform-example"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultBandwidthPackage, err := ga.NewBandwidthPackage(ctx, "default", &ga.BandwidthPackageArgs{
    			Bandwidth:            pulumi.Int(100),
    			Type:                 pulumi.String("Basic"),
    			BandwidthType:        pulumi.String("Basic"),
    			PaymentType:          pulumi.String("PayAsYouGo"),
    			BillingType:          pulumi.String("PayBy95"),
    			Ratio:                pulumi.Int(30),
    			BandwidthPackageName: pulumi.String("terraform-example"),
    			AutoPay:              pulumi.Bool(true),
    			AutoUseCoupon:        pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		defaultBandwidthPackageAttachment, err := ga.NewBandwidthPackageAttachment(ctx, "default", &ga.BandwidthPackageAttachmentArgs{
    			AcceleratorId:      _default.ID(),
    			BandwidthPackageId: defaultBandwidthPackage.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ga.NewAcceleratorSpareIpAttachment(ctx, "default", &ga.AcceleratorSpareIpAttachmentArgs{
    			AcceleratorId: defaultBandwidthPackageAttachment.AcceleratorId,
    			SpareIp:       pulumi.String("127.0.0.1"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new AliCloud.Ga.Accelerator("default", new()
        {
            Duration = 1,
            Spec = "1",
            AcceleratorName = "terraform-example",
            AutoUseCoupon = true,
            Description = "terraform-example",
        });
    
        var defaultBandwidthPackage = new AliCloud.Ga.BandwidthPackage("default", new()
        {
            Bandwidth = 100,
            Type = "Basic",
            BandwidthType = "Basic",
            PaymentType = "PayAsYouGo",
            BillingType = "PayBy95",
            Ratio = 30,
            BandwidthPackageName = "terraform-example",
            AutoPay = true,
            AutoUseCoupon = true,
        });
    
        var defaultBandwidthPackageAttachment = new AliCloud.Ga.BandwidthPackageAttachment("default", new()
        {
            AcceleratorId = @default.Id,
            BandwidthPackageId = defaultBandwidthPackage.Id,
        });
    
        var defaultAcceleratorSpareIpAttachment = new AliCloud.Ga.AcceleratorSpareIpAttachment("default", new()
        {
            AcceleratorId = defaultBandwidthPackageAttachment.AcceleratorId,
            SpareIp = "127.0.0.1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ga.Accelerator;
    import com.pulumi.alicloud.ga.AcceleratorArgs;
    import com.pulumi.alicloud.ga.BandwidthPackage;
    import com.pulumi.alicloud.ga.BandwidthPackageArgs;
    import com.pulumi.alicloud.ga.BandwidthPackageAttachment;
    import com.pulumi.alicloud.ga.BandwidthPackageAttachmentArgs;
    import com.pulumi.alicloud.ga.AcceleratorSpareIpAttachment;
    import com.pulumi.alicloud.ga.AcceleratorSpareIpAttachmentArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var default_ = new Accelerator("default", AcceleratorArgs.builder()
                .duration(1)
                .spec("1")
                .acceleratorName("terraform-example")
                .autoUseCoupon(true)
                .description("terraform-example")
                .build());
    
            var defaultBandwidthPackage = new BandwidthPackage("defaultBandwidthPackage", BandwidthPackageArgs.builder()
                .bandwidth(100)
                .type("Basic")
                .bandwidthType("Basic")
                .paymentType("PayAsYouGo")
                .billingType("PayBy95")
                .ratio(30)
                .bandwidthPackageName("terraform-example")
                .autoPay(true)
                .autoUseCoupon(true)
                .build());
    
            var defaultBandwidthPackageAttachment = new BandwidthPackageAttachment("defaultBandwidthPackageAttachment", BandwidthPackageAttachmentArgs.builder()
                .acceleratorId(default_.id())
                .bandwidthPackageId(defaultBandwidthPackage.id())
                .build());
    
            var defaultAcceleratorSpareIpAttachment = new AcceleratorSpareIpAttachment("defaultAcceleratorSpareIpAttachment", AcceleratorSpareIpAttachmentArgs.builder()
                .acceleratorId(defaultBandwidthPackageAttachment.acceleratorId())
                .spareIp("127.0.0.1")
                .build());
    
        }
    }
    
    resources:
      default:
        type: alicloud:ga:Accelerator
        properties:
          duration: 1
          spec: '1'
          acceleratorName: terraform-example
          autoUseCoupon: true
          description: terraform-example
      defaultBandwidthPackage:
        type: alicloud:ga:BandwidthPackage
        name: default
        properties:
          bandwidth: 100
          type: Basic
          bandwidthType: Basic
          paymentType: PayAsYouGo
          billingType: PayBy95
          ratio: 30
          bandwidthPackageName: terraform-example
          autoPay: true
          autoUseCoupon: true
      defaultBandwidthPackageAttachment:
        type: alicloud:ga:BandwidthPackageAttachment
        name: default
        properties:
          acceleratorId: ${default.id}
          bandwidthPackageId: ${defaultBandwidthPackage.id}
      defaultAcceleratorSpareIpAttachment:
        type: alicloud:ga:AcceleratorSpareIpAttachment
        name: default
        properties:
          acceleratorId: ${defaultBandwidthPackageAttachment.acceleratorId}
          spareIp: 127.0.0.1
    

    Create AcceleratorSpareIpAttachment Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AcceleratorSpareIpAttachment(name: string, args: AcceleratorSpareIpAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def AcceleratorSpareIpAttachment(resource_name: str,
                                     args: AcceleratorSpareIpAttachmentArgs,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def AcceleratorSpareIpAttachment(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     accelerator_id: Optional[str] = None,
                                     spare_ip: Optional[str] = None,
                                     dry_run: Optional[bool] = None)
    func NewAcceleratorSpareIpAttachment(ctx *Context, name string, args AcceleratorSpareIpAttachmentArgs, opts ...ResourceOption) (*AcceleratorSpareIpAttachment, error)
    public AcceleratorSpareIpAttachment(string name, AcceleratorSpareIpAttachmentArgs args, CustomResourceOptions? opts = null)
    public AcceleratorSpareIpAttachment(String name, AcceleratorSpareIpAttachmentArgs args)
    public AcceleratorSpareIpAttachment(String name, AcceleratorSpareIpAttachmentArgs args, CustomResourceOptions options)
    
    type: alicloud:ga:AcceleratorSpareIpAttachment
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AcceleratorSpareIpAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AcceleratorSpareIpAttachmentArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AcceleratorSpareIpAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AcceleratorSpareIpAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AcceleratorSpareIpAttachmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var acceleratorSpareIpAttachmentResource = new AliCloud.Ga.AcceleratorSpareIpAttachment("acceleratorSpareIpAttachmentResource", new()
    {
        AcceleratorId = "string",
        SpareIp = "string",
        DryRun = false,
    });
    
    example, err := ga.NewAcceleratorSpareIpAttachment(ctx, "acceleratorSpareIpAttachmentResource", &ga.AcceleratorSpareIpAttachmentArgs{
    	AcceleratorId: pulumi.String("string"),
    	SpareIp:       pulumi.String("string"),
    	DryRun:        pulumi.Bool(false),
    })
    
    var acceleratorSpareIpAttachmentResource = new AcceleratorSpareIpAttachment("acceleratorSpareIpAttachmentResource", AcceleratorSpareIpAttachmentArgs.builder()
        .acceleratorId("string")
        .spareIp("string")
        .dryRun(false)
        .build());
    
    accelerator_spare_ip_attachment_resource = alicloud.ga.AcceleratorSpareIpAttachment("acceleratorSpareIpAttachmentResource",
        accelerator_id="string",
        spare_ip="string",
        dry_run=False)
    
    const acceleratorSpareIpAttachmentResource = new alicloud.ga.AcceleratorSpareIpAttachment("acceleratorSpareIpAttachmentResource", {
        acceleratorId: "string",
        spareIp: "string",
        dryRun: false,
    });
    
    type: alicloud:ga:AcceleratorSpareIpAttachment
    properties:
        acceleratorId: string
        dryRun: false
        spareIp: string
    

    AcceleratorSpareIpAttachment Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The AcceleratorSpareIpAttachment resource accepts the following input properties:

    AcceleratorId string
    The ID of the global acceleration instance.
    SpareIp string
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    DryRun bool
    The dry run.
    AcceleratorId string
    The ID of the global acceleration instance.
    SpareIp string
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    DryRun bool
    The dry run.
    acceleratorId String
    The ID of the global acceleration instance.
    spareIp String
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    dryRun Boolean
    The dry run.
    acceleratorId string
    The ID of the global acceleration instance.
    spareIp string
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    dryRun boolean
    The dry run.
    accelerator_id str
    The ID of the global acceleration instance.
    spare_ip str
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    dry_run bool
    The dry run.
    acceleratorId String
    The ID of the global acceleration instance.
    spareIp String
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    dryRun Boolean
    The dry run.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AcceleratorSpareIpAttachment resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the standby CNAME IP address.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the standby CNAME IP address.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the standby CNAME IP address.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the standby CNAME IP address.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the standby CNAME IP address.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the standby CNAME IP address.

    Look up Existing AcceleratorSpareIpAttachment Resource

    Get an existing AcceleratorSpareIpAttachment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: AcceleratorSpareIpAttachmentState, opts?: CustomResourceOptions): AcceleratorSpareIpAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            accelerator_id: Optional[str] = None,
            dry_run: Optional[bool] = None,
            spare_ip: Optional[str] = None,
            status: Optional[str] = None) -> AcceleratorSpareIpAttachment
    func GetAcceleratorSpareIpAttachment(ctx *Context, name string, id IDInput, state *AcceleratorSpareIpAttachmentState, opts ...ResourceOption) (*AcceleratorSpareIpAttachment, error)
    public static AcceleratorSpareIpAttachment Get(string name, Input<string> id, AcceleratorSpareIpAttachmentState? state, CustomResourceOptions? opts = null)
    public static AcceleratorSpareIpAttachment get(String name, Output<String> id, AcceleratorSpareIpAttachmentState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AcceleratorId string
    The ID of the global acceleration instance.
    DryRun bool
    The dry run.
    SpareIp string
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    Status string
    The status of the standby CNAME IP address.
    AcceleratorId string
    The ID of the global acceleration instance.
    DryRun bool
    The dry run.
    SpareIp string
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    Status string
    The status of the standby CNAME IP address.
    acceleratorId String
    The ID of the global acceleration instance.
    dryRun Boolean
    The dry run.
    spareIp String
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    status String
    The status of the standby CNAME IP address.
    acceleratorId string
    The ID of the global acceleration instance.
    dryRun boolean
    The dry run.
    spareIp string
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    status string
    The status of the standby CNAME IP address.
    accelerator_id str
    The ID of the global acceleration instance.
    dry_run bool
    The dry run.
    spare_ip str
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    status str
    The status of the standby CNAME IP address.
    acceleratorId String
    The ID of the global acceleration instance.
    dryRun Boolean
    The dry run.
    spareIp String
    The standby IP address of CNAME. When the acceleration area is abnormal, the traffic is switched to the standby IP address.
    status String
    The status of the standby CNAME IP address.

    Import

    Global Accelerator (GA) Accelerator Spare Ip Attachment can be imported using the id, e.g.

    $ pulumi import alicloud:ga/acceleratorSpareIpAttachment:AcceleratorSpareIpAttachment example <accelerator_id>:<spare_ip>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi