1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ga
  5. CustomRoutingEndpointTrafficPolicy
Alibaba Cloud v3.43.1 published on Monday, Sep 11, 2023 by Pulumi

alicloud.ga.CustomRoutingEndpointTrafficPolicy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.43.1 published on Monday, Sep 11, 2023 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

    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 defaultZones = AliCloud.GetZones.Invoke(new()
        {
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
        {
            VpcName = "terraform-example",
            CidrBlock = "172.17.3.0/24",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
        {
            VswitchName = "terraform-example",
            CidrBlock = "172.17.3.0/24",
            VpcId = defaultNetwork.Id,
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
        });
    
        var defaultAccelerator = new AliCloud.Ga.Accelerator("defaultAccelerator", new()
        {
            Duration = 1,
            AutoUseCoupon = true,
            Spec = "1",
        });
    
        var defaultBandwidthPackage = new AliCloud.Ga.BandwidthPackage("defaultBandwidthPackage", new()
        {
            Bandwidth = 100,
            Type = "Basic",
            BandwidthType = "Basic",
            PaymentType = "PayAsYouGo",
            BillingType = "PayBy95",
            Ratio = 30,
        });
    
        var defaultBandwidthPackageAttachment = new AliCloud.Ga.BandwidthPackageAttachment("defaultBandwidthPackageAttachment", new()
        {
            AcceleratorId = defaultAccelerator.Id,
            BandwidthPackageId = defaultBandwidthPackage.Id,
        });
    
        var defaultListener = new AliCloud.Ga.Listener("defaultListener", new()
        {
            AcceleratorId = defaultBandwidthPackageAttachment.AcceleratorId,
            ListenerType = "CustomRouting",
            PortRanges = new[]
            {
                new AliCloud.Ga.Inputs.ListenerPortRangeArgs
                {
                    FromPort = 10000,
                    ToPort = 16000,
                },
            },
        });
    
        var defaultCustomRoutingEndpointGroup = new AliCloud.Ga.CustomRoutingEndpointGroup("defaultCustomRoutingEndpointGroup", new()
        {
            AcceleratorId = defaultListener.AcceleratorId,
            ListenerId = defaultListener.Id,
            EndpointGroupRegion = region,
            CustomRoutingEndpointGroupName = "terraform-example",
            Description = "terraform-example",
        });
    
        var defaultCustomRoutingEndpoint = new AliCloud.Ga.CustomRoutingEndpoint("defaultCustomRoutingEndpoint", new()
        {
            EndpointGroupId = defaultCustomRoutingEndpointGroup.Id,
            Endpoint = defaultSwitch.Id,
            Type = "PrivateSubNet",
            TrafficToEndpointPolicy = "AllowCustom",
        });
    
        var defaultCustomRoutingEndpointGroupDestination = new AliCloud.Ga.CustomRoutingEndpointGroupDestination("defaultCustomRoutingEndpointGroupDestination", new()
        {
            EndpointGroupId = defaultCustomRoutingEndpointGroup.Id,
            Protocols = new[]
            {
                "TCP",
            },
            FromPort = 1,
            ToPort = 10,
        });
    
        var defaultCustomRoutingEndpointTrafficPolicy = new AliCloud.Ga.CustomRoutingEndpointTrafficPolicy("defaultCustomRoutingEndpointTrafficPolicy", new()
        {
            EndpointId = defaultCustomRoutingEndpoint.CustomRoutingEndpointId,
            Address = "172.17.3.0",
            PortRanges = new[]
            {
                new AliCloud.Ga.Inputs.CustomRoutingEndpointTrafficPolicyPortRangeArgs
                {
                    FromPort = 1,
                    ToPort = 10,
                },
            },
        });
    
    });
    
    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
    		}
    		defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
    			VpcName:   pulumi.String("terraform-example"),
    			CidrBlock: pulumi.String("172.17.3.0/24"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
    			VswitchName: pulumi.String("terraform-example"),
    			CidrBlock:   pulumi.String("172.17.3.0/24"),
    			VpcId:       defaultNetwork.ID(),
    			ZoneId:      *pulumi.String(defaultZones.Zones[0].Id),
    		})
    		if err != nil {
    			return err
    		}
    		defaultAccelerator, err := ga.NewAccelerator(ctx, "defaultAccelerator", &ga.AcceleratorArgs{
    			Duration:      pulumi.Int(1),
    			AutoUseCoupon: pulumi.Bool(true),
    			Spec:          pulumi.String("1"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultBandwidthPackage, err := ga.NewBandwidthPackage(ctx, "defaultBandwidthPackage", &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
    		}
    		defaultBandwidthPackageAttachment, err := ga.NewBandwidthPackageAttachment(ctx, "defaultBandwidthPackageAttachment", &ga.BandwidthPackageAttachmentArgs{
    			AcceleratorId:      defaultAccelerator.ID(),
    			BandwidthPackageId: defaultBandwidthPackage.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultListener, err := ga.NewListener(ctx, "defaultListener", &ga.ListenerArgs{
    			AcceleratorId: defaultBandwidthPackageAttachment.AcceleratorId,
    			ListenerType:  pulumi.String("CustomRouting"),
    			PortRanges: ga.ListenerPortRangeArray{
    				&ga.ListenerPortRangeArgs{
    					FromPort: pulumi.Int(10000),
    					ToPort:   pulumi.Int(16000),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultCustomRoutingEndpointGroup, err := ga.NewCustomRoutingEndpointGroup(ctx, "defaultCustomRoutingEndpointGroup", &ga.CustomRoutingEndpointGroupArgs{
    			AcceleratorId:                  defaultListener.AcceleratorId,
    			ListenerId:                     defaultListener.ID(),
    			EndpointGroupRegion:            pulumi.String(region),
    			CustomRoutingEndpointGroupName: pulumi.String("terraform-example"),
    			Description:                    pulumi.String("terraform-example"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultCustomRoutingEndpoint, err := ga.NewCustomRoutingEndpoint(ctx, "defaultCustomRoutingEndpoint", &ga.CustomRoutingEndpointArgs{
    			EndpointGroupId:         defaultCustomRoutingEndpointGroup.ID(),
    			Endpoint:                defaultSwitch.ID(),
    			Type:                    pulumi.String("PrivateSubNet"),
    			TrafficToEndpointPolicy: pulumi.String("AllowCustom"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ga.NewCustomRoutingEndpointGroupDestination(ctx, "defaultCustomRoutingEndpointGroupDestination", &ga.CustomRoutingEndpointGroupDestinationArgs{
    			EndpointGroupId: defaultCustomRoutingEndpointGroup.ID(),
    			Protocols: pulumi.StringArray{
    				pulumi.String("TCP"),
    			},
    			FromPort: pulumi.Int(1),
    			ToPort:   pulumi.Int(10),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ga.NewCustomRoutingEndpointTrafficPolicy(ctx, "defaultCustomRoutingEndpointTrafficPolicy", &ga.CustomRoutingEndpointTrafficPolicyArgs{
    			EndpointId: defaultCustomRoutingEndpoint.CustomRoutingEndpointId,
    			Address:    pulumi.String("172.17.3.0"),
    			PortRanges: ga.CustomRoutingEndpointTrafficPolicyPortRangeArray{
    				&ga.CustomRoutingEndpointTrafficPolicyPortRangeArgs{
    					FromPort: pulumi.Int(1),
    					ToPort:   pulumi.Int(10),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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.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.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.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.CustomRoutingEndpoint;
    import com.pulumi.alicloud.ga.CustomRoutingEndpointArgs;
    import com.pulumi.alicloud.ga.CustomRoutingEndpointGroupDestination;
    import com.pulumi.alicloud.ga.CustomRoutingEndpointGroupDestinationArgs;
    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 defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("VSwitch")
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()        
                .vpcName("terraform-example")
                .cidrBlock("172.17.3.0/24")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()        
                .vswitchName("terraform-example")
                .cidrBlock("172.17.3.0/24")
                .vpcId(defaultNetwork.id())
                .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .build());
    
            var defaultAccelerator = new Accelerator("defaultAccelerator", AcceleratorArgs.builder()        
                .duration(1)
                .autoUseCoupon(true)
                .spec("1")
                .build());
    
            var defaultBandwidthPackage = new BandwidthPackage("defaultBandwidthPackage", BandwidthPackageArgs.builder()        
                .bandwidth(100)
                .type("Basic")
                .bandwidthType("Basic")
                .paymentType("PayAsYouGo")
                .billingType("PayBy95")
                .ratio(30)
                .build());
    
            var defaultBandwidthPackageAttachment = new BandwidthPackageAttachment("defaultBandwidthPackageAttachment", BandwidthPackageAttachmentArgs.builder()        
                .acceleratorId(defaultAccelerator.id())
                .bandwidthPackageId(defaultBandwidthPackage.id())
                .build());
    
            var defaultListener = new Listener("defaultListener", ListenerArgs.builder()        
                .acceleratorId(defaultBandwidthPackageAttachment.acceleratorId())
                .listenerType("CustomRouting")
                .portRanges(ListenerPortRangeArgs.builder()
                    .fromPort(10000)
                    .toPort(16000)
                    .build())
                .build());
    
            var defaultCustomRoutingEndpointGroup = new CustomRoutingEndpointGroup("defaultCustomRoutingEndpointGroup", CustomRoutingEndpointGroupArgs.builder()        
                .acceleratorId(defaultListener.acceleratorId())
                .listenerId(defaultListener.id())
                .endpointGroupRegion(region)
                .customRoutingEndpointGroupName("terraform-example")
                .description("terraform-example")
                .build());
    
            var defaultCustomRoutingEndpoint = new CustomRoutingEndpoint("defaultCustomRoutingEndpoint", CustomRoutingEndpointArgs.builder()        
                .endpointGroupId(defaultCustomRoutingEndpointGroup.id())
                .endpoint(defaultSwitch.id())
                .type("PrivateSubNet")
                .trafficToEndpointPolicy("AllowCustom")
                .build());
    
            var defaultCustomRoutingEndpointGroupDestination = new CustomRoutingEndpointGroupDestination("defaultCustomRoutingEndpointGroupDestination", CustomRoutingEndpointGroupDestinationArgs.builder()        
                .endpointGroupId(defaultCustomRoutingEndpointGroup.id())
                .protocols("TCP")
                .fromPort(1)
                .toPort(10)
                .build());
    
            var defaultCustomRoutingEndpointTrafficPolicy = new CustomRoutingEndpointTrafficPolicy("defaultCustomRoutingEndpointTrafficPolicy", CustomRoutingEndpointTrafficPolicyArgs.builder()        
                .endpointId(defaultCustomRoutingEndpoint.customRoutingEndpointId())
                .address("172.17.3.0")
                .portRanges(CustomRoutingEndpointTrafficPolicyPortRangeArgs.builder()
                    .fromPort(1)
                    .toPort(10)
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    region = config.get("region")
    if region is None:
        region = "cn-hangzhou"
    default_zones = alicloud.get_zones(available_resource_creation="VSwitch")
    default_network = alicloud.vpc.Network("defaultNetwork",
        vpc_name="terraform-example",
        cidr_block="172.17.3.0/24")
    default_switch = alicloud.vpc.Switch("defaultSwitch",
        vswitch_name="terraform-example",
        cidr_block="172.17.3.0/24",
        vpc_id=default_network.id,
        zone_id=default_zones.zones[0].id)
    default_accelerator = alicloud.ga.Accelerator("defaultAccelerator",
        duration=1,
        auto_use_coupon=True,
        spec="1")
    default_bandwidth_package = alicloud.ga.BandwidthPackage("defaultBandwidthPackage",
        bandwidth=100,
        type="Basic",
        bandwidth_type="Basic",
        payment_type="PayAsYouGo",
        billing_type="PayBy95",
        ratio=30)
    default_bandwidth_package_attachment = alicloud.ga.BandwidthPackageAttachment("defaultBandwidthPackageAttachment",
        accelerator_id=default_accelerator.id,
        bandwidth_package_id=default_bandwidth_package.id)
    default_listener = alicloud.ga.Listener("defaultListener",
        accelerator_id=default_bandwidth_package_attachment.accelerator_id,
        listener_type="CustomRouting",
        port_ranges=[alicloud.ga.ListenerPortRangeArgs(
            from_port=10000,
            to_port=16000,
        )])
    default_custom_routing_endpoint_group = alicloud.ga.CustomRoutingEndpointGroup("defaultCustomRoutingEndpointGroup",
        accelerator_id=default_listener.accelerator_id,
        listener_id=default_listener.id,
        endpoint_group_region=region,
        custom_routing_endpoint_group_name="terraform-example",
        description="terraform-example")
    default_custom_routing_endpoint = alicloud.ga.CustomRoutingEndpoint("defaultCustomRoutingEndpoint",
        endpoint_group_id=default_custom_routing_endpoint_group.id,
        endpoint=default_switch.id,
        type="PrivateSubNet",
        traffic_to_endpoint_policy="AllowCustom")
    default_custom_routing_endpoint_group_destination = alicloud.ga.CustomRoutingEndpointGroupDestination("defaultCustomRoutingEndpointGroupDestination",
        endpoint_group_id=default_custom_routing_endpoint_group.id,
        protocols=["TCP"],
        from_port=1,
        to_port=10)
    default_custom_routing_endpoint_traffic_policy = alicloud.ga.CustomRoutingEndpointTrafficPolicy("defaultCustomRoutingEndpointTrafficPolicy",
        endpoint_id=default_custom_routing_endpoint.custom_routing_endpoint_id,
        address="172.17.3.0",
        port_ranges=[alicloud.ga.CustomRoutingEndpointTrafficPolicyPortRangeArgs(
            from_port=1,
            to_port=10,
        )])
    
    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 defaultZones = alicloud.getZones({
        availableResourceCreation: "VSwitch",
    });
    const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
        vpcName: "terraform-example",
        cidrBlock: "172.17.3.0/24",
    });
    const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
        vswitchName: "terraform-example",
        cidrBlock: "172.17.3.0/24",
        vpcId: defaultNetwork.id,
        zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
    });
    const defaultAccelerator = new alicloud.ga.Accelerator("defaultAccelerator", {
        duration: 1,
        autoUseCoupon: true,
        spec: "1",
    });
    const defaultBandwidthPackage = new alicloud.ga.BandwidthPackage("defaultBandwidthPackage", {
        bandwidth: 100,
        type: "Basic",
        bandwidthType: "Basic",
        paymentType: "PayAsYouGo",
        billingType: "PayBy95",
        ratio: 30,
    });
    const defaultBandwidthPackageAttachment = new alicloud.ga.BandwidthPackageAttachment("defaultBandwidthPackageAttachment", {
        acceleratorId: defaultAccelerator.id,
        bandwidthPackageId: defaultBandwidthPackage.id,
    });
    const defaultListener = new alicloud.ga.Listener("defaultListener", {
        acceleratorId: defaultBandwidthPackageAttachment.acceleratorId,
        listenerType: "CustomRouting",
        portRanges: [{
            fromPort: 10000,
            toPort: 16000,
        }],
    });
    const defaultCustomRoutingEndpointGroup = new alicloud.ga.CustomRoutingEndpointGroup("defaultCustomRoutingEndpointGroup", {
        acceleratorId: defaultListener.acceleratorId,
        listenerId: defaultListener.id,
        endpointGroupRegion: region,
        customRoutingEndpointGroupName: "terraform-example",
        description: "terraform-example",
    });
    const defaultCustomRoutingEndpoint = new alicloud.ga.CustomRoutingEndpoint("defaultCustomRoutingEndpoint", {
        endpointGroupId: defaultCustomRoutingEndpointGroup.id,
        endpoint: defaultSwitch.id,
        type: "PrivateSubNet",
        trafficToEndpointPolicy: "AllowCustom",
    });
    const defaultCustomRoutingEndpointGroupDestination = new alicloud.ga.CustomRoutingEndpointGroupDestination("defaultCustomRoutingEndpointGroupDestination", {
        endpointGroupId: defaultCustomRoutingEndpointGroup.id,
        protocols: ["TCP"],
        fromPort: 1,
        toPort: 10,
    });
    const defaultCustomRoutingEndpointTrafficPolicy = new alicloud.ga.CustomRoutingEndpointTrafficPolicy("defaultCustomRoutingEndpointTrafficPolicy", {
        endpointId: defaultCustomRoutingEndpoint.customRoutingEndpointId,
        address: "172.17.3.0",
        portRanges: [{
            fromPort: 1,
            toPort: 10,
        }],
    });
    
    configuration:
      region:
        type: string
        default: cn-hangzhou
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        properties:
          vpcName: terraform-example
          cidrBlock: 172.17.3.0/24
      defaultSwitch:
        type: alicloud:vpc:Switch
        properties:
          vswitchName: terraform-example
          cidrBlock: 172.17.3.0/24
          vpcId: ${defaultNetwork.id}
          zoneId: ${defaultZones.zones[0].id}
      defaultAccelerator:
        type: alicloud:ga:Accelerator
        properties:
          duration: 1
          autoUseCoupon: true
          spec: '1'
      defaultBandwidthPackage:
        type: alicloud:ga:BandwidthPackage
        properties:
          bandwidth: 100
          type: Basic
          bandwidthType: Basic
          paymentType: PayAsYouGo
          billingType: PayBy95
          ratio: 30
      defaultBandwidthPackageAttachment:
        type: alicloud:ga:BandwidthPackageAttachment
        properties:
          acceleratorId: ${defaultAccelerator.id}
          bandwidthPackageId: ${defaultBandwidthPackage.id}
      defaultListener:
        type: alicloud:ga:Listener
        properties:
          acceleratorId: ${defaultBandwidthPackageAttachment.acceleratorId}
          listenerType: CustomRouting
          portRanges:
            - fromPort: 10000
              toPort: 16000
      defaultCustomRoutingEndpointGroup:
        type: alicloud:ga:CustomRoutingEndpointGroup
        properties:
          acceleratorId: ${defaultListener.acceleratorId}
          listenerId: ${defaultListener.id}
          endpointGroupRegion: ${region}
          customRoutingEndpointGroupName: terraform-example
          description: terraform-example
      defaultCustomRoutingEndpoint:
        type: alicloud:ga:CustomRoutingEndpoint
        properties:
          endpointGroupId: ${defaultCustomRoutingEndpointGroup.id}
          endpoint: ${defaultSwitch.id}
          type: PrivateSubNet
          trafficToEndpointPolicy: AllowCustom
      defaultCustomRoutingEndpointGroupDestination:
        type: alicloud:ga:CustomRoutingEndpointGroupDestination
        properties:
          endpointGroupId: ${defaultCustomRoutingEndpointGroup.id}
          protocols:
            - TCP
          fromPort: 1
          toPort: 10
      defaultCustomRoutingEndpointTrafficPolicy:
        type: alicloud:ga:CustomRoutingEndpointTrafficPolicy
        properties:
          endpointId: ${defaultCustomRoutingEndpoint.customRoutingEndpointId}
          address: 172.17.3.0
          portRanges:
            - fromPort: 1
              toPort: 10
    variables:
      defaultZones:
        fn::invoke:
          Function: alicloud:getZones
          Arguments:
            availableResourceCreation: VSwitch
    

    Create CustomRoutingEndpointTrafficPolicy Resource

    new CustomRoutingEndpointTrafficPolicy(name: string, args: CustomRoutingEndpointTrafficPolicyArgs, opts?: CustomResourceOptions);
    @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)
    @overload
    def CustomRoutingEndpointTrafficPolicy(resource_name: str,
                                           args: CustomRoutingEndpointTrafficPolicyArgs,
                                           opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    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>
    

    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.43.1 published on Monday, Sep 11, 2023 by Pulumi