1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. networksecurity
  5. AuthorizationPolicy
Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi

gcp.networksecurity.AuthorizationPolicy

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi

    Example Usage

    Network Security Authorization Policy Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.networksecurity.AuthorizationPolicy("default", {
        name: "my-authorization-policy",
        labels: {
            foo: "bar",
        },
        description: "my description",
        action: "ALLOW",
        rules: [{
            sources: [{
                principals: ["namespace/*"],
                ipBlocks: ["1.2.3.0/24"],
            }],
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.networksecurity.AuthorizationPolicy("default",
        name="my-authorization-policy",
        labels={
            "foo": "bar",
        },
        description="my description",
        action="ALLOW",
        rules=[gcp.networksecurity.AuthorizationPolicyRuleArgs(
            sources=[gcp.networksecurity.AuthorizationPolicyRuleSourceArgs(
                principals=["namespace/*"],
                ip_blocks=["1.2.3.0/24"],
            )],
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networksecurity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := networksecurity.NewAuthorizationPolicy(ctx, "default", &networksecurity.AuthorizationPolicyArgs{
    			Name: pulumi.String("my-authorization-policy"),
    			Labels: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    			Description: pulumi.String("my description"),
    			Action:      pulumi.String("ALLOW"),
    			Rules: networksecurity.AuthorizationPolicyRuleArray{
    				&networksecurity.AuthorizationPolicyRuleArgs{
    					Sources: networksecurity.AuthorizationPolicyRuleSourceArray{
    						&networksecurity.AuthorizationPolicyRuleSourceArgs{
    							Principals: pulumi.StringArray{
    								pulumi.String("namespace/*"),
    							},
    							IpBlocks: pulumi.StringArray{
    								pulumi.String("1.2.3.0/24"),
    							},
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Gcp.NetworkSecurity.AuthorizationPolicy("default", new()
        {
            Name = "my-authorization-policy",
            Labels = 
            {
                { "foo", "bar" },
            },
            Description = "my description",
            Action = "ALLOW",
            Rules = new[]
            {
                new Gcp.NetworkSecurity.Inputs.AuthorizationPolicyRuleArgs
                {
                    Sources = new[]
                    {
                        new Gcp.NetworkSecurity.Inputs.AuthorizationPolicyRuleSourceArgs
                        {
                            Principals = new[]
                            {
                                "namespace/*",
                            },
                            IpBlocks = new[]
                            {
                                "1.2.3.0/24",
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.networksecurity.AuthorizationPolicy;
    import com.pulumi.gcp.networksecurity.AuthorizationPolicyArgs;
    import com.pulumi.gcp.networksecurity.inputs.AuthorizationPolicyRuleArgs;
    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 default_ = new AuthorizationPolicy("default", AuthorizationPolicyArgs.builder()
                .name("my-authorization-policy")
                .labels(Map.of("foo", "bar"))
                .description("my description")
                .action("ALLOW")
                .rules(AuthorizationPolicyRuleArgs.builder()
                    .sources(AuthorizationPolicyRuleSourceArgs.builder()
                        .principals("namespace/*")
                        .ipBlocks("1.2.3.0/24")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:networksecurity:AuthorizationPolicy
        properties:
          name: my-authorization-policy
          labels:
            foo: bar
          description: my description
          action: ALLOW
          rules:
            - sources:
                - principals:
                    - namespace/*
                  ipBlocks:
                    - 1.2.3.0/24
    

    Network Security Authorization Policy Destinations

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.networksecurity.AuthorizationPolicy("default", {
        name: "my-authorization-policy",
        labels: {
            foo: "bar",
        },
        description: "my description",
        action: "ALLOW",
        rules: [{
            sources: [{
                principals: ["namespace/*"],
                ipBlocks: ["1.2.3.0/24"],
            }],
            destinations: [{
                hosts: ["mydomain.*"],
                ports: [8080],
                methods: ["GET"],
                httpHeaderMatch: {
                    headerName: ":method",
                    regexMatch: "GET",
                },
            }],
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.networksecurity.AuthorizationPolicy("default",
        name="my-authorization-policy",
        labels={
            "foo": "bar",
        },
        description="my description",
        action="ALLOW",
        rules=[gcp.networksecurity.AuthorizationPolicyRuleArgs(
            sources=[gcp.networksecurity.AuthorizationPolicyRuleSourceArgs(
                principals=["namespace/*"],
                ip_blocks=["1.2.3.0/24"],
            )],
            destinations=[gcp.networksecurity.AuthorizationPolicyRuleDestinationArgs(
                hosts=["mydomain.*"],
                ports=[8080],
                methods=["GET"],
                http_header_match=gcp.networksecurity.AuthorizationPolicyRuleDestinationHttpHeaderMatchArgs(
                    header_name=":method",
                    regex_match="GET",
                ),
            )],
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networksecurity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := networksecurity.NewAuthorizationPolicy(ctx, "default", &networksecurity.AuthorizationPolicyArgs{
    			Name: pulumi.String("my-authorization-policy"),
    			Labels: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    			Description: pulumi.String("my description"),
    			Action:      pulumi.String("ALLOW"),
    			Rules: networksecurity.AuthorizationPolicyRuleArray{
    				&networksecurity.AuthorizationPolicyRuleArgs{
    					Sources: networksecurity.AuthorizationPolicyRuleSourceArray{
    						&networksecurity.AuthorizationPolicyRuleSourceArgs{
    							Principals: pulumi.StringArray{
    								pulumi.String("namespace/*"),
    							},
    							IpBlocks: pulumi.StringArray{
    								pulumi.String("1.2.3.0/24"),
    							},
    						},
    					},
    					Destinations: networksecurity.AuthorizationPolicyRuleDestinationArray{
    						&networksecurity.AuthorizationPolicyRuleDestinationArgs{
    							Hosts: pulumi.StringArray{
    								pulumi.String("mydomain.*"),
    							},
    							Ports: pulumi.IntArray{
    								pulumi.Int(8080),
    							},
    							Methods: pulumi.StringArray{
    								pulumi.String("GET"),
    							},
    							HttpHeaderMatch: &networksecurity.AuthorizationPolicyRuleDestinationHttpHeaderMatchArgs{
    								HeaderName: pulumi.String(":method"),
    								RegexMatch: pulumi.String("GET"),
    							},
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Gcp.NetworkSecurity.AuthorizationPolicy("default", new()
        {
            Name = "my-authorization-policy",
            Labels = 
            {
                { "foo", "bar" },
            },
            Description = "my description",
            Action = "ALLOW",
            Rules = new[]
            {
                new Gcp.NetworkSecurity.Inputs.AuthorizationPolicyRuleArgs
                {
                    Sources = new[]
                    {
                        new Gcp.NetworkSecurity.Inputs.AuthorizationPolicyRuleSourceArgs
                        {
                            Principals = new[]
                            {
                                "namespace/*",
                            },
                            IpBlocks = new[]
                            {
                                "1.2.3.0/24",
                            },
                        },
                    },
                    Destinations = new[]
                    {
                        new Gcp.NetworkSecurity.Inputs.AuthorizationPolicyRuleDestinationArgs
                        {
                            Hosts = new[]
                            {
                                "mydomain.*",
                            },
                            Ports = new[]
                            {
                                8080,
                            },
                            Methods = new[]
                            {
                                "GET",
                            },
                            HttpHeaderMatch = new Gcp.NetworkSecurity.Inputs.AuthorizationPolicyRuleDestinationHttpHeaderMatchArgs
                            {
                                HeaderName = ":method",
                                RegexMatch = "GET",
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.networksecurity.AuthorizationPolicy;
    import com.pulumi.gcp.networksecurity.AuthorizationPolicyArgs;
    import com.pulumi.gcp.networksecurity.inputs.AuthorizationPolicyRuleArgs;
    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 default_ = new AuthorizationPolicy("default", AuthorizationPolicyArgs.builder()
                .name("my-authorization-policy")
                .labels(Map.of("foo", "bar"))
                .description("my description")
                .action("ALLOW")
                .rules(AuthorizationPolicyRuleArgs.builder()
                    .sources(AuthorizationPolicyRuleSourceArgs.builder()
                        .principals("namespace/*")
                        .ipBlocks("1.2.3.0/24")
                        .build())
                    .destinations(AuthorizationPolicyRuleDestinationArgs.builder()
                        .hosts("mydomain.*")
                        .ports(8080)
                        .methods("GET")
                        .httpHeaderMatch(AuthorizationPolicyRuleDestinationHttpHeaderMatchArgs.builder()
                            .headerName(":method")
                            .regexMatch("GET")
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:networksecurity:AuthorizationPolicy
        properties:
          name: my-authorization-policy
          labels:
            foo: bar
          description: my description
          action: ALLOW
          rules:
            - sources:
                - principals:
                    - namespace/*
                  ipBlocks:
                    - 1.2.3.0/24
              destinations:
                - hosts:
                    - mydomain.*
                  ports:
                    - 8080
                  methods:
                    - GET
                  httpHeaderMatch:
                    headerName: :method
                    regexMatch: GET
    

    Create AuthorizationPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AuthorizationPolicy(name: string, args: AuthorizationPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def AuthorizationPolicy(resource_name: str,
                            args: AuthorizationPolicyArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def AuthorizationPolicy(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            action: Optional[str] = None,
                            description: Optional[str] = None,
                            labels: Optional[Mapping[str, str]] = None,
                            location: Optional[str] = None,
                            name: Optional[str] = None,
                            project: Optional[str] = None,
                            rules: Optional[Sequence[AuthorizationPolicyRuleArgs]] = None)
    func NewAuthorizationPolicy(ctx *Context, name string, args AuthorizationPolicyArgs, opts ...ResourceOption) (*AuthorizationPolicy, error)
    public AuthorizationPolicy(string name, AuthorizationPolicyArgs args, CustomResourceOptions? opts = null)
    public AuthorizationPolicy(String name, AuthorizationPolicyArgs args)
    public AuthorizationPolicy(String name, AuthorizationPolicyArgs args, CustomResourceOptions options)
    
    type: gcp:networksecurity:AuthorizationPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AuthorizationPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AuthorizationPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AuthorizationPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AuthorizationPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AuthorizationPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var authorizationPolicyResource = new Gcp.NetworkSecurity.AuthorizationPolicy("authorizationPolicyResource", new()
    {
        Action = "string",
        Description = "string",
        Labels = 
        {
            { "string", "string" },
        },
        Location = "string",
        Name = "string",
        Project = "string",
        Rules = new[]
        {
            new Gcp.NetworkSecurity.Inputs.AuthorizationPolicyRuleArgs
            {
                Destinations = new[]
                {
                    new Gcp.NetworkSecurity.Inputs.AuthorizationPolicyRuleDestinationArgs
                    {
                        Hosts = new[]
                        {
                            "string",
                        },
                        Methods = new[]
                        {
                            "string",
                        },
                        Ports = new[]
                        {
                            0,
                        },
                        HttpHeaderMatch = new Gcp.NetworkSecurity.Inputs.AuthorizationPolicyRuleDestinationHttpHeaderMatchArgs
                        {
                            HeaderName = "string",
                            RegexMatch = "string",
                        },
                    },
                },
                Sources = new[]
                {
                    new Gcp.NetworkSecurity.Inputs.AuthorizationPolicyRuleSourceArgs
                    {
                        IpBlocks = new[]
                        {
                            "string",
                        },
                        Principals = new[]
                        {
                            "string",
                        },
                    },
                },
            },
        },
    });
    
    example, err := networksecurity.NewAuthorizationPolicy(ctx, "authorizationPolicyResource", &networksecurity.AuthorizationPolicyArgs{
    	Action:      pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Location: pulumi.String("string"),
    	Name:     pulumi.String("string"),
    	Project:  pulumi.String("string"),
    	Rules: networksecurity.AuthorizationPolicyRuleArray{
    		&networksecurity.AuthorizationPolicyRuleArgs{
    			Destinations: networksecurity.AuthorizationPolicyRuleDestinationArray{
    				&networksecurity.AuthorizationPolicyRuleDestinationArgs{
    					Hosts: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    					Methods: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    					Ports: pulumi.IntArray{
    						pulumi.Int(0),
    					},
    					HttpHeaderMatch: &networksecurity.AuthorizationPolicyRuleDestinationHttpHeaderMatchArgs{
    						HeaderName: pulumi.String("string"),
    						RegexMatch: pulumi.String("string"),
    					},
    				},
    			},
    			Sources: networksecurity.AuthorizationPolicyRuleSourceArray{
    				&networksecurity.AuthorizationPolicyRuleSourceArgs{
    					IpBlocks: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    					Principals: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    				},
    			},
    		},
    	},
    })
    
    var authorizationPolicyResource = new AuthorizationPolicy("authorizationPolicyResource", AuthorizationPolicyArgs.builder()
        .action("string")
        .description("string")
        .labels(Map.of("string", "string"))
        .location("string")
        .name("string")
        .project("string")
        .rules(AuthorizationPolicyRuleArgs.builder()
            .destinations(AuthorizationPolicyRuleDestinationArgs.builder()
                .hosts("string")
                .methods("string")
                .ports(0)
                .httpHeaderMatch(AuthorizationPolicyRuleDestinationHttpHeaderMatchArgs.builder()
                    .headerName("string")
                    .regexMatch("string")
                    .build())
                .build())
            .sources(AuthorizationPolicyRuleSourceArgs.builder()
                .ipBlocks("string")
                .principals("string")
                .build())
            .build())
        .build());
    
    authorization_policy_resource = gcp.networksecurity.AuthorizationPolicy("authorizationPolicyResource",
        action="string",
        description="string",
        labels={
            "string": "string",
        },
        location="string",
        name="string",
        project="string",
        rules=[gcp.networksecurity.AuthorizationPolicyRuleArgs(
            destinations=[gcp.networksecurity.AuthorizationPolicyRuleDestinationArgs(
                hosts=["string"],
                methods=["string"],
                ports=[0],
                http_header_match=gcp.networksecurity.AuthorizationPolicyRuleDestinationHttpHeaderMatchArgs(
                    header_name="string",
                    regex_match="string",
                ),
            )],
            sources=[gcp.networksecurity.AuthorizationPolicyRuleSourceArgs(
                ip_blocks=["string"],
                principals=["string"],
            )],
        )])
    
    const authorizationPolicyResource = new gcp.networksecurity.AuthorizationPolicy("authorizationPolicyResource", {
        action: "string",
        description: "string",
        labels: {
            string: "string",
        },
        location: "string",
        name: "string",
        project: "string",
        rules: [{
            destinations: [{
                hosts: ["string"],
                methods: ["string"],
                ports: [0],
                httpHeaderMatch: {
                    headerName: "string",
                    regexMatch: "string",
                },
            }],
            sources: [{
                ipBlocks: ["string"],
                principals: ["string"],
            }],
        }],
    });
    
    type: gcp:networksecurity:AuthorizationPolicy
    properties:
        action: string
        description: string
        labels:
            string: string
        location: string
        name: string
        project: string
        rules:
            - destinations:
                - hosts:
                    - string
                  httpHeaderMatch:
                    headerName: string
                    regexMatch: string
                  methods:
                    - string
                  ports:
                    - 0
              sources:
                - ipBlocks:
                    - string
                  principals:
                    - string
    

    AuthorizationPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The AuthorizationPolicy resource accepts the following input properties:

    Action string
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    Labels Dictionary<string, string>
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    Location string
    The location of the authorization policy. The default value is global.
    Name string
    Name of the AuthorizationPolicy resource.


    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Rules List<AuthorizationPolicyRule>
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.
    Action string
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    Labels map[string]string
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    Location string
    The location of the authorization policy. The default value is global.
    Name string
    Name of the AuthorizationPolicy resource.


    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Rules []AuthorizationPolicyRuleArgs
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.
    action String
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    description String
    A free-text description of the resource. Max length 1024 characters.
    labels Map<String,String>
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    location String
    The location of the authorization policy. The default value is global.
    name String
    Name of the AuthorizationPolicy resource.


    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    rules List<AuthorizationPolicyRule>
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.
    action string
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    description string
    A free-text description of the resource. Max length 1024 characters.
    labels {[key: string]: string}
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    location string
    The location of the authorization policy. The default value is global.
    name string
    Name of the AuthorizationPolicy resource.


    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    rules AuthorizationPolicyRule[]
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.
    action str
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    description str
    A free-text description of the resource. Max length 1024 characters.
    labels Mapping[str, str]
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    location str
    The location of the authorization policy. The default value is global.
    name str
    Name of the AuthorizationPolicy resource.


    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    rules Sequence[AuthorizationPolicyRuleArgs]
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.
    action String
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    description String
    A free-text description of the resource. Max length 1024 characters.
    labels Map<String>
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    location String
    The location of the authorization policy. The default value is global.
    name String
    Name of the AuthorizationPolicy resource.


    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    rules List<Property Map>
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AuthorizationPolicy resource produces the following output properties:

    CreateTime string
    Time the AuthorizationPolicy was created in UTC.
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    UpdateTime string
    Time the AuthorizationPolicy was updated in UTC.
    CreateTime string
    Time the AuthorizationPolicy was created in UTC.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    UpdateTime string
    Time the AuthorizationPolicy was updated in UTC.
    createTime String
    Time the AuthorizationPolicy was created in UTC.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    updateTime String
    Time the AuthorizationPolicy was updated in UTC.
    createTime string
    Time the AuthorizationPolicy was created in UTC.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id string
    The provider-assigned unique ID for this managed resource.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    updateTime string
    Time the AuthorizationPolicy was updated in UTC.
    create_time str
    Time the AuthorizationPolicy was created in UTC.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id str
    The provider-assigned unique ID for this managed resource.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    update_time str
    Time the AuthorizationPolicy was updated in UTC.
    createTime String
    Time the AuthorizationPolicy was created in UTC.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    updateTime String
    Time the AuthorizationPolicy was updated in UTC.

    Look up Existing AuthorizationPolicy Resource

    Get an existing AuthorizationPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: AuthorizationPolicyState, opts?: CustomResourceOptions): AuthorizationPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            action: Optional[str] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            effective_labels: Optional[Mapping[str, str]] = None,
            labels: Optional[Mapping[str, str]] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            pulumi_labels: Optional[Mapping[str, str]] = None,
            rules: Optional[Sequence[AuthorizationPolicyRuleArgs]] = None,
            update_time: Optional[str] = None) -> AuthorizationPolicy
    func GetAuthorizationPolicy(ctx *Context, name string, id IDInput, state *AuthorizationPolicyState, opts ...ResourceOption) (*AuthorizationPolicy, error)
    public static AuthorizationPolicy Get(string name, Input<string> id, AuthorizationPolicyState? state, CustomResourceOptions? opts = null)
    public static AuthorizationPolicy get(String name, Output<String> id, AuthorizationPolicyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Action string
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    CreateTime string
    Time the AuthorizationPolicy was created in UTC.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Labels Dictionary<string, string>
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    Location string
    The location of the authorization policy. The default value is global.
    Name string
    Name of the AuthorizationPolicy resource.


    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    Rules List<AuthorizationPolicyRule>
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.
    UpdateTime string
    Time the AuthorizationPolicy was updated in UTC.
    Action string
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    CreateTime string
    Time the AuthorizationPolicy was created in UTC.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Labels map[string]string
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    Location string
    The location of the authorization policy. The default value is global.
    Name string
    Name of the AuthorizationPolicy resource.


    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    Rules []AuthorizationPolicyRuleArgs
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.
    UpdateTime string
    Time the AuthorizationPolicy was updated in UTC.
    action String
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    createTime String
    Time the AuthorizationPolicy was created in UTC.
    description String
    A free-text description of the resource. Max length 1024 characters.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels Map<String,String>
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    location String
    The location of the authorization policy. The default value is global.
    name String
    Name of the AuthorizationPolicy resource.


    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    rules List<AuthorizationPolicyRule>
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.
    updateTime String
    Time the AuthorizationPolicy was updated in UTC.
    action string
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    createTime string
    Time the AuthorizationPolicy was created in UTC.
    description string
    A free-text description of the resource. Max length 1024 characters.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels {[key: string]: string}
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    location string
    The location of the authorization policy. The default value is global.
    name string
    Name of the AuthorizationPolicy resource.


    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    rules AuthorizationPolicyRule[]
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.
    updateTime string
    Time the AuthorizationPolicy was updated in UTC.
    action str
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    create_time str
    Time the AuthorizationPolicy was created in UTC.
    description str
    A free-text description of the resource. Max length 1024 characters.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels Mapping[str, str]
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    location str
    The location of the authorization policy. The default value is global.
    name str
    Name of the AuthorizationPolicy resource.


    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    rules Sequence[AuthorizationPolicyRuleArgs]
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.
    update_time str
    Time the AuthorizationPolicy was updated in UTC.
    action String
    The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". Possible values are: ALLOW, DENY.
    createTime String
    Time the AuthorizationPolicy was created in UTC.
    description String
    A free-text description of the resource. Max length 1024 characters.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    labels Map<String>
    Set of label tags associated with the AuthorizationPolicy resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
    location String
    The location of the authorization policy. The default value is global.
    name String
    Name of the AuthorizationPolicy resource.


    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    rules List<Property Map>
    List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request. Structure is documented below.
    updateTime String
    Time the AuthorizationPolicy was updated in UTC.

    Supporting Types

    AuthorizationPolicyRule, AuthorizationPolicyRuleArgs

    Destinations List<AuthorizationPolicyRuleDestination>
    List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers. If not set, the action specified in the 'action' field will be applied without any rule checks for the destination. Structure is documented below.
    Sources List<AuthorizationPolicyRuleSource>
    List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ipBlocks match. If not set, the action specified in the 'action' field will be applied without any rule checks for the source. Structure is documented below.
    Destinations []AuthorizationPolicyRuleDestination
    List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers. If not set, the action specified in the 'action' field will be applied without any rule checks for the destination. Structure is documented below.
    Sources []AuthorizationPolicyRuleSource
    List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ipBlocks match. If not set, the action specified in the 'action' field will be applied without any rule checks for the source. Structure is documented below.
    destinations List<AuthorizationPolicyRuleDestination>
    List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers. If not set, the action specified in the 'action' field will be applied without any rule checks for the destination. Structure is documented below.
    sources List<AuthorizationPolicyRuleSource>
    List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ipBlocks match. If not set, the action specified in the 'action' field will be applied without any rule checks for the source. Structure is documented below.
    destinations AuthorizationPolicyRuleDestination[]
    List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers. If not set, the action specified in the 'action' field will be applied without any rule checks for the destination. Structure is documented below.
    sources AuthorizationPolicyRuleSource[]
    List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ipBlocks match. If not set, the action specified in the 'action' field will be applied without any rule checks for the source. Structure is documented below.
    destinations Sequence[AuthorizationPolicyRuleDestination]
    List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers. If not set, the action specified in the 'action' field will be applied without any rule checks for the destination. Structure is documented below.
    sources Sequence[AuthorizationPolicyRuleSource]
    List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ipBlocks match. If not set, the action specified in the 'action' field will be applied without any rule checks for the source. Structure is documented below.
    destinations List<Property Map>
    List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers. If not set, the action specified in the 'action' field will be applied without any rule checks for the destination. Structure is documented below.
    sources List<Property Map>
    List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ipBlocks match. If not set, the action specified in the 'action' field will be applied without any rule checks for the source. Structure is documented below.

    AuthorizationPolicyRuleDestination, AuthorizationPolicyRuleDestinationArgs

    Hosts List<string>
    List of host names to match. Matched against the ":authority" header in http requests. At least one host should match. Each host can be an exact match, or a prefix match (example "mydomain.") or a suffix match (example ".myorg.com") or a presence (any) match "*".
    Methods List<string>
    A list of HTTP methods to match. At least one method should match. Should not be set for gRPC services.
    Ports List<int>
    List of destination ports to match. At least one port should match.
    HttpHeaderMatch AuthorizationPolicyRuleDestinationHttpHeaderMatch
    Match against key:value pair in http header. Provides a flexible match based on HTTP headers, for potentially advanced use cases. At least one header should match. Avoid using header matches to make authorization decisions unless there is a strong guarantee that requests arrive through a trusted client or proxy. Structure is documented below.
    Hosts []string
    List of host names to match. Matched against the ":authority" header in http requests. At least one host should match. Each host can be an exact match, or a prefix match (example "mydomain.") or a suffix match (example ".myorg.com") or a presence (any) match "*".
    Methods []string
    A list of HTTP methods to match. At least one method should match. Should not be set for gRPC services.
    Ports []int
    List of destination ports to match. At least one port should match.
    HttpHeaderMatch AuthorizationPolicyRuleDestinationHttpHeaderMatch
    Match against key:value pair in http header. Provides a flexible match based on HTTP headers, for potentially advanced use cases. At least one header should match. Avoid using header matches to make authorization decisions unless there is a strong guarantee that requests arrive through a trusted client or proxy. Structure is documented below.
    hosts List<String>
    List of host names to match. Matched against the ":authority" header in http requests. At least one host should match. Each host can be an exact match, or a prefix match (example "mydomain.") or a suffix match (example ".myorg.com") or a presence (any) match "*".
    methods List<String>
    A list of HTTP methods to match. At least one method should match. Should not be set for gRPC services.
    ports List<Integer>
    List of destination ports to match. At least one port should match.
    httpHeaderMatch AuthorizationPolicyRuleDestinationHttpHeaderMatch
    Match against key:value pair in http header. Provides a flexible match based on HTTP headers, for potentially advanced use cases. At least one header should match. Avoid using header matches to make authorization decisions unless there is a strong guarantee that requests arrive through a trusted client or proxy. Structure is documented below.
    hosts string[]
    List of host names to match. Matched against the ":authority" header in http requests. At least one host should match. Each host can be an exact match, or a prefix match (example "mydomain.") or a suffix match (example ".myorg.com") or a presence (any) match "*".
    methods string[]
    A list of HTTP methods to match. At least one method should match. Should not be set for gRPC services.
    ports number[]
    List of destination ports to match. At least one port should match.
    httpHeaderMatch AuthorizationPolicyRuleDestinationHttpHeaderMatch
    Match against key:value pair in http header. Provides a flexible match based on HTTP headers, for potentially advanced use cases. At least one header should match. Avoid using header matches to make authorization decisions unless there is a strong guarantee that requests arrive through a trusted client or proxy. Structure is documented below.
    hosts Sequence[str]
    List of host names to match. Matched against the ":authority" header in http requests. At least one host should match. Each host can be an exact match, or a prefix match (example "mydomain.") or a suffix match (example ".myorg.com") or a presence (any) match "*".
    methods Sequence[str]
    A list of HTTP methods to match. At least one method should match. Should not be set for gRPC services.
    ports Sequence[int]
    List of destination ports to match. At least one port should match.
    http_header_match AuthorizationPolicyRuleDestinationHttpHeaderMatch
    Match against key:value pair in http header. Provides a flexible match based on HTTP headers, for potentially advanced use cases. At least one header should match. Avoid using header matches to make authorization decisions unless there is a strong guarantee that requests arrive through a trusted client or proxy. Structure is documented below.
    hosts List<String>
    List of host names to match. Matched against the ":authority" header in http requests. At least one host should match. Each host can be an exact match, or a prefix match (example "mydomain.") or a suffix match (example ".myorg.com") or a presence (any) match "*".
    methods List<String>
    A list of HTTP methods to match. At least one method should match. Should not be set for gRPC services.
    ports List<Number>
    List of destination ports to match. At least one port should match.
    httpHeaderMatch Property Map
    Match against key:value pair in http header. Provides a flexible match based on HTTP headers, for potentially advanced use cases. At least one header should match. Avoid using header matches to make authorization decisions unless there is a strong guarantee that requests arrive through a trusted client or proxy. Structure is documented below.

    AuthorizationPolicyRuleDestinationHttpHeaderMatch, AuthorizationPolicyRuleDestinationHttpHeaderMatchArgs

    HeaderName string
    The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method".
    RegexMatch string
    The value of the header must match the regular expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript For matching against a port specified in the HTTP request, use a headerMatch with headerName set to Host and a regular expression that satisfies the RFC2616 Host header's port specifier.
    HeaderName string
    The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method".
    RegexMatch string
    The value of the header must match the regular expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript For matching against a port specified in the HTTP request, use a headerMatch with headerName set to Host and a regular expression that satisfies the RFC2616 Host header's port specifier.
    headerName String
    The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method".
    regexMatch String
    The value of the header must match the regular expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript For matching against a port specified in the HTTP request, use a headerMatch with headerName set to Host and a regular expression that satisfies the RFC2616 Host header's port specifier.
    headerName string
    The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method".
    regexMatch string
    The value of the header must match the regular expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript For matching against a port specified in the HTTP request, use a headerMatch with headerName set to Host and a regular expression that satisfies the RFC2616 Host header's port specifier.
    header_name str
    The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method".
    regex_match str
    The value of the header must match the regular expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript For matching against a port specified in the HTTP request, use a headerMatch with headerName set to Host and a regular expression that satisfies the RFC2616 Host header's port specifier.
    headerName String
    The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method".
    regexMatch String
    The value of the header must match the regular expression specified in regexMatch. For regular expression grammar, please see: en.cppreference.com/w/cpp/regex/ecmascript For matching against a port specified in the HTTP request, use a headerMatch with headerName set to Host and a regular expression that satisfies the RFC2616 Host header's port specifier.

    AuthorizationPolicyRuleSource, AuthorizationPolicyRuleSourceArgs

    IpBlocks List<string>
    List of CIDR ranges to match based on source IP address. At least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g., "1.2.3.0/24") are supported. Authorization based on source IP alone should be avoided. The IP addresses of any load balancers or proxies should be considered untrusted.
    Principals List<string>
    List of peer identities to match for authorization. At least one principal should match. Each peer can be an exact match, or a prefix match (example, "namespace/") or a suffix match (example, "/service-account") or a presence match "*". Authorization based on the principal name without certificate validation (configured by ServerTlsPolicy resource) is considered insecure.
    IpBlocks []string
    List of CIDR ranges to match based on source IP address. At least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g., "1.2.3.0/24") are supported. Authorization based on source IP alone should be avoided. The IP addresses of any load balancers or proxies should be considered untrusted.
    Principals []string
    List of peer identities to match for authorization. At least one principal should match. Each peer can be an exact match, or a prefix match (example, "namespace/") or a suffix match (example, "/service-account") or a presence match "*". Authorization based on the principal name without certificate validation (configured by ServerTlsPolicy resource) is considered insecure.
    ipBlocks List<String>
    List of CIDR ranges to match based on source IP address. At least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g., "1.2.3.0/24") are supported. Authorization based on source IP alone should be avoided. The IP addresses of any load balancers or proxies should be considered untrusted.
    principals List<String>
    List of peer identities to match for authorization. At least one principal should match. Each peer can be an exact match, or a prefix match (example, "namespace/") or a suffix match (example, "/service-account") or a presence match "*". Authorization based on the principal name without certificate validation (configured by ServerTlsPolicy resource) is considered insecure.
    ipBlocks string[]
    List of CIDR ranges to match based on source IP address. At least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g., "1.2.3.0/24") are supported. Authorization based on source IP alone should be avoided. The IP addresses of any load balancers or proxies should be considered untrusted.
    principals string[]
    List of peer identities to match for authorization. At least one principal should match. Each peer can be an exact match, or a prefix match (example, "namespace/") or a suffix match (example, "/service-account") or a presence match "*". Authorization based on the principal name without certificate validation (configured by ServerTlsPolicy resource) is considered insecure.
    ip_blocks Sequence[str]
    List of CIDR ranges to match based on source IP address. At least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g., "1.2.3.0/24") are supported. Authorization based on source IP alone should be avoided. The IP addresses of any load balancers or proxies should be considered untrusted.
    principals Sequence[str]
    List of peer identities to match for authorization. At least one principal should match. Each peer can be an exact match, or a prefix match (example, "namespace/") or a suffix match (example, "/service-account") or a presence match "*". Authorization based on the principal name without certificate validation (configured by ServerTlsPolicy resource) is considered insecure.
    ipBlocks List<String>
    List of CIDR ranges to match based on source IP address. At least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g., "1.2.3.0/24") are supported. Authorization based on source IP alone should be avoided. The IP addresses of any load balancers or proxies should be considered untrusted.
    principals List<String>
    List of peer identities to match for authorization. At least one principal should match. Each peer can be an exact match, or a prefix match (example, "namespace/") or a suffix match (example, "/service-account") or a presence match "*". Authorization based on the principal name without certificate validation (configured by ServerTlsPolicy resource) is considered insecure.

    Import

    AuthorizationPolicy can be imported using any of these accepted formats:

    • projects/{{project}}/locations/{{location}}/authorizationPolicies/{{name}}

    • {{project}}/{{location}}/{{name}}

    • {{location}}/{{name}}

    When using the pulumi import command, AuthorizationPolicy can be imported using one of the formats above. For example:

    $ pulumi import gcp:networksecurity/authorizationPolicy:AuthorizationPolicy default projects/{{project}}/locations/{{location}}/authorizationPolicies/{{name}}
    
    $ pulumi import gcp:networksecurity/authorizationPolicy:AuthorizationPolicy default {{project}}/{{location}}/{{name}}
    
    $ pulumi import gcp:networksecurity/authorizationPolicy:AuthorizationPolicy default {{location}}/{{name}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi