tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack
tencentcloud.getGaapSecurityRules
Start a Neo task
Explain and create a tencentcloud.getGaapSecurityRules resource
tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack
Use this data source to query security policy rule.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const foo = new tencentcloud.GaapProxy("foo", {
name: "ci-test-gaap-proxy",
bandwidth: 10,
concurrent: 2,
accessRegion: "SouthChina",
realserverRegion: "NorthChina",
});
const fooGaapSecurityPolicy = new tencentcloud.GaapSecurityPolicy("foo", {
proxyId: foo.gaapProxyId,
action: "ACCEPT",
});
const fooGaapSecurityRule = new tencentcloud.GaapSecurityRule("foo", {
policyId: fooGaapSecurityPolicy.gaapSecurityPolicyId,
name: "ci-test-gaap-s-rule",
cidrIp: "1.1.1.1",
action: "ACCEPT",
protocol: "TCP",
port: "80",
});
const protocol = pulumi.all([fooGaapSecurityPolicy.gaapSecurityPolicyId, fooGaapSecurityRule.protocol]).apply(([gaapSecurityPolicyId, protocol]) => tencentcloud.getGaapSecurityRulesOutput({
policyId: gaapSecurityPolicyId,
protocol: protocol,
}));
import pulumi
import pulumi_tencentcloud as tencentcloud
foo = tencentcloud.GaapProxy("foo",
name="ci-test-gaap-proxy",
bandwidth=10,
concurrent=2,
access_region="SouthChina",
realserver_region="NorthChina")
foo_gaap_security_policy = tencentcloud.GaapSecurityPolicy("foo",
proxy_id=foo.gaap_proxy_id,
action="ACCEPT")
foo_gaap_security_rule = tencentcloud.GaapSecurityRule("foo",
policy_id=foo_gaap_security_policy.gaap_security_policy_id,
name="ci-test-gaap-s-rule",
cidr_ip="1.1.1.1",
action="ACCEPT",
protocol="TCP",
port="80")
protocol = pulumi.Output.all(
gaap_security_policy_id=foo_gaap_security_policy.gaap_security_policy_id,
protocol=foo_gaap_security_rule.protocol
).apply(lambda resolved_outputs: tencentcloud.get_gaap_security_rules_output(policy_id=resolved_outputs['gaap_security_policy_id'],
protocol=resolved_outputs['protocol']))
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 {
foo, err := tencentcloud.NewGaapProxy(ctx, "foo", &tencentcloud.GaapProxyArgs{
Name: pulumi.String("ci-test-gaap-proxy"),
Bandwidth: pulumi.Float64(10),
Concurrent: pulumi.Float64(2),
AccessRegion: pulumi.String("SouthChina"),
RealserverRegion: pulumi.String("NorthChina"),
})
if err != nil {
return err
}
fooGaapSecurityPolicy, err := tencentcloud.NewGaapSecurityPolicy(ctx, "foo", &tencentcloud.GaapSecurityPolicyArgs{
ProxyId: foo.GaapProxyId,
Action: pulumi.String("ACCEPT"),
})
if err != nil {
return err
}
fooGaapSecurityRule, err := tencentcloud.NewGaapSecurityRule(ctx, "foo", &tencentcloud.GaapSecurityRuleArgs{
PolicyId: fooGaapSecurityPolicy.GaapSecurityPolicyId,
Name: pulumi.String("ci-test-gaap-s-rule"),
CidrIp: pulumi.String("1.1.1.1"),
Action: pulumi.String("ACCEPT"),
Protocol: pulumi.String("TCP"),
Port: pulumi.String("80"),
})
if err != nil {
return err
}
_ = pulumi.All(fooGaapSecurityPolicy.GaapSecurityPolicyId, fooGaapSecurityRule.Protocol).ApplyT(func(_args []interface{}) (tencentcloud.GetGaapSecurityRulesResult, error) {
gaapSecurityPolicyId := _args[0].(string)
protocol := _args[1].(*string)
return tencentcloud.GetGaapSecurityRulesResult(interface{}(tencentcloud.GetGaapSecurityRulesOutput(ctx, tencentcloud.GetGaapSecurityRulesOutputArgs{
PolicyId: gaapSecurityPolicyId,
Protocol: protocol,
}, nil))), nil
}).(tencentcloud.GetGaapSecurityRulesResultOutput)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var foo = new Tencentcloud.GaapProxy("foo", new()
{
Name = "ci-test-gaap-proxy",
Bandwidth = 10,
Concurrent = 2,
AccessRegion = "SouthChina",
RealserverRegion = "NorthChina",
});
var fooGaapSecurityPolicy = new Tencentcloud.GaapSecurityPolicy("foo", new()
{
ProxyId = foo.GaapProxyId,
Action = "ACCEPT",
});
var fooGaapSecurityRule = new Tencentcloud.GaapSecurityRule("foo", new()
{
PolicyId = fooGaapSecurityPolicy.GaapSecurityPolicyId,
Name = "ci-test-gaap-s-rule",
CidrIp = "1.1.1.1",
Action = "ACCEPT",
Protocol = "TCP",
Port = "80",
});
var protocol = Tencentcloud.GetGaapSecurityRules.Invoke(new()
{
PolicyId = fooGaapSecurityPolicy.GaapSecurityPolicyId,
Protocol = fooGaapSecurityRule.Protocol,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.GaapProxy;
import com.pulumi.tencentcloud.GaapProxyArgs;
import com.pulumi.tencentcloud.GaapSecurityPolicy;
import com.pulumi.tencentcloud.GaapSecurityPolicyArgs;
import com.pulumi.tencentcloud.GaapSecurityRule;
import com.pulumi.tencentcloud.GaapSecurityRuleArgs;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetGaapSecurityRulesArgs;
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 foo = new GaapProxy("foo", GaapProxyArgs.builder()
.name("ci-test-gaap-proxy")
.bandwidth(10.0)
.concurrent(2.0)
.accessRegion("SouthChina")
.realserverRegion("NorthChina")
.build());
var fooGaapSecurityPolicy = new GaapSecurityPolicy("fooGaapSecurityPolicy", GaapSecurityPolicyArgs.builder()
.proxyId(foo.gaapProxyId())
.action("ACCEPT")
.build());
var fooGaapSecurityRule = new GaapSecurityRule("fooGaapSecurityRule", GaapSecurityRuleArgs.builder()
.policyId(fooGaapSecurityPolicy.gaapSecurityPolicyId())
.name("ci-test-gaap-s-rule")
.cidrIp("1.1.1.1")
.action("ACCEPT")
.protocol("TCP")
.port("80")
.build());
final var protocol = Output.tuple(fooGaapSecurityPolicy.gaapSecurityPolicyId(), fooGaapSecurityRule.protocol()).applyValue(values -> {
var gaapSecurityPolicyId = values.t1;
var protocol = values.t2;
return TencentcloudFunctions.getGaapSecurityRules(GetGaapSecurityRulesArgs.builder()
.policyId(gaapSecurityPolicyId)
.protocol(protocol)
.build());
});
}
}
resources:
foo:
type: tencentcloud:GaapProxy
properties:
name: ci-test-gaap-proxy
bandwidth: 10
concurrent: 2
accessRegion: SouthChina
realserverRegion: NorthChina
fooGaapSecurityPolicy:
type: tencentcloud:GaapSecurityPolicy
name: foo
properties:
proxyId: ${foo.gaapProxyId}
action: ACCEPT
fooGaapSecurityRule:
type: tencentcloud:GaapSecurityRule
name: foo
properties:
policyId: ${fooGaapSecurityPolicy.gaapSecurityPolicyId}
name: ci-test-gaap-s-rule
cidrIp: 1.1.1.1
action: ACCEPT
protocol: TCP
port: '80'
variables:
protocol:
fn::invoke:
function: tencentcloud:getGaapSecurityRules
arguments:
policyId: ${fooGaapSecurityPolicy.gaapSecurityPolicyId}
protocol: ${fooGaapSecurityRule.protocol}
Using getGaapSecurityRules
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getGaapSecurityRules(args: GetGaapSecurityRulesArgs, opts?: InvokeOptions): Promise<GetGaapSecurityRulesResult>
function getGaapSecurityRulesOutput(args: GetGaapSecurityRulesOutputArgs, opts?: InvokeOptions): Output<GetGaapSecurityRulesResult>def get_gaap_security_rules(action: Optional[str] = None,
cidr_ip: Optional[str] = None,
id: Optional[str] = None,
name: Optional[str] = None,
policy_id: Optional[str] = None,
port: Optional[str] = None,
protocol: Optional[str] = None,
result_output_file: Optional[str] = None,
rule_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetGaapSecurityRulesResult
def get_gaap_security_rules_output(action: Optional[pulumi.Input[str]] = None,
cidr_ip: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
policy_id: Optional[pulumi.Input[str]] = None,
port: Optional[pulumi.Input[str]] = None,
protocol: Optional[pulumi.Input[str]] = None,
result_output_file: Optional[pulumi.Input[str]] = None,
rule_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetGaapSecurityRulesResult]func GetGaapSecurityRules(ctx *Context, args *GetGaapSecurityRulesArgs, opts ...InvokeOption) (*GetGaapSecurityRulesResult, error)
func GetGaapSecurityRulesOutput(ctx *Context, args *GetGaapSecurityRulesOutputArgs, opts ...InvokeOption) GetGaapSecurityRulesResultOutput> Note: This function is named GetGaapSecurityRules in the Go SDK.
public static class GetGaapSecurityRules
{
public static Task<GetGaapSecurityRulesResult> InvokeAsync(GetGaapSecurityRulesArgs args, InvokeOptions? opts = null)
public static Output<GetGaapSecurityRulesResult> Invoke(GetGaapSecurityRulesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetGaapSecurityRulesResult> getGaapSecurityRules(GetGaapSecurityRulesArgs args, InvokeOptions options)
public static Output<GetGaapSecurityRulesResult> getGaapSecurityRules(GetGaapSecurityRulesArgs args, InvokeOptions options)
fn::invoke:
function: tencentcloud:index/getGaapSecurityRules:getGaapSecurityRules
arguments:
# arguments dictionaryThe following arguments are supported:
- Policy
Id string - ID of the security policy to be queried.
- Action string
- Policy of the rule to be queried.
- Cidr
Ip string - A network address block of the request source to be queried.
- Id string
- ID of the security policy rule.
- Name string
- Name of the security policy rule to be queried.
- Port string
- Port of the security policy rule to be queried.
- Protocol string
- Protocol of the security policy rule to be queried.
- Result
Output stringFile - Used to save results.
- Rule
Id string - ID of the security policy rules to be queried.
- Policy
Id string - ID of the security policy to be queried.
- Action string
- Policy of the rule to be queried.
- Cidr
Ip string - A network address block of the request source to be queried.
- Id string
- ID of the security policy rule.
- Name string
- Name of the security policy rule to be queried.
- Port string
- Port of the security policy rule to be queried.
- Protocol string
- Protocol of the security policy rule to be queried.
- Result
Output stringFile - Used to save results.
- Rule
Id string - ID of the security policy rules to be queried.
- policy
Id String - ID of the security policy to be queried.
- action String
- Policy of the rule to be queried.
- cidr
Ip String - A network address block of the request source to be queried.
- id String
- ID of the security policy rule.
- name String
- Name of the security policy rule to be queried.
- port String
- Port of the security policy rule to be queried.
- protocol String
- Protocol of the security policy rule to be queried.
- result
Output StringFile - Used to save results.
- rule
Id String - ID of the security policy rules to be queried.
- policy
Id string - ID of the security policy to be queried.
- action string
- Policy of the rule to be queried.
- cidr
Ip string - A network address block of the request source to be queried.
- id string
- ID of the security policy rule.
- name string
- Name of the security policy rule to be queried.
- port string
- Port of the security policy rule to be queried.
- protocol string
- Protocol of the security policy rule to be queried.
- result
Output stringFile - Used to save results.
- rule
Id string - ID of the security policy rules to be queried.
- policy_
id str - ID of the security policy to be queried.
- action str
- Policy of the rule to be queried.
- cidr_
ip str - A network address block of the request source to be queried.
- id str
- ID of the security policy rule.
- name str
- Name of the security policy rule to be queried.
- port str
- Port of the security policy rule to be queried.
- protocol str
- Protocol of the security policy rule to be queried.
- result_
output_ strfile - Used to save results.
- rule_
id str - ID of the security policy rules to be queried.
- policy
Id String - ID of the security policy to be queried.
- action String
- Policy of the rule to be queried.
- cidr
Ip String - A network address block of the request source to be queried.
- id String
- ID of the security policy rule.
- name String
- Name of the security policy rule to be queried.
- port String
- Port of the security policy rule to be queried.
- protocol String
- Protocol of the security policy rule to be queried.
- result
Output StringFile - Used to save results.
- rule
Id String - ID of the security policy rules to be queried.
getGaapSecurityRules Result
The following output properties are available:
- Id string
- ID of the security policy rule.
- Policy
Id string - Rules
List<Get
Gaap Security Rules Rule> - An information list of security policy rule. Each element contains the following attributes:
- Action string
- Policy of the rule.
- Cidr
Ip string - A network address block of the request source.
- Name string
- Name of the security policy rule.
- Port string
- Port of the security policy rule.
- Protocol string
- Protocol of the security policy rule.
- Result
Output stringFile - Rule
Id string
- Id string
- ID of the security policy rule.
- Policy
Id string - Rules
[]Get
Gaap Security Rules Rule - An information list of security policy rule. Each element contains the following attributes:
- Action string
- Policy of the rule.
- Cidr
Ip string - A network address block of the request source.
- Name string
- Name of the security policy rule.
- Port string
- Port of the security policy rule.
- Protocol string
- Protocol of the security policy rule.
- Result
Output stringFile - Rule
Id string
- id String
- ID of the security policy rule.
- policy
Id String - rules
List<Get
Gaap Security Rules Rule> - An information list of security policy rule. Each element contains the following attributes:
- action String
- Policy of the rule.
- cidr
Ip String - A network address block of the request source.
- name String
- Name of the security policy rule.
- port String
- Port of the security policy rule.
- protocol String
- Protocol of the security policy rule.
- result
Output StringFile - rule
Id String
- id string
- ID of the security policy rule.
- policy
Id string - rules
Get
Gaap Security Rules Rule[] - An information list of security policy rule. Each element contains the following attributes:
- action string
- Policy of the rule.
- cidr
Ip string - A network address block of the request source.
- name string
- Name of the security policy rule.
- port string
- Port of the security policy rule.
- protocol string
- Protocol of the security policy rule.
- result
Output stringFile - rule
Id string
- id str
- ID of the security policy rule.
- policy_
id str - rules
Sequence[Get
Gaap Security Rules Rule] - An information list of security policy rule. Each element contains the following attributes:
- action str
- Policy of the rule.
- cidr_
ip str - A network address block of the request source.
- name str
- Name of the security policy rule.
- port str
- Port of the security policy rule.
- protocol str
- Protocol of the security policy rule.
- result_
output_ strfile - rule_
id str
- id String
- ID of the security policy rule.
- policy
Id String - rules List<Property Map>
- An information list of security policy rule. Each element contains the following attributes:
- action String
- Policy of the rule.
- cidr
Ip String - A network address block of the request source.
- name String
- Name of the security policy rule.
- port String
- Port of the security policy rule.
- protocol String
- Protocol of the security policy rule.
- result
Output StringFile - rule
Id String
Supporting Types
GetGaapSecurityRulesRule
- Action string
- Policy of the rule to be queried.
- Cidr
Ip string - A network address block of the request source to be queried.
- Id string
- ID of the security policy rule.
- Name string
- Name of the security policy rule to be queried.
- Port string
- Port of the security policy rule to be queried.
- Protocol string
- Protocol of the security policy rule to be queried.
- Action string
- Policy of the rule to be queried.
- Cidr
Ip string - A network address block of the request source to be queried.
- Id string
- ID of the security policy rule.
- Name string
- Name of the security policy rule to be queried.
- Port string
- Port of the security policy rule to be queried.
- Protocol string
- Protocol of the security policy rule to be queried.
- action String
- Policy of the rule to be queried.
- cidr
Ip String - A network address block of the request source to be queried.
- id String
- ID of the security policy rule.
- name String
- Name of the security policy rule to be queried.
- port String
- Port of the security policy rule to be queried.
- protocol String
- Protocol of the security policy rule to be queried.
- action string
- Policy of the rule to be queried.
- cidr
Ip string - A network address block of the request source to be queried.
- id string
- ID of the security policy rule.
- name string
- Name of the security policy rule to be queried.
- port string
- Port of the security policy rule to be queried.
- protocol string
- Protocol of the security policy rule to be queried.
- action str
- Policy of the rule to be queried.
- cidr_
ip str - A network address block of the request source to be queried.
- id str
- ID of the security policy rule.
- name str
- Name of the security policy rule to be queried.
- port str
- Port of the security policy rule to be queried.
- protocol str
- Protocol of the security policy rule to be queried.
- action String
- Policy of the rule to be queried.
- cidr
Ip String - A network address block of the request source to be queried.
- id String
- ID of the security policy rule.
- name String
- Name of the security policy rule to be queried.
- port String
- Port of the security policy rule to be queried.
- protocol String
- Protocol of the security policy rule to be queried.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack
