published on Tuesday, Jun 30, 2026 by tencentcloudstack
published on Tuesday, Jun 30, 2026 by tencentcloudstack
Provides a resource to create a GA2 forwarding policy
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.Ga2GlobalAccelerator("example", {
name: "tf-example",
instanceChargeType: "POSTPAID",
description: "tf example global accelerator",
tags: {
createdBy: "Terraform",
},
});
const exampleGa2AccelerateArea = new tencentcloud.Ga2AccelerateArea("example", {
globalAcceleratorId: example.ga2GlobalAcceleratorId,
accelerateRegion: "ap-guangzhou",
bandwidth: 10,
ispType: "BGP",
ipVersion: "IPv4",
});
const exampleGa2Listener = new tencentcloud.Ga2Listener("example", {
globalAcceleratorId: exampleGa2AccelerateArea.globalAcceleratorId,
name: "tf-example-http",
protocol: "HTTP",
portRanges: {
fromPort: 90,
toPort: 90,
},
description: "tf example listener",
idleTimeout: 15,
requestTimeout: 60,
listenerType: "Standard",
xForwardedForRealIp: true,
});
const exampleGa2ForwardingPolicy = new tencentcloud.Ga2ForwardingPolicy("example", {
globalAcceleratorId: exampleGa2AccelerateArea.globalAcceleratorId,
listenerId: exampleGa2Listener.listenerId,
host: "example.com",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.Ga2GlobalAccelerator("example",
name="tf-example",
instance_charge_type="POSTPAID",
description="tf example global accelerator",
tags={
"createdBy": "Terraform",
})
example_ga2_accelerate_area = tencentcloud.Ga2AccelerateArea("example",
global_accelerator_id=example.ga2_global_accelerator_id,
accelerate_region="ap-guangzhou",
bandwidth=10,
isp_type="BGP",
ip_version="IPv4")
example_ga2_listener = tencentcloud.Ga2Listener("example",
global_accelerator_id=example_ga2_accelerate_area.global_accelerator_id,
name="tf-example-http",
protocol="HTTP",
port_ranges={
"from_port": 90,
"to_port": 90,
},
description="tf example listener",
idle_timeout=15,
request_timeout=60,
listener_type="Standard",
x_forwarded_for_real_ip=True)
example_ga2_forwarding_policy = tencentcloud.Ga2ForwardingPolicy("example",
global_accelerator_id=example_ga2_accelerate_area.global_accelerator_id,
listener_id=example_ga2_listener.listener_id,
host="example.com")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := tencentcloud.NewGa2GlobalAccelerator(ctx, "example", &tencentcloud.Ga2GlobalAcceleratorArgs{
Name: pulumi.String("tf-example"),
InstanceChargeType: pulumi.String("POSTPAID"),
Description: pulumi.String("tf example global accelerator"),
Tags: pulumi.StringMap{
"createdBy": pulumi.String("Terraform"),
},
})
if err != nil {
return err
}
exampleGa2AccelerateArea, err := tencentcloud.NewGa2AccelerateArea(ctx, "example", &tencentcloud.Ga2AccelerateAreaArgs{
GlobalAcceleratorId: example.Ga2GlobalAcceleratorId,
AccelerateRegion: pulumi.String("ap-guangzhou"),
Bandwidth: pulumi.Float64(10),
IspType: pulumi.String("BGP"),
IpVersion: pulumi.String("IPv4"),
})
if err != nil {
return err
}
exampleGa2Listener, err := tencentcloud.NewGa2Listener(ctx, "example", &tencentcloud.Ga2ListenerArgs{
GlobalAcceleratorId: exampleGa2AccelerateArea.GlobalAcceleratorId,
Name: pulumi.String("tf-example-http"),
Protocol: pulumi.String("HTTP"),
PortRanges: &tencentcloud.Ga2ListenerPortRangesArgs{
FromPort: pulumi.Float64(90),
ToPort: pulumi.Float64(90),
},
Description: pulumi.String("tf example listener"),
IdleTimeout: pulumi.Float64(15),
RequestTimeout: pulumi.Float64(60),
ListenerType: pulumi.String("Standard"),
XForwardedForRealIp: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = tencentcloud.NewGa2ForwardingPolicy(ctx, "example", &tencentcloud.Ga2ForwardingPolicyArgs{
GlobalAcceleratorId: exampleGa2AccelerateArea.GlobalAcceleratorId,
ListenerId: exampleGa2Listener.ListenerId,
Host: pulumi.String("example.com"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.Ga2GlobalAccelerator("example", new()
{
Name = "tf-example",
InstanceChargeType = "POSTPAID",
Description = "tf example global accelerator",
Tags =
{
{ "createdBy", "Terraform" },
},
});
var exampleGa2AccelerateArea = new Tencentcloud.Ga2AccelerateArea("example", new()
{
GlobalAcceleratorId = example.Ga2GlobalAcceleratorId,
AccelerateRegion = "ap-guangzhou",
Bandwidth = 10,
IspType = "BGP",
IpVersion = "IPv4",
});
var exampleGa2Listener = new Tencentcloud.Ga2Listener("example", new()
{
GlobalAcceleratorId = exampleGa2AccelerateArea.GlobalAcceleratorId,
Name = "tf-example-http",
Protocol = "HTTP",
PortRanges = new Tencentcloud.Inputs.Ga2ListenerPortRangesArgs
{
FromPort = 90,
ToPort = 90,
},
Description = "tf example listener",
IdleTimeout = 15,
RequestTimeout = 60,
ListenerType = "Standard",
XForwardedForRealIp = true,
});
var exampleGa2ForwardingPolicy = new Tencentcloud.Ga2ForwardingPolicy("example", new()
{
GlobalAcceleratorId = exampleGa2AccelerateArea.GlobalAcceleratorId,
ListenerId = exampleGa2Listener.ListenerId,
Host = "example.com",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Ga2GlobalAccelerator;
import com.pulumi.tencentcloud.Ga2GlobalAcceleratorArgs;
import com.pulumi.tencentcloud.Ga2AccelerateArea;
import com.pulumi.tencentcloud.Ga2AccelerateAreaArgs;
import com.pulumi.tencentcloud.Ga2Listener;
import com.pulumi.tencentcloud.Ga2ListenerArgs;
import com.pulumi.tencentcloud.inputs.Ga2ListenerPortRangesArgs;
import com.pulumi.tencentcloud.Ga2ForwardingPolicy;
import com.pulumi.tencentcloud.Ga2ForwardingPolicyArgs;
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) {
var example = new Ga2GlobalAccelerator("example", Ga2GlobalAcceleratorArgs.builder()
.name("tf-example")
.instanceChargeType("POSTPAID")
.description("tf example global accelerator")
.tags(Map.of("createdBy", "Terraform"))
.build());
var exampleGa2AccelerateArea = new Ga2AccelerateArea("exampleGa2AccelerateArea", Ga2AccelerateAreaArgs.builder()
.globalAcceleratorId(example.ga2GlobalAcceleratorId())
.accelerateRegion("ap-guangzhou")
.bandwidth(10.0)
.ispType("BGP")
.ipVersion("IPv4")
.build());
var exampleGa2Listener = new Ga2Listener("exampleGa2Listener", Ga2ListenerArgs.builder()
.globalAcceleratorId(exampleGa2AccelerateArea.globalAcceleratorId())
.name("tf-example-http")
.protocol("HTTP")
.portRanges(Ga2ListenerPortRangesArgs.builder()
.fromPort(90.0)
.toPort(90.0)
.build())
.description("tf example listener")
.idleTimeout(15.0)
.requestTimeout(60.0)
.listenerType("Standard")
.xForwardedForRealIp(true)
.build());
var exampleGa2ForwardingPolicy = new Ga2ForwardingPolicy("exampleGa2ForwardingPolicy", Ga2ForwardingPolicyArgs.builder()
.globalAcceleratorId(exampleGa2AccelerateArea.globalAcceleratorId())
.listenerId(exampleGa2Listener.listenerId())
.host("example.com")
.build());
}
}
resources:
example:
type: tencentcloud:Ga2GlobalAccelerator
properties:
name: tf-example
instanceChargeType: POSTPAID
description: tf example global accelerator
tags:
createdBy: Terraform
exampleGa2AccelerateArea:
type: tencentcloud:Ga2AccelerateArea
name: example
properties:
globalAcceleratorId: ${example.ga2GlobalAcceleratorId}
accelerateRegion: ap-guangzhou
bandwidth: 10
ispType: BGP
ipVersion: IPv4
exampleGa2Listener:
type: tencentcloud:Ga2Listener
name: example
properties:
globalAcceleratorId: ${exampleGa2AccelerateArea.globalAcceleratorId}
name: tf-example-http
protocol: HTTP
portRanges:
fromPort: 90
toPort: 90
description: tf example listener
idleTimeout: 15
requestTimeout: 60
listenerType: Standard
xForwardedForRealIp: true
exampleGa2ForwardingPolicy:
type: tencentcloud:Ga2ForwardingPolicy
name: example
properties:
globalAcceleratorId: ${exampleGa2AccelerateArea.globalAcceleratorId}
listenerId: ${exampleGa2Listener.listenerId}
host: example.com
Example coming soon!
Create Ga2ForwardingPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Ga2ForwardingPolicy(name: string, args: Ga2ForwardingPolicyArgs, opts?: CustomResourceOptions);@overload
def Ga2ForwardingPolicy(resource_name: str,
args: Ga2ForwardingPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Ga2ForwardingPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
global_accelerator_id: Optional[str] = None,
host: Optional[str] = None,
listener_id: Optional[str] = None,
ga2_forwarding_policy_id: Optional[str] = None,
timeouts: Optional[Ga2ForwardingPolicyTimeoutsArgs] = None)func NewGa2ForwardingPolicy(ctx *Context, name string, args Ga2ForwardingPolicyArgs, opts ...ResourceOption) (*Ga2ForwardingPolicy, error)public Ga2ForwardingPolicy(string name, Ga2ForwardingPolicyArgs args, CustomResourceOptions? opts = null)
public Ga2ForwardingPolicy(String name, Ga2ForwardingPolicyArgs args)
public Ga2ForwardingPolicy(String name, Ga2ForwardingPolicyArgs args, CustomResourceOptions options)
type: tencentcloud:Ga2ForwardingPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "tencentcloud_ga2forwardingpolicy" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args Ga2ForwardingPolicyArgs
- 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 Ga2ForwardingPolicyArgs
- 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 Ga2ForwardingPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args Ga2ForwardingPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args Ga2ForwardingPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Ga2ForwardingPolicy 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 Ga2ForwardingPolicy resource accepts the following input properties:
- Global
Accelerator stringId - Global accelerator instance ID this forwarding policy belongs to.
- Host string
- The domain/host for the forwarding policy.
- Listener
Id string - Listener ID this forwarding policy belongs to.
- Ga2Forwarding
Policy stringId - ID of the resource.
- Timeouts
Ga2Forwarding
Policy Timeouts
- Global
Accelerator stringId - Global accelerator instance ID this forwarding policy belongs to.
- Host string
- The domain/host for the forwarding policy.
- Listener
Id string - Listener ID this forwarding policy belongs to.
- Ga2Forwarding
Policy stringId - ID of the resource.
- Timeouts
Ga2Forwarding
Policy Timeouts Args
- global_
accelerator_ stringid - Global accelerator instance ID this forwarding policy belongs to.
- host string
- The domain/host for the forwarding policy.
- listener_
id string - Listener ID this forwarding policy belongs to.
- ga2_
forwarding_ stringpolicy_ id - ID of the resource.
- timeouts object
- global
Accelerator StringId - Global accelerator instance ID this forwarding policy belongs to.
- host String
- The domain/host for the forwarding policy.
- listener
Id String - Listener ID this forwarding policy belongs to.
- ga2Forwarding
Policy StringId - ID of the resource.
- timeouts
Ga2Forwarding
Policy Timeouts
- global
Accelerator stringId - Global accelerator instance ID this forwarding policy belongs to.
- host string
- The domain/host for the forwarding policy.
- listener
Id string - Listener ID this forwarding policy belongs to.
- ga2Forwarding
Policy stringId - ID of the resource.
- timeouts
Ga2Forwarding
Policy Timeouts
- global_
accelerator_ strid - Global accelerator instance ID this forwarding policy belongs to.
- host str
- The domain/host for the forwarding policy.
- listener_
id str - Listener ID this forwarding policy belongs to.
- ga2_
forwarding_ strpolicy_ id - ID of the resource.
- timeouts
Ga2Forwarding
Policy Timeouts Args
- global
Accelerator StringId - Global accelerator instance ID this forwarding policy belongs to.
- host String
- The domain/host for the forwarding policy.
- listener
Id String - Listener ID this forwarding policy belongs to.
- ga2Forwarding
Policy StringId - ID of the resource.
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the Ga2ForwardingPolicy resource produces the following output properties:
- Default
Host boolFlag - Whether this is the default host policy for the listener.
- Forwarding
Policy stringId - Forwarding policy ID.
- Id string
- The provider-assigned unique ID for this managed resource.
- Default
Host boolFlag - Whether this is the default host policy for the listener.
- Forwarding
Policy stringId - Forwarding policy ID.
- Id string
- The provider-assigned unique ID for this managed resource.
- default_
host_ boolflag - Whether this is the default host policy for the listener.
- forwarding_
policy_ stringid - Forwarding policy ID.
- id string
- The provider-assigned unique ID for this managed resource.
- default
Host BooleanFlag - Whether this is the default host policy for the listener.
- forwarding
Policy StringId - Forwarding policy ID.
- id String
- The provider-assigned unique ID for this managed resource.
- default
Host booleanFlag - Whether this is the default host policy for the listener.
- forwarding
Policy stringId - Forwarding policy ID.
- id string
- The provider-assigned unique ID for this managed resource.
- default_
host_ boolflag - Whether this is the default host policy for the listener.
- forwarding_
policy_ strid - Forwarding policy ID.
- id str
- The provider-assigned unique ID for this managed resource.
- default
Host BooleanFlag - Whether this is the default host policy for the listener.
- forwarding
Policy StringId - Forwarding policy ID.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Ga2ForwardingPolicy Resource
Get an existing Ga2ForwardingPolicy 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?: Ga2ForwardingPolicyState, opts?: CustomResourceOptions): Ga2ForwardingPolicy@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
default_host_flag: Optional[bool] = None,
forwarding_policy_id: Optional[str] = None,
ga2_forwarding_policy_id: Optional[str] = None,
global_accelerator_id: Optional[str] = None,
host: Optional[str] = None,
listener_id: Optional[str] = None,
timeouts: Optional[Ga2ForwardingPolicyTimeoutsArgs] = None) -> Ga2ForwardingPolicyfunc GetGa2ForwardingPolicy(ctx *Context, name string, id IDInput, state *Ga2ForwardingPolicyState, opts ...ResourceOption) (*Ga2ForwardingPolicy, error)public static Ga2ForwardingPolicy Get(string name, Input<string> id, Ga2ForwardingPolicyState? state, CustomResourceOptions? opts = null)public static Ga2ForwardingPolicy get(String name, Output<String> id, Ga2ForwardingPolicyState state, CustomResourceOptions options)resources: _: type: tencentcloud:Ga2ForwardingPolicy get: id: ${id}import {
to = tencentcloud_ga2forwardingpolicy.example
id = "${id}"
}
- 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.
- Default
Host boolFlag - Whether this is the default host policy for the listener.
- Forwarding
Policy stringId - Forwarding policy ID.
- Ga2Forwarding
Policy stringId - ID of the resource.
- Global
Accelerator stringId - Global accelerator instance ID this forwarding policy belongs to.
- Host string
- The domain/host for the forwarding policy.
- Listener
Id string - Listener ID this forwarding policy belongs to.
- Timeouts
Ga2Forwarding
Policy Timeouts
- Default
Host boolFlag - Whether this is the default host policy for the listener.
- Forwarding
Policy stringId - Forwarding policy ID.
- Ga2Forwarding
Policy stringId - ID of the resource.
- Global
Accelerator stringId - Global accelerator instance ID this forwarding policy belongs to.
- Host string
- The domain/host for the forwarding policy.
- Listener
Id string - Listener ID this forwarding policy belongs to.
- Timeouts
Ga2Forwarding
Policy Timeouts Args
- default_
host_ boolflag - Whether this is the default host policy for the listener.
- forwarding_
policy_ stringid - Forwarding policy ID.
- ga2_
forwarding_ stringpolicy_ id - ID of the resource.
- global_
accelerator_ stringid - Global accelerator instance ID this forwarding policy belongs to.
- host string
- The domain/host for the forwarding policy.
- listener_
id string - Listener ID this forwarding policy belongs to.
- timeouts object
- default
Host BooleanFlag - Whether this is the default host policy for the listener.
- forwarding
Policy StringId - Forwarding policy ID.
- ga2Forwarding
Policy StringId - ID of the resource.
- global
Accelerator StringId - Global accelerator instance ID this forwarding policy belongs to.
- host String
- The domain/host for the forwarding policy.
- listener
Id String - Listener ID this forwarding policy belongs to.
- timeouts
Ga2Forwarding
Policy Timeouts
- default
Host booleanFlag - Whether this is the default host policy for the listener.
- forwarding
Policy stringId - Forwarding policy ID.
- ga2Forwarding
Policy stringId - ID of the resource.
- global
Accelerator stringId - Global accelerator instance ID this forwarding policy belongs to.
- host string
- The domain/host for the forwarding policy.
- listener
Id string - Listener ID this forwarding policy belongs to.
- timeouts
Ga2Forwarding
Policy Timeouts
- default_
host_ boolflag - Whether this is the default host policy for the listener.
- forwarding_
policy_ strid - Forwarding policy ID.
- ga2_
forwarding_ strpolicy_ id - ID of the resource.
- global_
accelerator_ strid - Global accelerator instance ID this forwarding policy belongs to.
- host str
- The domain/host for the forwarding policy.
- listener_
id str - Listener ID this forwarding policy belongs to.
- timeouts
Ga2Forwarding
Policy Timeouts Args
- default
Host BooleanFlag - Whether this is the default host policy for the listener.
- forwarding
Policy StringId - Forwarding policy ID.
- ga2Forwarding
Policy StringId - ID of the resource.
- global
Accelerator StringId - Global accelerator instance ID this forwarding policy belongs to.
- host String
- The domain/host for the forwarding policy.
- listener
Id String - Listener ID this forwarding policy belongs to.
- timeouts Property Map
Supporting Types
Ga2ForwardingPolicyTimeouts, Ga2ForwardingPolicyTimeoutsArgs
Import
GA2 forwarding policy can be imported using the composite id <global_accelerator_id>#<listener_id>#<forwarding_policy_id>, e.g.
$ pulumi import tencentcloud:index/ga2ForwardingPolicy:Ga2ForwardingPolicy example ga-jnyfyyss#lsr-hzht200v#dm-kvassops
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
published on Tuesday, Jun 30, 2026 by tencentcloudstack