1. Packages
  2. Fastly Provider
  3. API Docs
  4. getNgwafWorkspaceRules
Fastly v11.1.0 published on Wednesday, Nov 5, 2025 by Pulumi

fastly.getNgwafWorkspaceRules

Get Started
fastly logo
Fastly v11.1.0 published on Wednesday, Nov 5, 2025 by Pulumi

    Use this data source to get a Fastly Next-Gen WAF Workspace Rule.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fastly from "@pulumi/fastly";
    
    const workspaceRules = fastly.getNgwafWorkspaceRules({
        workspaceId: example.id,
    });
    export const fastlyNgwafWorkspaceRulesAll = workspaceRules;
    
    import pulumi
    import pulumi_fastly as fastly
    
    workspace_rules = fastly.get_ngwaf_workspace_rules(workspace_id=example["id"])
    pulumi.export("fastlyNgwafWorkspaceRulesAll", workspace_rules)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-fastly/sdk/v11/go/fastly"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		workspaceRules, err := fastly.GetNgwafWorkspaceRules(ctx, &fastly.GetNgwafWorkspaceRulesArgs{
    			WorkspaceId: example.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("fastlyNgwafWorkspaceRulesAll", workspaceRules)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fastly = Pulumi.Fastly;
    
    return await Deployment.RunAsync(() => 
    {
        var workspaceRules = Fastly.GetNgwafWorkspaceRules.Invoke(new()
        {
            WorkspaceId = example.Id,
        });
    
        return new Dictionary<string, object?>
        {
            ["fastlyNgwafWorkspaceRulesAll"] = workspaceRules,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.fastly.FastlyFunctions;
    import com.pulumi.fastly.inputs.GetNgwafWorkspaceRulesArgs;
    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 workspaceRules = FastlyFunctions.getNgwafWorkspaceRules(GetNgwafWorkspaceRulesArgs.builder()
                .workspaceId(example.id())
                .build());
    
            ctx.export("fastlyNgwafWorkspaceRulesAll", workspaceRules);
        }
    }
    
    variables:
      workspaceRules:
        fn::invoke:
          function: fastly:getNgwafWorkspaceRules
          arguments:
            workspaceId: ${example.id}
    outputs:
      fastlyNgwafWorkspaceRulesAll: ${workspaceRules}
    

    Using getNgwafWorkspaceRules

    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 getNgwafWorkspaceRules(args: GetNgwafWorkspaceRulesArgs, opts?: InvokeOptions): Promise<GetNgwafWorkspaceRulesResult>
    function getNgwafWorkspaceRulesOutput(args: GetNgwafWorkspaceRulesOutputArgs, opts?: InvokeOptions): Output<GetNgwafWorkspaceRulesResult>
    def get_ngwaf_workspace_rules(workspace_id: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetNgwafWorkspaceRulesResult
    def get_ngwaf_workspace_rules_output(workspace_id: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetNgwafWorkspaceRulesResult]
    func GetNgwafWorkspaceRules(ctx *Context, args *GetNgwafWorkspaceRulesArgs, opts ...InvokeOption) (*GetNgwafWorkspaceRulesResult, error)
    func GetNgwafWorkspaceRulesOutput(ctx *Context, args *GetNgwafWorkspaceRulesOutputArgs, opts ...InvokeOption) GetNgwafWorkspaceRulesResultOutput

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

    public static class GetNgwafWorkspaceRules 
    {
        public static Task<GetNgwafWorkspaceRulesResult> InvokeAsync(GetNgwafWorkspaceRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetNgwafWorkspaceRulesResult> Invoke(GetNgwafWorkspaceRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNgwafWorkspaceRulesResult> getNgwafWorkspaceRules(GetNgwafWorkspaceRulesArgs args, InvokeOptions options)
    public static Output<GetNgwafWorkspaceRulesResult> getNgwafWorkspaceRules(GetNgwafWorkspaceRulesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: fastly:index/getNgwafWorkspaceRules:getNgwafWorkspaceRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    WorkspaceId string
    The ID of the workspace.
    WorkspaceId string
    The ID of the workspace.
    workspaceId String
    The ID of the workspace.
    workspaceId string
    The ID of the workspace.
    workspace_id str
    The ID of the workspace.
    workspaceId String
    The ID of the workspace.

    getNgwafWorkspaceRules Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Rules List<GetNgwafWorkspaceRulesRule>
    The list of rules.
    WorkspaceId string
    The ID of the workspace.
    Id string
    The provider-assigned unique ID for this managed resource.
    Rules []GetNgwafWorkspaceRulesRule
    The list of rules.
    WorkspaceId string
    The ID of the workspace.
    id String
    The provider-assigned unique ID for this managed resource.
    rules List<GetNgwafWorkspaceRulesRule>
    The list of rules.
    workspaceId String
    The ID of the workspace.
    id string
    The provider-assigned unique ID for this managed resource.
    rules GetNgwafWorkspaceRulesRule[]
    The list of rules.
    workspaceId string
    The ID of the workspace.
    id str
    The provider-assigned unique ID for this managed resource.
    rules Sequence[GetNgwafWorkspaceRulesRule]
    The list of rules.
    workspace_id str
    The ID of the workspace.
    id String
    The provider-assigned unique ID for this managed resource.
    rules List<Property Map>
    The list of rules.
    workspaceId String
    The ID of the workspace.

    Supporting Types

    GetNgwafWorkspaceRulesRule

    CreatedAt string
    The date and time in ISO 8601 format when the rule was created.
    Description string
    The description of the rule.
    Enabled bool
    Whether the rule is currently enabled.
    Id string
    The ID of the rule.
    Type string
    The type of the rule.
    UpdatedAt string
    The date and time in ISO 8601 format when the rule was last updated.
    CreatedAt string
    The date and time in ISO 8601 format when the rule was created.
    Description string
    The description of the rule.
    Enabled bool
    Whether the rule is currently enabled.
    Id string
    The ID of the rule.
    Type string
    The type of the rule.
    UpdatedAt string
    The date and time in ISO 8601 format when the rule was last updated.
    createdAt String
    The date and time in ISO 8601 format when the rule was created.
    description String
    The description of the rule.
    enabled Boolean
    Whether the rule is currently enabled.
    id String
    The ID of the rule.
    type String
    The type of the rule.
    updatedAt String
    The date and time in ISO 8601 format when the rule was last updated.
    createdAt string
    The date and time in ISO 8601 format when the rule was created.
    description string
    The description of the rule.
    enabled boolean
    Whether the rule is currently enabled.
    id string
    The ID of the rule.
    type string
    The type of the rule.
    updatedAt string
    The date and time in ISO 8601 format when the rule was last updated.
    created_at str
    The date and time in ISO 8601 format when the rule was created.
    description str
    The description of the rule.
    enabled bool
    Whether the rule is currently enabled.
    id str
    The ID of the rule.
    type str
    The type of the rule.
    updated_at str
    The date and time in ISO 8601 format when the rule was last updated.
    createdAt String
    The date and time in ISO 8601 format when the rule was created.
    description String
    The description of the rule.
    enabled Boolean
    Whether the rule is currently enabled.
    id String
    The ID of the rule.
    type String
    The type of the rule.
    updatedAt String
    The date and time in ISO 8601 format when the rule was last updated.

    Package Details

    Repository
    Fastly pulumi/pulumi-fastly
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the fastly Terraform Provider.
    fastly logo
    Fastly v11.1.0 published on Wednesday, Nov 5, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate