gcp.networksecurity.AuthorizationPolicy

Explore with Pulumi AI

Import

AuthorizationPolicy can be imported using any of these accepted formats

 $ 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}}

Example Usage

Network Security Authorization Policy Basic

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()
    {
        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",
                        },
                    },
                },
            },
        },
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/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{
			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"),
							},
						},
					},
				},
			},
		}, pulumi.Provider(google_beta))
		if err != nil {
			return err
		}
		return nil
	})
}
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 com.pulumi.resources.CustomResourceOptions;
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()        
            .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(), CustomResourceOptions.builder()
                .provider(google_beta)
                .build());

    }
}
import pulumi
import pulumi_gcp as gcp

default = gcp.networksecurity.AuthorizationPolicy("default",
    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"],
        )],
    )],
    opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const _default = new gcp.networksecurity.AuthorizationPolicy("default", {
    labels: {
        foo: "bar",
    },
    description: "my description",
    action: "ALLOW",
    rules: [{
        sources: [{
            principals: ["namespace/*"],
            ipBlocks: ["1.2.3.0/24"],
        }],
    }],
}, {
    provider: google_beta,
});
resources:
  default:
    type: gcp:networksecurity:AuthorizationPolicy
    properties:
      labels:
        foo: bar
      description: my description
      action: ALLOW
      rules:
        - sources:
            - principals:
                - namespace/*
              ipBlocks:
                - 1.2.3.0/24
    options:
      provider: ${["google-beta"]}

Network Security Authorization Policy Destinations

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()
    {
        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",
                        },
                    },
                },
            },
        },
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/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{
			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"),
							},
						},
					},
				},
			},
		}, pulumi.Provider(google_beta))
		if err != nil {
			return err
		}
		return nil
	})
}
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 com.pulumi.resources.CustomResourceOptions;
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()        
            .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(), CustomResourceOptions.builder()
                .provider(google_beta)
                .build());

    }
}
import pulumi
import pulumi_gcp as gcp

default = gcp.networksecurity.AuthorizationPolicy("default",
    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",
            ),
        )],
    )],
    opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const _default = new gcp.networksecurity.AuthorizationPolicy("default", {
    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",
            },
        }],
    }],
}, {
    provider: google_beta,
});
resources:
  default:
    type: gcp:networksecurity:AuthorizationPolicy
    properties:
      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
    options:
      provider: ${["google-beta"]}

Create AuthorizationPolicy Resource

new AuthorizationPolicy(name: string, args: AuthorizationPolicyArgs, opts?: CustomResourceOptions);
@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)
@overload
def AuthorizationPolicy(resource_name: str,
                        args: AuthorizationPolicyArgs,
                        opts: Optional[ResourceOptions] = 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.

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.

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.

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<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.

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.

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<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 {[key: string]: string}

Set of label tags associated with the AuthorizationPolicy 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 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.

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.

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.

Id string

The provider-assigned unique ID for this managed resource.

UpdateTime string

Time the AuthorizationPolicy was updated in UTC.

CreateTime string

Time the AuthorizationPolicy was created in UTC.

Id string

The provider-assigned unique ID for this managed resource.

UpdateTime string

Time the AuthorizationPolicy was updated in UTC.

createTime String

Time the AuthorizationPolicy was created in UTC.

id String

The provider-assigned unique ID for this managed resource.

updateTime String

Time the AuthorizationPolicy was updated in UTC.

createTime string

Time the AuthorizationPolicy was created in UTC.

id string

The provider-assigned unique ID for this managed resource.

updateTime string

Time the AuthorizationPolicy was updated in UTC.

create_time str

Time the AuthorizationPolicy was created in UTC.

id str

The provider-assigned unique ID for this managed resource.

update_time str

Time the AuthorizationPolicy was updated in UTC.

createTime String

Time the AuthorizationPolicy was created in UTC.

id String

The provider-assigned unique ID for this managed resource.

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,
        labels: Optional[Mapping[str, str]] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[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.

Labels Dictionary<string, string>

Set of label tags associated with the AuthorizationPolicy 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<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.

Labels map[string]string

Set of label tags associated with the AuthorizationPolicy 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.

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.

labels Map<String,String>

Set of label tags associated with the AuthorizationPolicy 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<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.

labels {[key: string]: string}

Set of label tags associated with the AuthorizationPolicy 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.

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.

labels Mapping[str, str]

Set of label tags associated with the AuthorizationPolicy 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.

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.

labels Map<String>

Set of label tags associated with the AuthorizationPolicy 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.

updateTime String

Time the AuthorizationPolicy was updated in UTC.

Supporting Types

AuthorizationPolicyRule

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

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

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

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.

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.