1. Packages
  2. AWS
  3. API Docs
  4. networkfirewall
  5. getFirewallPolicy
AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi

aws.networkfirewall.getFirewallPolicy

Explore with Pulumi AI

aws logo
AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi

    Retrieve information about a firewall policy.

    Example Usage

    Find firewall policy by name

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.networkfirewall.getFirewallPolicy({
        name: firewallPolicyName,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.networkfirewall.get_firewall_policy(name=firewall_policy_name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkfirewall"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := networkfirewall.LookupFirewallPolicy(ctx, &networkfirewall.LookupFirewallPolicyArgs{
    			Name: pulumi.StringRef(firewallPolicyName),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.NetworkFirewall.GetFirewallPolicy.Invoke(new()
        {
            Name = firewallPolicyName,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.networkfirewall.NetworkfirewallFunctions;
    import com.pulumi.aws.networkfirewall.inputs.GetFirewallPolicyArgs;
    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 example = NetworkfirewallFunctions.getFirewallPolicy(GetFirewallPolicyArgs.builder()
                .name(firewallPolicyName)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:networkfirewall:getFirewallPolicy
          Arguments:
            name: ${firewallPolicyName}
    

    Find firewall policy by ARN

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.networkfirewall.getFirewallPolicy({
        arn: firewallPolicyArn,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.networkfirewall.get_firewall_policy(arn=firewall_policy_arn)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkfirewall"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := networkfirewall.LookupFirewallPolicy(ctx, &networkfirewall.LookupFirewallPolicyArgs{
    			Arn: pulumi.StringRef(firewallPolicyArn),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.NetworkFirewall.GetFirewallPolicy.Invoke(new()
        {
            Arn = firewallPolicyArn,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.networkfirewall.NetworkfirewallFunctions;
    import com.pulumi.aws.networkfirewall.inputs.GetFirewallPolicyArgs;
    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 example = NetworkfirewallFunctions.getFirewallPolicy(GetFirewallPolicyArgs.builder()
                .arn(firewallPolicyArn)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:networkfirewall:getFirewallPolicy
          Arguments:
            arn: ${firewallPolicyArn}
    

    Find firewall policy by name and ARN

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.networkfirewall.getFirewallPolicy({
        arn: firewallPolicyArn,
        name: firewallPolicyName,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.networkfirewall.get_firewall_policy(arn=firewall_policy_arn,
        name=firewall_policy_name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkfirewall"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := networkfirewall.LookupFirewallPolicy(ctx, &networkfirewall.LookupFirewallPolicyArgs{
    			Arn:  pulumi.StringRef(firewallPolicyArn),
    			Name: pulumi.StringRef(firewallPolicyName),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.NetworkFirewall.GetFirewallPolicy.Invoke(new()
        {
            Arn = firewallPolicyArn,
            Name = firewallPolicyName,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.networkfirewall.NetworkfirewallFunctions;
    import com.pulumi.aws.networkfirewall.inputs.GetFirewallPolicyArgs;
    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 example = NetworkfirewallFunctions.getFirewallPolicy(GetFirewallPolicyArgs.builder()
                .arn(firewallPolicyArn)
                .name(firewallPolicyName)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:networkfirewall:getFirewallPolicy
          Arguments:
            arn: ${firewallPolicyArn}
            name: ${firewallPolicyName}
    

    AWS Network Firewall does not allow multiple firewall policies with the same name to be created in an account. It is possible, however, to have multiple firewall policies available in a single account with identical name values but distinct arn values, e.g. firewall policies shared via a [Resource Access Manager (RAM) share][1]. In that case specifying arn, or name and arn, is recommended.

    Note: If there are multiple firewall policies in an account with the same name, and arn is not specified, the default behavior will return the firewall policy with name that was created in the account.

    Using getFirewallPolicy

    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 getFirewallPolicy(args: GetFirewallPolicyArgs, opts?: InvokeOptions): Promise<GetFirewallPolicyResult>
    function getFirewallPolicyOutput(args: GetFirewallPolicyOutputArgs, opts?: InvokeOptions): Output<GetFirewallPolicyResult>
    def get_firewall_policy(arn: Optional[str] = None,
                            name: Optional[str] = None,
                            tags: Optional[Mapping[str, str]] = None,
                            opts: Optional[InvokeOptions] = None) -> GetFirewallPolicyResult
    def get_firewall_policy_output(arn: Optional[pulumi.Input[str]] = None,
                            name: Optional[pulumi.Input[str]] = None,
                            tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetFirewallPolicyResult]
    func LookupFirewallPolicy(ctx *Context, args *LookupFirewallPolicyArgs, opts ...InvokeOption) (*LookupFirewallPolicyResult, error)
    func LookupFirewallPolicyOutput(ctx *Context, args *LookupFirewallPolicyOutputArgs, opts ...InvokeOption) LookupFirewallPolicyResultOutput

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

    public static class GetFirewallPolicy 
    {
        public static Task<GetFirewallPolicyResult> InvokeAsync(GetFirewallPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetFirewallPolicyResult> Invoke(GetFirewallPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetFirewallPolicyResult> getFirewallPolicy(GetFirewallPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:networkfirewall/getFirewallPolicy:getFirewallPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Arn string
    ARN of the firewall policy.
    Name string
    Descriptive name of the firewall policy.
    Tags Dictionary<string, string>
    Key-value tags for the firewall policy.
    Arn string
    ARN of the firewall policy.
    Name string
    Descriptive name of the firewall policy.
    Tags map[string]string
    Key-value tags for the firewall policy.
    arn String
    ARN of the firewall policy.
    name String
    Descriptive name of the firewall policy.
    tags Map<String,String>
    Key-value tags for the firewall policy.
    arn string
    ARN of the firewall policy.
    name string
    Descriptive name of the firewall policy.
    tags {[key: string]: string}
    Key-value tags for the firewall policy.
    arn str
    ARN of the firewall policy.
    name str
    Descriptive name of the firewall policy.
    tags Mapping[str, str]
    Key-value tags for the firewall policy.
    arn String
    ARN of the firewall policy.
    name String
    Descriptive name of the firewall policy.
    tags Map<String>
    Key-value tags for the firewall policy.

    getFirewallPolicy Result

    The following output properties are available:

    Description string
    Description of the firewall policy.
    FirewallPolicies List<GetFirewallPolicyFirewallPolicy>
    The [policy][2] for the specified firewall policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Tags Dictionary<string, string>
    Key-value tags for the firewall policy.
    UpdateToken string
    Token used for optimistic locking.
    Arn string
    Name string
    Description string
    Description of the firewall policy.
    FirewallPolicies []GetFirewallPolicyFirewallPolicy
    The [policy][2] for the specified firewall policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Tags map[string]string
    Key-value tags for the firewall policy.
    UpdateToken string
    Token used for optimistic locking.
    Arn string
    Name string
    description String
    Description of the firewall policy.
    firewallPolicies List<GetFirewallPolicyFirewallPolicy>
    The [policy][2] for the specified firewall policy.
    id String
    The provider-assigned unique ID for this managed resource.
    tags Map<String,String>
    Key-value tags for the firewall policy.
    updateToken String
    Token used for optimistic locking.
    arn String
    name String
    description string
    Description of the firewall policy.
    firewallPolicies GetFirewallPolicyFirewallPolicy[]
    The [policy][2] for the specified firewall policy.
    id string
    The provider-assigned unique ID for this managed resource.
    tags {[key: string]: string}
    Key-value tags for the firewall policy.
    updateToken string
    Token used for optimistic locking.
    arn string
    name string
    description str
    Description of the firewall policy.
    firewall_policies Sequence[GetFirewallPolicyFirewallPolicy]
    The [policy][2] for the specified firewall policy.
    id str
    The provider-assigned unique ID for this managed resource.
    tags Mapping[str, str]
    Key-value tags for the firewall policy.
    update_token str
    Token used for optimistic locking.
    arn str
    name str
    description String
    Description of the firewall policy.
    firewallPolicies List<Property Map>
    The [policy][2] for the specified firewall policy.
    id String
    The provider-assigned unique ID for this managed resource.
    tags Map<String>
    Key-value tags for the firewall policy.
    updateToken String
    Token used for optimistic locking.
    arn String
    name String

    Supporting Types

    GetFirewallPolicyFirewallPolicy

    GetFirewallPolicyFirewallPolicyStatefulEngineOption

    GetFirewallPolicyFirewallPolicyStatefulRuleGroupReference

    GetFirewallPolicyFirewallPolicyStatefulRuleGroupReferenceOverride

    Action string
    Action string
    action String
    action string
    action str
    action String

    GetFirewallPolicyFirewallPolicyStatelessCustomAction

    GetFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinition

    GetFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinitionPublishMetricAction

    GetFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinitionPublishMetricActionDimension

    Value string
    Value string
    value String
    value string
    value str
    value String

    GetFirewallPolicyFirewallPolicyStatelessRuleGroupReference

    priority Integer
    resourceArn String
    priority number
    resourceArn string
    priority Number
    resourceArn String

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi