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

alicloud.ddos.getDdosBgpInstances

Explore with Pulumi AI

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

    This data source provides a list of Anti-DDoS Advanced instances in an Alibaba Cloud account according to the specified filters.

    NOTE: Available in v1.183.0+ .

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    export = async () => {
        const config = new pulumi.Config();
        const name = config.get("name") || "tf-example";
        const instanceDdosBgpInstance = new alicloud.ddos.DdosBgpInstance("instance", {
            name: name,
            baseBandwidth: 20,
            bandwidth: -1,
            ipCount: 100,
            ipType: "IPv4",
            normalBandwidth: 100,
            type: "Enterprise",
        });
        const instance = await alicloud.ddos.getDdosBgpInstances({
            nameRegex: "ddosbgp",
        });
        return {
            instance: [instance].map(__item => __item.id),
        };
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    instance_ddos_bgp_instance = alicloud.ddos.DdosBgpInstance("instance",
        name=name,
        base_bandwidth=20,
        bandwidth=-1,
        ip_count=100,
        ip_type="IPv4",
        normal_bandwidth=100,
        type="Enterprise")
    instance = alicloud.ddos.get_ddos_bgp_instances(name_regex="ddosbgp")
    pulumi.export("instance", [__item.id for __item in [instance]])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ddos"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    cfg := config.New(ctx, "")
    name := "tf-example";
    if param := cfg.Get("name"); param != ""{
    name = param
    }
    _, err := ddos.NewDdosBgpInstance(ctx, "instance", &ddos.DdosBgpInstanceArgs{
    Name: pulumi.String(name),
    BaseBandwidth: pulumi.Int(20),
    Bandwidth: pulumi.Int(-1),
    IpCount: pulumi.Int(100),
    IpType: pulumi.String("IPv4"),
    NormalBandwidth: pulumi.Int(100),
    Type: pulumi.String("Enterprise"),
    })
    if err != nil {
    return err
    }
    instance, err := ddos.GetDdosBgpInstances(ctx, &ddos.GetDdosBgpInstancesArgs{
    NameRegex: pulumi.StringRef("ddosbgp"),
    }, nil);
    if err != nil {
    return err
    }
    ctx.Export("instance", pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:21,11-25)))
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var instanceDdosBgpInstance = new AliCloud.Ddos.DdosBgpInstance("instance", new()
        {
            Name = name,
            BaseBandwidth = 20,
            Bandwidth = -1,
            IpCount = 100,
            IpType = "IPv4",
            NormalBandwidth = 100,
            Type = "Enterprise",
        });
    
        var instance = AliCloud.Ddos.GetDdosBgpInstances.Invoke(new()
        {
            NameRegex = "ddosbgp",
        });
    
        return new Dictionary<string, object?>
        {
            ["instance"] = new[]
            {
                instance,
            }.Select(__item => __item.Id).ToList(),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ddos.DdosBgpInstance;
    import com.pulumi.alicloud.ddos.DdosBgpInstanceArgs;
    import com.pulumi.alicloud.ddos.DdosFunctions;
    import com.pulumi.alicloud.ddos.inputs.GetDdosBgpInstancesArgs;
    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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("tf-example");
            var instanceDdosBgpInstance = new DdosBgpInstance("instanceDdosBgpInstance", DdosBgpInstanceArgs.builder()
                .name(name)
                .baseBandwidth(20)
                .bandwidth(-1)
                .ipCount(100)
                .ipType("IPv4")
                .normalBandwidth(100)
                .type("Enterprise")
                .build());
    
            final var instance = DdosFunctions.getDdosBgpInstances(GetDdosBgpInstancesArgs.builder()
                .nameRegex("ddosbgp")
                .build());
    
            ctx.export("instance", instance.applyValue(getDdosBgpInstancesResult -> getDdosBgpInstancesResult).stream().map(element -> element.id()).collect(toList()));
        }
    }
    
    Coming soon!
    

    Using getDdosBgpInstances

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDdosBgpInstances(args: GetDdosBgpInstancesArgs, opts?: InvokeOptions): Promise<GetDdosBgpInstancesResult>
    function getDdosBgpInstancesOutput(args: GetDdosBgpInstancesOutputArgs, opts?: InvokeOptions): Output<GetDdosBgpInstancesResult>
    def get_ddos_bgp_instances(ids: Optional[Sequence[str]] = None,
                               name_regex: Optional[str] = None,
                               output_file: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetDdosBgpInstancesResult
    def get_ddos_bgp_instances_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                               name_regex: Optional[pulumi.Input[str]] = None,
                               output_file: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetDdosBgpInstancesResult]
    func GetDdosBgpInstances(ctx *Context, args *GetDdosBgpInstancesArgs, opts ...InvokeOption) (*GetDdosBgpInstancesResult, error)
    func GetDdosBgpInstancesOutput(ctx *Context, args *GetDdosBgpInstancesOutputArgs, opts ...InvokeOption) GetDdosBgpInstancesResultOutput

    > Note: This function is named GetDdosBgpInstances in the Go SDK.

    public static class GetDdosBgpInstances 
    {
        public static Task<GetDdosBgpInstancesResult> InvokeAsync(GetDdosBgpInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetDdosBgpInstancesResult> Invoke(GetDdosBgpInstancesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDdosBgpInstancesResult> getDdosBgpInstances(GetDdosBgpInstancesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ddos/getDdosBgpInstances:getDdosBgpInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of instance IDs.
    NameRegex string
    A regex string to filter results by the instance name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of instance IDs.
    NameRegex string
    A regex string to filter results by the instance name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of instance IDs.
    nameRegex String
    A regex string to filter results by the instance name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of instance IDs.
    nameRegex string
    A regex string to filter results by the instance name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of instance IDs.
    name_regex str
    A regex string to filter results by the instance name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of instance IDs.
    nameRegex String
    A regex string to filter results by the instance name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getDdosBgpInstances Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of instance IDs.
    Instances List<Pulumi.AliCloud.Ddos.Outputs.GetDdosBgpInstancesInstance>
    A list of apis. Each element contains the following attributes:
    Names List<string>
    A list of instance names.
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of instance IDs.
    Instances []GetDdosBgpInstancesInstance
    A list of apis. Each element contains the following attributes:
    Names []string
    A list of instance names.
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of instance IDs.
    instances List<GetDdosBgpInstancesInstance>
    A list of apis. Each element contains the following attributes:
    names List<String>
    A list of instance names.
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of instance IDs.
    instances GetDdosBgpInstancesInstance[]
    A list of apis. Each element contains the following attributes:
    names string[]
    A list of instance names.
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of instance IDs.
    instances Sequence[GetDdosBgpInstancesInstance]
    A list of apis. Each element contains the following attributes:
    names Sequence[str]
    A list of instance names.
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of instance IDs.
    instances List<Property Map>
    A list of apis. Each element contains the following attributes:
    names List<String>
    A list of instance names.
    nameRegex String
    outputFile String

    Supporting Types

    GetDdosBgpInstancesInstance

    Bandwidth int
    The instance's elastic defend bandwidth.
    BaseBandwidth int
    The instance's base defend bandwidth.
    Id string
    The instance's id.
    IpCount int
    The instance's count of ip config.
    IpType string
    The instance's IP version.
    Name string
    The instance's remark.
    NormalBandwidth int
    Normal defend bandwidth of the instance. The unit is Gbps.
    Region string
    The instance's region.
    Type string
    The instance's type.
    Bandwidth int
    The instance's elastic defend bandwidth.
    BaseBandwidth int
    The instance's base defend bandwidth.
    Id string
    The instance's id.
    IpCount int
    The instance's count of ip config.
    IpType string
    The instance's IP version.
    Name string
    The instance's remark.
    NormalBandwidth int
    Normal defend bandwidth of the instance. The unit is Gbps.
    Region string
    The instance's region.
    Type string
    The instance's type.
    bandwidth Integer
    The instance's elastic defend bandwidth.
    baseBandwidth Integer
    The instance's base defend bandwidth.
    id String
    The instance's id.
    ipCount Integer
    The instance's count of ip config.
    ipType String
    The instance's IP version.
    name String
    The instance's remark.
    normalBandwidth Integer
    Normal defend bandwidth of the instance. The unit is Gbps.
    region String
    The instance's region.
    type String
    The instance's type.
    bandwidth number
    The instance's elastic defend bandwidth.
    baseBandwidth number
    The instance's base defend bandwidth.
    id string
    The instance's id.
    ipCount number
    The instance's count of ip config.
    ipType string
    The instance's IP version.
    name string
    The instance's remark.
    normalBandwidth number
    Normal defend bandwidth of the instance. The unit is Gbps.
    region string
    The instance's region.
    type string
    The instance's type.
    bandwidth int
    The instance's elastic defend bandwidth.
    base_bandwidth int
    The instance's base defend bandwidth.
    id str
    The instance's id.
    ip_count int
    The instance's count of ip config.
    ip_type str
    The instance's IP version.
    name str
    The instance's remark.
    normal_bandwidth int
    Normal defend bandwidth of the instance. The unit is Gbps.
    region str
    The instance's region.
    type str
    The instance's type.
    bandwidth Number
    The instance's elastic defend bandwidth.
    baseBandwidth Number
    The instance's base defend bandwidth.
    id String
    The instance's id.
    ipCount Number
    The instance's count of ip config.
    ipType String
    The instance's IP version.
    name String
    The instance's remark.
    normalBandwidth Number
    Normal defend bandwidth of the instance. The unit is Gbps.
    region String
    The instance's region.
    type String
    The instance's type.

    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