1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getGaapSecurityRules
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getGaapSecurityRules

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 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 fooGaapProxy = new tencentcloud.GaapProxy("fooGaapProxy", {
        bandwidth: 10,
        concurrent: 2,
        accessRegion: "SouthChina",
        realserverRegion: "NorthChina",
    });
    const fooGaapSecurityPolicy = new tencentcloud.GaapSecurityPolicy("fooGaapSecurityPolicy", {
        proxyId: fooGaapProxy.gaapProxyId,
        action: "ACCEPT",
    });
    const fooGaapSecurityRule = new tencentcloud.GaapSecurityRule("fooGaapSecurityRule", {
        policyId: fooGaapSecurityPolicy.gaapSecurityPolicyId,
        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_gaap_proxy = tencentcloud.GaapProxy("fooGaapProxy",
        bandwidth=10,
        concurrent=2,
        access_region="SouthChina",
        realserver_region="NorthChina")
    foo_gaap_security_policy = tencentcloud.GaapSecurityPolicy("fooGaapSecurityPolicy",
        proxy_id=foo_gaap_proxy.gaap_proxy_id,
        action="ACCEPT")
    foo_gaap_security_rule = tencentcloud.GaapSecurityRule("fooGaapSecurityRule",
        policy_id=foo_gaap_security_policy.gaap_security_policy_id,
        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 {
    		fooGaapProxy, err := tencentcloud.NewGaapProxy(ctx, "fooGaapProxy", &tencentcloud.GaapProxyArgs{
    			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, "fooGaapSecurityPolicy", &tencentcloud.GaapSecurityPolicyArgs{
    			ProxyId: fooGaapProxy.GaapProxyId,
    			Action:  pulumi.String("ACCEPT"),
    		})
    		if err != nil {
    			return err
    		}
    		fooGaapSecurityRule, err := tencentcloud.NewGaapSecurityRule(ctx, "fooGaapSecurityRule", &tencentcloud.GaapSecurityRuleArgs{
    			PolicyId: fooGaapSecurityPolicy.GaapSecurityPolicyId,
    			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 fooGaapProxy = new Tencentcloud.GaapProxy("fooGaapProxy", new()
        {
            Bandwidth = 10,
            Concurrent = 2,
            AccessRegion = "SouthChina",
            RealserverRegion = "NorthChina",
        });
    
        var fooGaapSecurityPolicy = new Tencentcloud.GaapSecurityPolicy("fooGaapSecurityPolicy", new()
        {
            ProxyId = fooGaapProxy.GaapProxyId,
            Action = "ACCEPT",
        });
    
        var fooGaapSecurityRule = new Tencentcloud.GaapSecurityRule("fooGaapSecurityRule", new()
        {
            PolicyId = fooGaapSecurityPolicy.GaapSecurityPolicyId,
            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 fooGaapProxy = new GaapProxy("fooGaapProxy", GaapProxyArgs.builder()
                .bandwidth(10)
                .concurrent(2)
                .accessRegion("SouthChina")
                .realserverRegion("NorthChina")
                .build());
    
            var fooGaapSecurityPolicy = new GaapSecurityPolicy("fooGaapSecurityPolicy", GaapSecurityPolicyArgs.builder()
                .proxyId(fooGaapProxy.gaapProxyId())
                .action("ACCEPT")
                .build());
    
            var fooGaapSecurityRule = new GaapSecurityRule("fooGaapSecurityRule", GaapSecurityRuleArgs.builder()
                .policyId(fooGaapSecurityPolicy.gaapSecurityPolicyId())
                .cidrIp("1.1.1.1")
                .action("ACCEPT")
                .protocol("TCP")
                .port("80")
                .build());
    
            final var protocol = TencentcloudFunctions.getGaapSecurityRules(GetGaapSecurityRulesArgs.builder()
                .policyId(fooGaapSecurityPolicy.gaapSecurityPolicyId())
                .protocol(fooGaapSecurityRule.protocol())
                .build());
    
        }
    }
    
    resources:
      fooGaapProxy:
        type: tencentcloud:GaapProxy
        properties:
          bandwidth: 10
          concurrent: 2
          accessRegion: SouthChina
          realserverRegion: NorthChina
      fooGaapSecurityPolicy:
        type: tencentcloud:GaapSecurityPolicy
        properties:
          proxyId: ${fooGaapProxy.gaapProxyId}
          action: ACCEPT
      fooGaapSecurityRule:
        type: tencentcloud:GaapSecurityRule
        properties:
          policyId: ${fooGaapSecurityPolicy.gaapSecurityPolicyId}
          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 dictionary

    The following arguments are supported:

    PolicyId string
    ID of the security policy to be queried.
    Action string
    Policy of the rule to be queried.
    CidrIp 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.
    ResultOutputFile string
    Used to save results.
    RuleId string
    ID of the security policy rules to be queried.
    PolicyId string
    ID of the security policy to be queried.
    Action string
    Policy of the rule to be queried.
    CidrIp 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.
    ResultOutputFile string
    Used to save results.
    RuleId string
    ID of the security policy rules to be queried.
    policyId String
    ID of the security policy to be queried.
    action String
    Policy of the rule to be queried.
    cidrIp 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.
    resultOutputFile String
    Used to save results.
    ruleId String
    ID of the security policy rules to be queried.
    policyId string
    ID of the security policy to be queried.
    action string
    Policy of the rule to be queried.
    cidrIp 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.
    resultOutputFile string
    Used to save results.
    ruleId 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_file str
    Used to save results.
    rule_id str
    ID of the security policy rules to be queried.
    policyId String
    ID of the security policy to be queried.
    action String
    Policy of the rule to be queried.
    cidrIp 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.
    resultOutputFile String
    Used to save results.
    ruleId 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.
    PolicyId string
    Rules List<GetGaapSecurityRulesRule>
    An information list of security policy rule. Each element contains the following attributes:
    Action string
    Policy of the rule.
    CidrIp 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.
    ResultOutputFile string
    RuleId string
    Id string
    ID of the security policy rule.
    PolicyId string
    Rules []GetGaapSecurityRulesRule
    An information list of security policy rule. Each element contains the following attributes:
    Action string
    Policy of the rule.
    CidrIp 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.
    ResultOutputFile string
    RuleId string
    id String
    ID of the security policy rule.
    policyId String
    rules List<GetGaapSecurityRulesRule>
    An information list of security policy rule. Each element contains the following attributes:
    action String
    Policy of the rule.
    cidrIp 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.
    resultOutputFile String
    ruleId String
    id string
    ID of the security policy rule.
    policyId string
    rules GetGaapSecurityRulesRule[]
    An information list of security policy rule. Each element contains the following attributes:
    action string
    Policy of the rule.
    cidrIp 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.
    resultOutputFile string
    ruleId string
    id str
    ID of the security policy rule.
    policy_id str
    rules Sequence[GetGaapSecurityRulesRule]
    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_file str
    rule_id str
    id String
    ID of the security policy rule.
    policyId String
    rules List<Property Map>
    An information list of security policy rule. Each element contains the following attributes:
    action String
    Policy of the rule.
    cidrIp 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.
    resultOutputFile String
    ruleId String

    Supporting Types

    GetGaapSecurityRulesRule

    Action string
    Policy of the rule to be queried.
    CidrIp 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.
    CidrIp 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.
    cidrIp 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.
    cidrIp 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.
    cidrIp 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 tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack