1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getUserAgentBlockingRule
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.getUserAgentBlockingRule

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleUserAgentBlockingRule = cloudflare.getUserAgentBlockingRule({
        zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
        uaRuleId: "372e67954025e0ba6aaa6d586b9e0b59",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_user_agent_blocking_rule = cloudflare.get_user_agent_blocking_rule(zone_id="023e105f4ecef8ad9ca31a8372d0c353",
        ua_rule_id="372e67954025e0ba6aaa6d586b9e0b59")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.LookupUserAgentBlockingRule(ctx, &cloudflare.LookupUserAgentBlockingRuleArgs{
    			ZoneId:   "023e105f4ecef8ad9ca31a8372d0c353",
    			UaRuleId: "372e67954025e0ba6aaa6d586b9e0b59",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleUserAgentBlockingRule = Cloudflare.GetUserAgentBlockingRule.Invoke(new()
        {
            ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
            UaRuleId = "372e67954025e0ba6aaa6d586b9e0b59",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.inputs.GetUserAgentBlockingRuleArgs;
    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 exampleUserAgentBlockingRule = CloudflareFunctions.getUserAgentBlockingRule(GetUserAgentBlockingRuleArgs.builder()
                .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
                .uaRuleId("372e67954025e0ba6aaa6d586b9e0b59")
                .build());
    
        }
    }
    
    variables:
      exampleUserAgentBlockingRule:
        fn::invoke:
          function: cloudflare:getUserAgentBlockingRule
          arguments:
            zoneId: 023e105f4ecef8ad9ca31a8372d0c353
            uaRuleId: 372e67954025e0ba6aaa6d586b9e0b59
    

    Using getUserAgentBlockingRule

    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 getUserAgentBlockingRule(args: GetUserAgentBlockingRuleArgs, opts?: InvokeOptions): Promise<GetUserAgentBlockingRuleResult>
    function getUserAgentBlockingRuleOutput(args: GetUserAgentBlockingRuleOutputArgs, opts?: InvokeOptions): Output<GetUserAgentBlockingRuleResult>
    def get_user_agent_blocking_rule(ua_rule_id: Optional[str] = None,
                                     zone_id: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetUserAgentBlockingRuleResult
    def get_user_agent_blocking_rule_output(ua_rule_id: Optional[pulumi.Input[str]] = None,
                                     zone_id: Optional[pulumi.Input[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetUserAgentBlockingRuleResult]
    func LookupUserAgentBlockingRule(ctx *Context, args *LookupUserAgentBlockingRuleArgs, opts ...InvokeOption) (*LookupUserAgentBlockingRuleResult, error)
    func LookupUserAgentBlockingRuleOutput(ctx *Context, args *LookupUserAgentBlockingRuleOutputArgs, opts ...InvokeOption) LookupUserAgentBlockingRuleResultOutput

    > Note: This function is named LookupUserAgentBlockingRule in the Go SDK.

    public static class GetUserAgentBlockingRule 
    {
        public static Task<GetUserAgentBlockingRuleResult> InvokeAsync(GetUserAgentBlockingRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetUserAgentBlockingRuleResult> Invoke(GetUserAgentBlockingRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUserAgentBlockingRuleResult> getUserAgentBlockingRule(GetUserAgentBlockingRuleArgs args, InvokeOptions options)
    public static Output<GetUserAgentBlockingRuleResult> getUserAgentBlockingRule(GetUserAgentBlockingRuleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getUserAgentBlockingRule:getUserAgentBlockingRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    UaRuleId string
    The unique identifier of the User Agent Blocking rule.
    ZoneId string
    Identifier
    UaRuleId string
    The unique identifier of the User Agent Blocking rule.
    ZoneId string
    Identifier
    uaRuleId String
    The unique identifier of the User Agent Blocking rule.
    zoneId String
    Identifier
    uaRuleId string
    The unique identifier of the User Agent Blocking rule.
    zoneId string
    Identifier
    ua_rule_id str
    The unique identifier of the User Agent Blocking rule.
    zone_id str
    Identifier
    uaRuleId String
    The unique identifier of the User Agent Blocking rule.
    zoneId String
    Identifier

    getUserAgentBlockingRule Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    UaRuleId string
    The unique identifier of the User Agent Blocking rule.
    ZoneId string
    Identifier
    Id string
    The provider-assigned unique ID for this managed resource.
    UaRuleId string
    The unique identifier of the User Agent Blocking rule.
    ZoneId string
    Identifier
    id String
    The provider-assigned unique ID for this managed resource.
    uaRuleId String
    The unique identifier of the User Agent Blocking rule.
    zoneId String
    Identifier
    id string
    The provider-assigned unique ID for this managed resource.
    uaRuleId string
    The unique identifier of the User Agent Blocking rule.
    zoneId string
    Identifier
    id str
    The provider-assigned unique ID for this managed resource.
    ua_rule_id str
    The unique identifier of the User Agent Blocking rule.
    zone_id str
    Identifier
    id String
    The provider-assigned unique ID for this managed resource.
    uaRuleId String
    The unique identifier of the User Agent Blocking rule.
    zoneId String
    Identifier

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi