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

alicloud.ga.CustomRoutingEndpointTrafficPolicy

Explore with Pulumi AI

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

    Provides a Global Accelerator (GA) Custom Routing Endpoint Traffic Policy resource.

    For information about Global Accelerator (GA) Custom Routing Endpoint Traffic Policy and how to use it, see What is Custom Routing Endpoint Traffic Policy.

    NOTE: Available since v1.197.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const region = config.get("region") || "cn-hangzhou";
    const name = config.get("name") || "tf-example";
    const default = alicloud.getZones({});
    const defaultGetAccelerators = alicloud.ga.getAccelerators({
        status: "active",
        bandwidthBillingType: "BandwidthPackage",
    });
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: name,
        cidrBlock: "192.168.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("default", {
        vswitchName: name,
        vpcId: defaultNetwork.id,
        cidrBlock: "192.168.192.0/24",
        zoneId: _default.then(_default => _default.ids?.[0]),
    });
    const defaultBandwidthPackage = new alicloud.ga.BandwidthPackage("default", {
        bandwidth: 100,
        type: "Basic",
        bandwidthType: "Basic",
        paymentType: "PayAsYouGo",
        billingType: "PayBy95",
        ratio: 30,
    });
    const defaultGetRegions = alicloud.getRegions({
        current: true,
    });
    const defaultBandwidthPackageAttachment = new alicloud.ga.BandwidthPackageAttachment("default", {
        acceleratorId: defaultGetAccelerators.then(defaultGetAccelerators => defaultGetAccelerators.accelerators?.[1]?.id),
        bandwidthPackageId: defaultBandwidthPackage.id,
    });
    const defaultListener = new alicloud.ga.Listener("default", {
        acceleratorId: defaultBandwidthPackageAttachment.acceleratorId,
        listenerType: "CustomRouting",
        portRanges: [{
            fromPort: 10000,
            toPort: 26000,
        }],
    });
    const defaultCustomRoutingEndpointGroup = new alicloud.ga.CustomRoutingEndpointGroup("default", {
        acceleratorId: defaultListener.acceleratorId,
        listenerId: defaultListener.id,
        endpointGroupRegion: defaultGetRegions.then(defaultGetRegions => defaultGetRegions.regions?.[0]?.id),
        customRoutingEndpointGroupName: name,
        description: name,
    });
    const defaultCustomRoutingEndpointGroupDestination = new alicloud.ga.CustomRoutingEndpointGroupDestination("default", {
        endpointGroupId: defaultCustomRoutingEndpointGroup.id,
        protocols: ["TCP"],
        fromPort: 1,
        toPort: 10,
    });
    const defaultCustomRoutingEndpoint = new alicloud.ga.CustomRoutingEndpoint("default", {
        endpointGroupId: defaultCustomRoutingEndpointGroupDestination.endpointGroupId,
        endpoint: defaultSwitch.id,
        type: "PrivateSubNet",
        trafficToEndpointPolicy: "AllowAll",
    });
    const defaultCustomRoutingEndpointTrafficPolicy = new alicloud.ga.CustomRoutingEndpointTrafficPolicy("default", {
        endpointId: defaultCustomRoutingEndpoint.customRoutingEndpointId,
        address: "192.168.192.2",
        portRanges: [{
            fromPort: 1,
            toPort: 2,
        }],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    region = config.get("region")
    if region is None:
        region = "cn-hangzhou"
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = alicloud.get_zones()
    default_get_accelerators = alicloud.ga.get_accelerators(status="active",
        bandwidth_billing_type="BandwidthPackage")
    default_network = alicloud.vpc.Network("default",
        vpc_name=name,
        cidr_block="192.168.0.0/16")
    default_switch = alicloud.vpc.Switch("default",
        vswitch_name=name,
        vpc_id=default_network.id,
        cidr_block="192.168.192.0/24",
        zone_id=default.ids[0])
    default_bandwidth_package = alicloud.ga.BandwidthPackage("default",
        bandwidth=100,
        type="Basic",
        bandwidth_type="Basic",
        payment_type="PayAsYouGo",
        billing_type="PayBy95",
        ratio=30)
    default_get_regions = alicloud.get_regions(current=True)
    default_bandwidth_package_attachment = alicloud.ga.BandwidthPackageAttachment("default",
        accelerator_id=default_get_accelerators.accelerators[1].id,
        bandwidth_package_id=default_bandwidth_package.id)
    default_listener = alicloud.ga.Listener("default",
        accelerator_id=default_bandwidth_package_attachment.accelerator_id,
        listener_type="CustomRouting",
        port_ranges=[{
            "from_port": 10000,
            "to_port": 26000,
        }])
    default_custom_routing_endpoint_group = alicloud.ga.CustomRoutingEndpointGroup("default",
        accelerator_id=default_listener.accelerator_id,
        listener_id=default_listener.id,
        endpoint_group_region=default_get_regions.regions[0].id,
        custom_routing_endpoint_group_name=name,
        description=name)
    default_custom_routing_endpoint_group_destination = alicloud.ga.CustomRoutingEndpointGroupDestination("default",
        endpoint_group_id=default_custom_routing_endpoint_group.id,
        protocols=["TCP"],
        from_port=1,
        to_port=10)
    default_custom_routing_endpoint = alicloud.ga.CustomRoutingEndpoint("default",
        endpoint_group_id=default_custom_routing_endpoint_group_destination.endpoint_group_id,
        endpoint=default_switch.id,
        type="PrivateSubNet",
        traffic_to_endpoint_policy="AllowAll")
    default_custom_routing_endpoint_traffic_policy = alicloud.ga.CustomRoutingEndpointTrafficPolicy("default",
        endpoint_id=default_custom_routing_endpoint.custom_routing_endpoint_id,
        address="192.168.192.2",
        port_ranges=[{
            "from_port": 1,
            "to_port": 2,
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ga"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"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, "")
    		region := "cn-hangzhou"
    		if param := cfg.Get("region"); param != "" {
    			region = param
    		}
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		defaultGetAccelerators, err := ga.GetAccelerators(ctx, &ga.GetAcceleratorsArgs{
    			Status:               pulumi.StringRef("active"),
    			BandwidthBillingType: pulumi.StringRef("BandwidthPackage"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("192.168.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
    			VswitchName: pulumi.String(name),
    			VpcId:       defaultNetwork.ID(),
    			CidrBlock:   pulumi.String("192.168.192.0/24"),
    			ZoneId:      pulumi.String(_default.Ids[0]),
    		})
    		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),
    		})
    		if err != nil {
    			return err
    		}
    		defaultGetRegions, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
    			Current: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultBandwidthPackageAttachment, err := ga.NewBandwidthPackageAttachment(ctx, "default", &ga.BandwidthPackageAttachmentArgs{
    			AcceleratorId:      pulumi.String(defaultGetAccelerators.Accelerators[1].Id),
    			BandwidthPackageId: defaultBandwidthPackage.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultListener, err := ga.NewListener(ctx, "default", &ga.ListenerArgs{
    			AcceleratorId: defaultBandwidthPackageAttachment.AcceleratorId,
    			ListenerType:  pulumi.String("CustomRouting"),
    			PortRanges: ga.ListenerPortRangeArray{
    				&ga.ListenerPortRangeArgs{
    					FromPort: pulumi.Int(10000),
    					ToPort:   pulumi.Int(26000),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultCustomRoutingEndpointGroup, err := ga.NewCustomRoutingEndpointGroup(ctx, "default", &ga.CustomRoutingEndpointGroupArgs{
    			AcceleratorId:                  defaultListener.AcceleratorId,
    			ListenerId:                     defaultListener.ID(),
    			EndpointGroupRegion:            pulumi.String(defaultGetRegions.Regions[0].Id),
    			CustomRoutingEndpointGroupName: pulumi.String(name),
    			Description:                    pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultCustomRoutingEndpointGroupDestination, err := ga.NewCustomRoutingEndpointGroupDestination(ctx, "default", &ga.CustomRoutingEndpointGroupDestinationArgs{
    			EndpointGroupId: defaultCustomRoutingEndpointGroup.ID(),
    			Protocols: pulumi.StringArray{
    				pulumi.String("TCP"),
    			},
    			FromPort: pulumi.Int(1),
    			ToPort:   pulumi.Int(10),
    		})
    		if err != nil {
    			return err
    		}
    		defaultCustomRoutingEndpoint, err := ga.NewCustomRoutingEndpoint(ctx, "default", &ga.CustomRoutingEndpointArgs{
    			EndpointGroupId:         defaultCustomRoutingEndpointGroupDestination.EndpointGroupId,
    			Endpoint:                defaultSwitch.ID(),
    			Type:                    pulumi.String("PrivateSubNet"),
    			TrafficToEndpointPolicy: pulumi.String("AllowAll"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ga.NewCustomRoutingEndpointTrafficPolicy(ctx, "default", &ga.CustomRoutingEndpointTrafficPolicyArgs{
    			EndpointId: defaultCustomRoutingEndpoint.CustomRoutingEndpointId,
    			Address:    pulumi.String("192.168.192.2"),
    			PortRanges: ga.CustomRoutingEndpointTrafficPolicyPortRangeArray{
    				&ga.CustomRoutingEndpointTrafficPolicyPortRangeArgs{
    					FromPort: pulumi.Int(1),
    					ToPort:   pulumi.Int(2),
    				},
    			},
    		})
    		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 config = new Config();
        var region = config.Get("region") ?? "cn-hangzhou";
        var name = config.Get("name") ?? "tf-example";
        var @default = AliCloud.GetZones.Invoke();
    
        var defaultGetAccelerators = AliCloud.Ga.GetAccelerators.Invoke(new()
        {
            Status = "active",
            BandwidthBillingType = "BandwidthPackage",
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = name,
            CidrBlock = "192.168.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
        {
            VswitchName = name,
            VpcId = defaultNetwork.Id,
            CidrBlock = "192.168.192.0/24",
            ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Ids[0])),
        });
    
        var defaultBandwidthPackage = new AliCloud.Ga.BandwidthPackage("default", new()
        {
            Bandwidth = 100,
            Type = "Basic",
            BandwidthType = "Basic",
            PaymentType = "PayAsYouGo",
            BillingType = "PayBy95",
            Ratio = 30,
        });
    
        var defaultGetRegions = AliCloud.GetRegions.Invoke(new()
        {
            Current = true,
        });
    
        var defaultBandwidthPackageAttachment = new AliCloud.Ga.BandwidthPackageAttachment("default", new()
        {
            AcceleratorId = defaultGetAccelerators.Apply(getAcceleratorsResult => getAcceleratorsResult.Accelerators[1]?.Id),
            BandwidthPackageId = defaultBandwidthPackage.Id,
        });
    
        var defaultListener = new AliCloud.Ga.Listener("default", new()
        {
            AcceleratorId = defaultBandwidthPackageAttachment.AcceleratorId,
            ListenerType = "CustomRouting",
            PortRanges = new[]
            {
                new AliCloud.Ga.Inputs.ListenerPortRangeArgs
                {
                    FromPort = 10000,
                    ToPort = 26000,
                },
            },
        });
    
        var defaultCustomRoutingEndpointGroup = new AliCloud.Ga.CustomRoutingEndpointGroup("default", new()
        {
            AcceleratorId = defaultListener.AcceleratorId,
            ListenerId = defaultListener.Id,
            EndpointGroupRegion = defaultGetRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id),
            CustomRoutingEndpointGroupName = name,
            Description = name,
        });
    
        var defaultCustomRoutingEndpointGroupDestination = new AliCloud.Ga.CustomRoutingEndpointGroupDestination("default", new()
        {
            EndpointGroupId = defaultCustomRoutingEndpointGroup.Id,
            Protocols = new[]
            {
                "TCP",
            },
            FromPort = 1,
            ToPort = 10,
        });
    
        var defaultCustomRoutingEndpoint = new AliCloud.Ga.CustomRoutingEndpoint("default", new()
        {
            EndpointGroupId = defaultCustomRoutingEndpointGroupDestination.EndpointGroupId,
            Endpoint = defaultSwitch.Id,
            Type = "PrivateSubNet",
            TrafficToEndpointPolicy = "AllowAll",
        });
    
        var defaultCustomRoutingEndpointTrafficPolicy = new AliCloud.Ga.CustomRoutingEndpointTrafficPolicy("default", new()
        {
            EndpointId = defaultCustomRoutingEndpoint.CustomRoutingEndpointId,
            Address = "192.168.192.2",
            PortRanges = new[]
            {
                new AliCloud.Ga.Inputs.CustomRoutingEndpointTrafficPolicyPortRangeArgs
                {
                    FromPort = 1,
                    ToPort = 2,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetZonesArgs;
    import com.pulumi.alicloud.ga.GaFunctions;
    import com.pulumi.alicloud.ga.inputs.GetAcceleratorsArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.ga.BandwidthPackage;
    import com.pulumi.alicloud.ga.BandwidthPackageArgs;
    import com.pulumi.alicloud.inputs.GetRegionsArgs;
    import com.pulumi.alicloud.ga.BandwidthPackageAttachment;
    import com.pulumi.alicloud.ga.BandwidthPackageAttachmentArgs;
    import com.pulumi.alicloud.ga.Listener;
    import com.pulumi.alicloud.ga.ListenerArgs;
    import com.pulumi.alicloud.ga.inputs.ListenerPortRangeArgs;
    import com.pulumi.alicloud.ga.CustomRoutingEndpointGroup;
    import com.pulumi.alicloud.ga.CustomRoutingEndpointGroupArgs;
    import com.pulumi.alicloud.ga.CustomRoutingEndpointGroupDestination;
    import com.pulumi.alicloud.ga.CustomRoutingEndpointGroupDestinationArgs;
    import com.pulumi.alicloud.ga.CustomRoutingEndpoint;
    import com.pulumi.alicloud.ga.CustomRoutingEndpointArgs;
    import com.pulumi.alicloud.ga.CustomRoutingEndpointTrafficPolicy;
    import com.pulumi.alicloud.ga.CustomRoutingEndpointTrafficPolicyArgs;
    import com.pulumi.alicloud.ga.inputs.CustomRoutingEndpointTrafficPolicyPortRangeArgs;
    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 region = config.get("region").orElse("cn-hangzhou");
            final var name = config.get("name").orElse("tf-example");
            final var default = AlicloudFunctions.getZones();
    
            final var defaultGetAccelerators = GaFunctions.getAccelerators(GetAcceleratorsArgs.builder()
                .status("active")
                .bandwidthBillingType("BandwidthPackage")
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
                .vpcName(name)
                .cidrBlock("192.168.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
                .vswitchName(name)
                .vpcId(defaultNetwork.id())
                .cidrBlock("192.168.192.0/24")
                .zoneId(default_.ids()[0])
                .build());
    
            var defaultBandwidthPackage = new BandwidthPackage("defaultBandwidthPackage", BandwidthPackageArgs.builder()
                .bandwidth(100)
                .type("Basic")
                .bandwidthType("Basic")
                .paymentType("PayAsYouGo")
                .billingType("PayBy95")
                .ratio(30)
                .build());
    
            final var defaultGetRegions = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
                .current(true)
                .build());
    
            var defaultBandwidthPackageAttachment = new BandwidthPackageAttachment("defaultBandwidthPackageAttachment", BandwidthPackageAttachmentArgs.builder()
                .acceleratorId(defaultGetAccelerators.applyValue(getAcceleratorsResult -> getAcceleratorsResult.accelerators()[1].id()))
                .bandwidthPackageId(defaultBandwidthPackage.id())
                .build());
    
            var defaultListener = new Listener("defaultListener", ListenerArgs.builder()
                .acceleratorId(defaultBandwidthPackageAttachment.acceleratorId())
                .listenerType("CustomRouting")
                .portRanges(ListenerPortRangeArgs.builder()
                    .fromPort(10000)
                    .toPort(26000)
                    .build())
                .build());
    
            var defaultCustomRoutingEndpointGroup = new CustomRoutingEndpointGroup("defaultCustomRoutingEndpointGroup", CustomRoutingEndpointGroupArgs.builder()
                .acceleratorId(defaultListener.acceleratorId())
                .listenerId(defaultListener.id())
                .endpointGroupRegion(defaultGetRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id()))
                .customRoutingEndpointGroupName(name)
                .description(name)
                .build());
    
            var defaultCustomRoutingEndpointGroupDestination = new CustomRoutingEndpointGroupDestination("defaultCustomRoutingEndpointGroupDestination", CustomRoutingEndpointGroupDestinationArgs.builder()
                .endpointGroupId(defaultCustomRoutingEndpointGroup.id())
                .protocols("TCP")
                .fromPort(1)
                .toPort(10)
                .build());
    
            var defaultCustomRoutingEndpoint = new CustomRoutingEndpoint("defaultCustomRoutingEndpoint", CustomRoutingEndpointArgs.builder()
                .endpointGroupId(defaultCustomRoutingEndpointGroupDestination.endpointGroupId())
                .endpoint(defaultSwitch.id())
                .type("PrivateSubNet")
                .trafficToEndpointPolicy("AllowAll")
                .build());
    
            var defaultCustomRoutingEndpointTrafficPolicy = new CustomRoutingEndpointTrafficPolicy("defaultCustomRoutingEndpointTrafficPolicy", CustomRoutingEndpointTrafficPolicyArgs.builder()
                .endpointId(defaultCustomRoutingEndpoint.customRoutingEndpointId())
                .address("192.168.192.2")
                .portRanges(CustomRoutingEndpointTrafficPolicyPortRangeArgs.builder()
                    .fromPort(1)
                    .toPort(2)
                    .build())
                .build());
    
        }
    }
    
    configuration:
      region:
        type: string
        default: cn-hangzhou
      name:
        type: string
        default: tf-example
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        name: default
        properties:
          vpcName: ${name}
          cidrBlock: 192.168.0.0/16
      defaultSwitch:
        type: alicloud:vpc:Switch
        name: default
        properties:
          vswitchName: ${name}
          vpcId: ${defaultNetwork.id}
          cidrBlock: 192.168.192.0/24
          zoneId: ${default.ids[0]}
      defaultBandwidthPackage:
        type: alicloud:ga:BandwidthPackage
        name: default
        properties:
          bandwidth: 100
          type: Basic
          bandwidthType: Basic
          paymentType: PayAsYouGo
          billingType: PayBy95
          ratio: 30
      defaultBandwidthPackageAttachment:
        type: alicloud:ga:BandwidthPackageAttachment
        name: default
        properties:
          acceleratorId: ${defaultGetAccelerators.accelerators[1].id}
          bandwidthPackageId: ${defaultBandwidthPackage.id}
      defaultListener:
        type: alicloud:ga:Listener
        name: default
        properties:
          acceleratorId: ${defaultBandwidthPackageAttachment.acceleratorId}
          listenerType: CustomRouting
          portRanges:
            - fromPort: 10000
              toPort: 26000
      defaultCustomRoutingEndpointGroup:
        type: alicloud:ga:CustomRoutingEndpointGroup
        name: default
        properties:
          acceleratorId: ${defaultListener.acceleratorId}
          listenerId: ${defaultListener.id}
          endpointGroupRegion: ${defaultGetRegions.regions[0].id}
          customRoutingEndpointGroupName: ${name}
          description: ${name}
      defaultCustomRoutingEndpointGroupDestination:
        type: alicloud:ga:CustomRoutingEndpointGroupDestination
        name: default
        properties:
          endpointGroupId: ${defaultCustomRoutingEndpointGroup.id}
          protocols:
            - TCP
          fromPort: 1
          toPort: 10
      defaultCustomRoutingEndpoint:
        type: alicloud:ga:CustomRoutingEndpoint
        name: default
        properties:
          endpointGroupId: ${defaultCustomRoutingEndpointGroupDestination.endpointGroupId}
          endpoint: ${defaultSwitch.id}
          type: PrivateSubNet
          trafficToEndpointPolicy: AllowAll
      defaultCustomRoutingEndpointTrafficPolicy:
        type: alicloud:ga:CustomRoutingEndpointTrafficPolicy
        name: default
        properties:
          endpointId: ${defaultCustomRoutingEndpoint.customRoutingEndpointId}
          address: 192.168.192.2
          portRanges:
            - fromPort: 1
              toPort: 2
    variables:
      default:
        fn::invoke:
          Function: alicloud:getZones
          Arguments: {}
      defaultGetAccelerators:
        fn::invoke:
          Function: alicloud:ga:getAccelerators
          Arguments:
            status: active
            bandwidthBillingType: BandwidthPackage
      defaultGetRegions:
        fn::invoke:
          Function: alicloud:getRegions
          Arguments:
            current: true
    

    Create CustomRoutingEndpointTrafficPolicy Resource

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

    Constructor syntax

    new CustomRoutingEndpointTrafficPolicy(name: string, args: CustomRoutingEndpointTrafficPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def CustomRoutingEndpointTrafficPolicy(resource_name: str,
                                           args: CustomRoutingEndpointTrafficPolicyArgs,
                                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def CustomRoutingEndpointTrafficPolicy(resource_name: str,
                                           opts: Optional[ResourceOptions] = None,
                                           address: Optional[str] = None,
                                           endpoint_id: Optional[str] = None,
                                           port_ranges: Optional[Sequence[CustomRoutingEndpointTrafficPolicyPortRangeArgs]] = None)
    func NewCustomRoutingEndpointTrafficPolicy(ctx *Context, name string, args CustomRoutingEndpointTrafficPolicyArgs, opts ...ResourceOption) (*CustomRoutingEndpointTrafficPolicy, error)
    public CustomRoutingEndpointTrafficPolicy(string name, CustomRoutingEndpointTrafficPolicyArgs args, CustomResourceOptions? opts = null)
    public CustomRoutingEndpointTrafficPolicy(String name, CustomRoutingEndpointTrafficPolicyArgs args)
    public CustomRoutingEndpointTrafficPolicy(String name, CustomRoutingEndpointTrafficPolicyArgs args, CustomResourceOptions options)
    
    type: alicloud:ga:CustomRoutingEndpointTrafficPolicy
    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 CustomRoutingEndpointTrafficPolicyArgs
    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 CustomRoutingEndpointTrafficPolicyArgs
    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 CustomRoutingEndpointTrafficPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomRoutingEndpointTrafficPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CustomRoutingEndpointTrafficPolicyArgs
    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 customRoutingEndpointTrafficPolicyResource = new AliCloud.Ga.CustomRoutingEndpointTrafficPolicy("customRoutingEndpointTrafficPolicyResource", new()
    {
        Address = "string",
        EndpointId = "string",
        PortRanges = new[]
        {
            new AliCloud.Ga.Inputs.CustomRoutingEndpointTrafficPolicyPortRangeArgs
            {
                FromPort = 0,
                ToPort = 0,
            },
        },
    });
    
    example, err := ga.NewCustomRoutingEndpointTrafficPolicy(ctx, "customRoutingEndpointTrafficPolicyResource", &ga.CustomRoutingEndpointTrafficPolicyArgs{
    	Address:    pulumi.String("string"),
    	EndpointId: pulumi.String("string"),
    	PortRanges: ga.CustomRoutingEndpointTrafficPolicyPortRangeArray{
    		&ga.CustomRoutingEndpointTrafficPolicyPortRangeArgs{
    			FromPort: pulumi.Int(0),
    			ToPort:   pulumi.Int(0),
    		},
    	},
    })
    
    var customRoutingEndpointTrafficPolicyResource = new CustomRoutingEndpointTrafficPolicy("customRoutingEndpointTrafficPolicyResource", CustomRoutingEndpointTrafficPolicyArgs.builder()
        .address("string")
        .endpointId("string")
        .portRanges(CustomRoutingEndpointTrafficPolicyPortRangeArgs.builder()
            .fromPort(0)
            .toPort(0)
            .build())
        .build());
    
    custom_routing_endpoint_traffic_policy_resource = alicloud.ga.CustomRoutingEndpointTrafficPolicy("customRoutingEndpointTrafficPolicyResource",
        address="string",
        endpoint_id="string",
        port_ranges=[{
            "from_port": 0,
            "to_port": 0,
        }])
    
    const customRoutingEndpointTrafficPolicyResource = new alicloud.ga.CustomRoutingEndpointTrafficPolicy("customRoutingEndpointTrafficPolicyResource", {
        address: "string",
        endpointId: "string",
        portRanges: [{
            fromPort: 0,
            toPort: 0,
        }],
    });
    
    type: alicloud:ga:CustomRoutingEndpointTrafficPolicy
    properties:
        address: string
        endpointId: string
        portRanges:
            - fromPort: 0
              toPort: 0
    

    CustomRoutingEndpointTrafficPolicy 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 CustomRoutingEndpointTrafficPolicy resource accepts the following input properties:

    Address string
    The IP address of the destination to which traffic is allowed.
    EndpointId string
    The ID of the Custom Routing Endpoint.
    PortRanges List<Pulumi.AliCloud.Ga.Inputs.CustomRoutingEndpointTrafficPolicyPortRange>
    Port rangeSee the following. See port_ranges below.
    Address string
    The IP address of the destination to which traffic is allowed.
    EndpointId string
    The ID of the Custom Routing Endpoint.
    PortRanges []CustomRoutingEndpointTrafficPolicyPortRangeArgs
    Port rangeSee the following. See port_ranges below.
    address String
    The IP address of the destination to which traffic is allowed.
    endpointId String
    The ID of the Custom Routing Endpoint.
    portRanges List<CustomRoutingEndpointTrafficPolicyPortRange>
    Port rangeSee the following. See port_ranges below.
    address string
    The IP address of the destination to which traffic is allowed.
    endpointId string
    The ID of the Custom Routing Endpoint.
    portRanges CustomRoutingEndpointTrafficPolicyPortRange[]
    Port rangeSee the following. See port_ranges below.
    address str
    The IP address of the destination to which traffic is allowed.
    endpoint_id str
    The ID of the Custom Routing Endpoint.
    port_ranges Sequence[CustomRoutingEndpointTrafficPolicyPortRangeArgs]
    Port rangeSee the following. See port_ranges below.
    address String
    The IP address of the destination to which traffic is allowed.
    endpointId String
    The ID of the Custom Routing Endpoint.
    portRanges List<Property Map>
    Port rangeSee the following. See port_ranges below.

    Outputs

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

    AcceleratorId string
    The ID of the GA instance.
    CustomRoutingEndpointTrafficPolicyId string
    The ID of the Custom Routing Endpoint Traffic Policy.
    EndpointGroupId string
    The ID of the endpoint group.
    Id string
    The provider-assigned unique ID for this managed resource.
    ListenerId string
    The ID of the listener.
    Status string
    The status of the Custom Routing Endpoint Traffic Policy.
    AcceleratorId string
    The ID of the GA instance.
    CustomRoutingEndpointTrafficPolicyId string
    The ID of the Custom Routing Endpoint Traffic Policy.
    EndpointGroupId string
    The ID of the endpoint group.
    Id string
    The provider-assigned unique ID for this managed resource.
    ListenerId string
    The ID of the listener.
    Status string
    The status of the Custom Routing Endpoint Traffic Policy.
    acceleratorId String
    The ID of the GA instance.
    customRoutingEndpointTrafficPolicyId String
    The ID of the Custom Routing Endpoint Traffic Policy.
    endpointGroupId String
    The ID of the endpoint group.
    id String
    The provider-assigned unique ID for this managed resource.
    listenerId String
    The ID of the listener.
    status String
    The status of the Custom Routing Endpoint Traffic Policy.
    acceleratorId string
    The ID of the GA instance.
    customRoutingEndpointTrafficPolicyId string
    The ID of the Custom Routing Endpoint Traffic Policy.
    endpointGroupId string
    The ID of the endpoint group.
    id string
    The provider-assigned unique ID for this managed resource.
    listenerId string
    The ID of the listener.
    status string
    The status of the Custom Routing Endpoint Traffic Policy.
    accelerator_id str
    The ID of the GA instance.
    custom_routing_endpoint_traffic_policy_id str
    The ID of the Custom Routing Endpoint Traffic Policy.
    endpoint_group_id str
    The ID of the endpoint group.
    id str
    The provider-assigned unique ID for this managed resource.
    listener_id str
    The ID of the listener.
    status str
    The status of the Custom Routing Endpoint Traffic Policy.
    acceleratorId String
    The ID of the GA instance.
    customRoutingEndpointTrafficPolicyId String
    The ID of the Custom Routing Endpoint Traffic Policy.
    endpointGroupId String
    The ID of the endpoint group.
    id String
    The provider-assigned unique ID for this managed resource.
    listenerId String
    The ID of the listener.
    status String
    The status of the Custom Routing Endpoint Traffic Policy.

    Look up Existing CustomRoutingEndpointTrafficPolicy Resource

    Get an existing CustomRoutingEndpointTrafficPolicy 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?: CustomRoutingEndpointTrafficPolicyState, opts?: CustomResourceOptions): CustomRoutingEndpointTrafficPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            accelerator_id: Optional[str] = None,
            address: Optional[str] = None,
            custom_routing_endpoint_traffic_policy_id: Optional[str] = None,
            endpoint_group_id: Optional[str] = None,
            endpoint_id: Optional[str] = None,
            listener_id: Optional[str] = None,
            port_ranges: Optional[Sequence[CustomRoutingEndpointTrafficPolicyPortRangeArgs]] = None,
            status: Optional[str] = None) -> CustomRoutingEndpointTrafficPolicy
    func GetCustomRoutingEndpointTrafficPolicy(ctx *Context, name string, id IDInput, state *CustomRoutingEndpointTrafficPolicyState, opts ...ResourceOption) (*CustomRoutingEndpointTrafficPolicy, error)
    public static CustomRoutingEndpointTrafficPolicy Get(string name, Input<string> id, CustomRoutingEndpointTrafficPolicyState? state, CustomResourceOptions? opts = null)
    public static CustomRoutingEndpointTrafficPolicy get(String name, Output<String> id, CustomRoutingEndpointTrafficPolicyState 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 GA instance.
    Address string
    The IP address of the destination to which traffic is allowed.
    CustomRoutingEndpointTrafficPolicyId string
    The ID of the Custom Routing Endpoint Traffic Policy.
    EndpointGroupId string
    The ID of the endpoint group.
    EndpointId string
    The ID of the Custom Routing Endpoint.
    ListenerId string
    The ID of the listener.
    PortRanges List<Pulumi.AliCloud.Ga.Inputs.CustomRoutingEndpointTrafficPolicyPortRange>
    Port rangeSee the following. See port_ranges below.
    Status string
    The status of the Custom Routing Endpoint Traffic Policy.
    AcceleratorId string
    The ID of the GA instance.
    Address string
    The IP address of the destination to which traffic is allowed.
    CustomRoutingEndpointTrafficPolicyId string
    The ID of the Custom Routing Endpoint Traffic Policy.
    EndpointGroupId string
    The ID of the endpoint group.
    EndpointId string
    The ID of the Custom Routing Endpoint.
    ListenerId string
    The ID of the listener.
    PortRanges []CustomRoutingEndpointTrafficPolicyPortRangeArgs
    Port rangeSee the following. See port_ranges below.
    Status string
    The status of the Custom Routing Endpoint Traffic Policy.
    acceleratorId String
    The ID of the GA instance.
    address String
    The IP address of the destination to which traffic is allowed.
    customRoutingEndpointTrafficPolicyId String
    The ID of the Custom Routing Endpoint Traffic Policy.
    endpointGroupId String
    The ID of the endpoint group.
    endpointId String
    The ID of the Custom Routing Endpoint.
    listenerId String
    The ID of the listener.
    portRanges List<CustomRoutingEndpointTrafficPolicyPortRange>
    Port rangeSee the following. See port_ranges below.
    status String
    The status of the Custom Routing Endpoint Traffic Policy.
    acceleratorId string
    The ID of the GA instance.
    address string
    The IP address of the destination to which traffic is allowed.
    customRoutingEndpointTrafficPolicyId string
    The ID of the Custom Routing Endpoint Traffic Policy.
    endpointGroupId string
    The ID of the endpoint group.
    endpointId string
    The ID of the Custom Routing Endpoint.
    listenerId string
    The ID of the listener.
    portRanges CustomRoutingEndpointTrafficPolicyPortRange[]
    Port rangeSee the following. See port_ranges below.
    status string
    The status of the Custom Routing Endpoint Traffic Policy.
    accelerator_id str
    The ID of the GA instance.
    address str
    The IP address of the destination to which traffic is allowed.
    custom_routing_endpoint_traffic_policy_id str
    The ID of the Custom Routing Endpoint Traffic Policy.
    endpoint_group_id str
    The ID of the endpoint group.
    endpoint_id str
    The ID of the Custom Routing Endpoint.
    listener_id str
    The ID of the listener.
    port_ranges Sequence[CustomRoutingEndpointTrafficPolicyPortRangeArgs]
    Port rangeSee the following. See port_ranges below.
    status str
    The status of the Custom Routing Endpoint Traffic Policy.
    acceleratorId String
    The ID of the GA instance.
    address String
    The IP address of the destination to which traffic is allowed.
    customRoutingEndpointTrafficPolicyId String
    The ID of the Custom Routing Endpoint Traffic Policy.
    endpointGroupId String
    The ID of the endpoint group.
    endpointId String
    The ID of the Custom Routing Endpoint.
    listenerId String
    The ID of the listener.
    portRanges List<Property Map>
    Port rangeSee the following. See port_ranges below.
    status String
    The status of the Custom Routing Endpoint Traffic Policy.

    Supporting Types

    CustomRoutingEndpointTrafficPolicyPortRange, CustomRoutingEndpointTrafficPolicyPortRangeArgs

    FromPort int
    The start port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.
    ToPort int
    The end port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.
    FromPort int
    The start port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.
    ToPort int
    The end port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.
    fromPort Integer
    The start port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.
    toPort Integer
    The end port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.
    fromPort number
    The start port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.
    toPort number
    The end port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.
    from_port int
    The start port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.
    to_port int
    The end port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.
    fromPort Number
    The start port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.
    toPort Number
    The end port of the port range of the traffic destination. The specified port must fall within the port range of the specified endpoint group.

    Import

    Global Accelerator (GA) Custom Routing Endpoint Traffic Policy can be imported using the id, e.g.

    $ pulumi import alicloud:ga/customRoutingEndpointTrafficPolicy:CustomRoutingEndpointTrafficPolicy example <endpoint_id>:<custom_routing_endpoint_traffic_policy_id>
    

    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