Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getDdosCooPorts

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

NOTE: Available in v1.123.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.Ddos.GetDdosCooPorts.InvokeAsync(new AliCloud.Ddos.GetDdosCooPortsArgs
        {
            InstanceId = "ddoscoo-cn-6ja1rl4j****",
            Ids = 
            {
                "ddoscoo-cn-6ja1rl4j****:7001:tcp",
            },
        }));
        this.FirstDdoscooPortId = example.Apply(example => example.Ports?[0]?.Id);
    }

    [Output("firstDdoscooPortId")]
    public Output<string> FirstDdoscooPortId { get; set; }
}
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
	})
}
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()));
    }
}
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)
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);
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.

Ids List<string>

A list of Port IDs.

OutputFile string
InstanceId string

The Ddoscoo instance ID.

FrontendPort string

The forwarding port.

FrontendProtocol string

The forwarding protocol.

Ids []string

A list of Port IDs.

OutputFile string
instanceId String

The Ddoscoo instance ID.

frontendPort String

The forwarding port.

frontendProtocol String

The forwarding protocol.

ids List<String>

A list of Port IDs.

outputFile String
instanceId string

The Ddoscoo instance ID.

frontendPort string

The forwarding port.

frontendProtocol string

The forwarding protocol.

ids string[]

A list of Port IDs.

outputFile string
instance_id str

The Ddoscoo instance ID.

frontend_port str

The forwarding port.

frontend_protocol str

The forwarding protocol.

ids Sequence[str]

A list of Port IDs.

output_file str
instanceId String

The Ddoscoo instance ID.

frontendPort String

The forwarding port.

frontendProtocol String

The forwarding protocol.

ids List<String>

A list of Port IDs.

outputFile String

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.

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.

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.

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.

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.

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.

id String

The ID of the Port.

instanceId String

The Ddoscoo instance ID.

realServers List<String>

List of source IP addresses.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.