1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ddos
  5. getDdosCooPorts
Alibaba Cloud v3.68.0 published on Monday, Dec 2, 2024 by Pulumi

alicloud.ddos.getDdosCooPorts

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.68.0 published on Monday, Dec 2, 2024 by Pulumi

    This data source provides the Ddoscoo Ports of the current Alibaba Cloud user.

    NOTE: Available in v1.123.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.ddos.getDdosCooPorts({
        instanceId: "ddoscoo-cn-6ja1rl4j****",
        ids: ["ddoscoo-cn-6ja1rl4j****:7001:tcp"],
    });
    export const firstDdoscooPortId = example.then(example => example.ports?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.ddos.get_ddos_coo_ports(instance_id="ddoscoo-cn-6ja1rl4j****",
        ids=["ddoscoo-cn-6ja1rl4j****:7001:tcp"])
    pulumi.export("firstDdoscooPortId", example.ports[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ddos"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ddos.GetDdosCooPorts(ctx, &ddos.GetDdosCooPortsArgs{
    			InstanceId: "ddoscoo-cn-6ja1rl4j****",
    			Ids: []string{
    				"ddoscoo-cn-6ja1rl4j****:7001:tcp",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstDdoscooPortId", example.Ports[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.Ddos.GetDdosCooPorts.Invoke(new()
        {
            InstanceId = "ddoscoo-cn-6ja1rl4j****",
            Ids = new[]
            {
                "ddoscoo-cn-6ja1rl4j****:7001:tcp",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["firstDdoscooPortId"] = example.Apply(getDdosCooPortsResult => getDdosCooPortsResult.Ports[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ddos.DdosFunctions;
    import com.pulumi.alicloud.ddos.inputs.GetDdosCooPortsArgs;
    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 example = DdosFunctions.getDdosCooPorts(GetDdosCooPortsArgs.builder()
                .instanceId("ddoscoo-cn-6ja1rl4j****")
                .ids("ddoscoo-cn-6ja1rl4j****:7001:tcp")
                .build());
    
            ctx.export("firstDdoscooPortId", example.applyValue(getDdosCooPortsResult -> getDdosCooPortsResult.ports()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:ddos:getDdosCooPorts
          Arguments:
            instanceId: ddoscoo-cn-6ja1rl4j****
            ids:
              - ddoscoo-cn-6ja1rl4j****:7001:tcp
    outputs:
      firstDdoscooPortId: ${example.ports[0].id}
    

    Using getDdosCooPorts

    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 getDdosCooPorts(args: GetDdosCooPortsArgs, opts?: InvokeOptions): Promise<GetDdosCooPortsResult>
    function getDdosCooPortsOutput(args: GetDdosCooPortsOutputArgs, opts?: InvokeOptions): Output<GetDdosCooPortsResult>
    def get_ddos_coo_ports(frontend_port: Optional[str] = None,
                           frontend_protocol: Optional[str] = None,
                           ids: Optional[Sequence[str]] = None,
                           instance_id: Optional[str] = None,
                           output_file: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetDdosCooPortsResult
    def get_ddos_coo_ports_output(frontend_port: Optional[pulumi.Input[str]] = None,
                           frontend_protocol: Optional[pulumi.Input[str]] = None,
                           ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                           instance_id: Optional[pulumi.Input[str]] = None,
                           output_file: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetDdosCooPortsResult]
    func GetDdosCooPorts(ctx *Context, args *GetDdosCooPortsArgs, opts ...InvokeOption) (*GetDdosCooPortsResult, error)
    func GetDdosCooPortsOutput(ctx *Context, args *GetDdosCooPortsOutputArgs, opts ...InvokeOption) GetDdosCooPortsResultOutput

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

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

    The following arguments are supported:

    InstanceId string
    The Ddoscoo instance ID.
    FrontendPort string
    The forwarding port.
    FrontendProtocol string
    The forwarding protocol. Valid values tcp and udp.
    Ids List<string>
    A list of Port IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    InstanceId string
    The Ddoscoo instance ID.
    FrontendPort string
    The forwarding port.
    FrontendProtocol string
    The forwarding protocol. Valid values tcp and udp.
    Ids []string
    A list of Port IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    instanceId String
    The Ddoscoo instance ID.
    frontendPort String
    The forwarding port.
    frontendProtocol String
    The forwarding protocol. Valid values tcp and udp.
    ids List<String>
    A list of Port IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    instanceId string
    The Ddoscoo instance ID.
    frontendPort string
    The forwarding port.
    frontendProtocol string
    The forwarding protocol. Valid values tcp and udp.
    ids string[]
    A list of Port IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    instance_id str
    The Ddoscoo instance ID.
    frontend_port str
    The forwarding port.
    frontend_protocol str
    The forwarding protocol. Valid values tcp and udp.
    ids Sequence[str]
    A list of Port IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    instanceId String
    The Ddoscoo instance ID.
    frontendPort String
    The forwarding port.
    frontendProtocol String
    The forwarding protocol. Valid values tcp and udp.
    ids List<String>
    A list of Port IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getDdosCooPorts Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    InstanceId string
    Ports List<Pulumi.AliCloud.Ddos.Outputs.GetDdosCooPortsPort>
    FrontendPort string
    FrontendProtocol string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    InstanceId string
    Ports []GetDdosCooPortsPort
    FrontendPort string
    FrontendProtocol string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    ports List<GetDdosCooPortsPort>
    frontendPort String
    frontendProtocol String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    instanceId string
    ports GetDdosCooPortsPort[]
    frontendPort string
    frontendProtocol string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    instance_id str
    ports Sequence[GetDdosCooPortsPort]
    frontend_port str
    frontend_protocol str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    ports List<Property Map>
    frontendPort String
    frontendProtocol String
    outputFile String

    Supporting Types

    GetDdosCooPortsPort

    BackendPort string
    The source station port.
    FrontendPort string
    The forwarding port.
    FrontendProtocol string
    The forwarding protocol. Valid values tcp and udp.
    Id string
    The ID of the Port.
    InstanceId string
    The Ddoscoo instance ID.
    RealServers List<string>
    List of source IP addresses.
    BackendPort string
    The source station port.
    FrontendPort string
    The forwarding port.
    FrontendProtocol string
    The forwarding protocol. Valid values tcp and udp.
    Id string
    The ID of the Port.
    InstanceId string
    The Ddoscoo instance ID.
    RealServers []string
    List of source IP addresses.
    backendPort String
    The source station port.
    frontendPort String
    The forwarding port.
    frontendProtocol String
    The forwarding protocol. Valid values tcp and udp.
    id String
    The ID of the Port.
    instanceId String
    The Ddoscoo instance ID.
    realServers List<String>
    List of source IP addresses.
    backendPort string
    The source station port.
    frontendPort string
    The forwarding port.
    frontendProtocol string
    The forwarding protocol. Valid values tcp and udp.
    id string
    The ID of the Port.
    instanceId string
    The Ddoscoo instance ID.
    realServers string[]
    List of source IP addresses.
    backend_port str
    The source station port.
    frontend_port str
    The forwarding port.
    frontend_protocol str
    The forwarding protocol. Valid values tcp and udp.
    id str
    The ID of the Port.
    instance_id str
    The Ddoscoo instance ID.
    real_servers Sequence[str]
    List of source IP addresses.
    backendPort String
    The source station port.
    frontendPort String
    The forwarding port.
    frontendProtocol String
    The forwarding protocol. Valid values tcp and udp.
    id String
    The ID of the Port.
    instanceId String
    The Ddoscoo instance ID.
    realServers List<String>
    List of source IP addresses.

    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.68.0 published on Monday, Dec 2, 2024 by Pulumi