1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. logging
  5. OrganizationExclusion
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

gcp.logging.OrganizationExclusion

Explore with Pulumi AI

Manages an organization-level logging exclusion. For more information see:

You can specify exclusions for log sinks created by the provider by using the exclusions field of gcp.logging.OrganizationSink

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const my_exclusion = new gcp.logging.OrganizationExclusion("my-exclusion", {
    name: "my-instance-debug-exclusion",
    orgId: "123456789",
    description: "Exclude GCE instance debug logs",
    filter: "resource.type = gce_instance AND severity <= DEBUG",
});
Copy
import pulumi
import pulumi_gcp as gcp

my_exclusion = gcp.logging.OrganizationExclusion("my-exclusion",
    name="my-instance-debug-exclusion",
    org_id="123456789",
    description="Exclude GCE instance debug logs",
    filter="resource.type = gce_instance AND severity <= DEBUG")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/logging"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := logging.NewOrganizationExclusion(ctx, "my-exclusion", &logging.OrganizationExclusionArgs{
			Name:        pulumi.String("my-instance-debug-exclusion"),
			OrgId:       pulumi.String("123456789"),
			Description: pulumi.String("Exclude GCE instance debug logs"),
			Filter:      pulumi.String("resource.type = gce_instance AND severity <= DEBUG"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var my_exclusion = new Gcp.Logging.OrganizationExclusion("my-exclusion", new()
    {
        Name = "my-instance-debug-exclusion",
        OrgId = "123456789",
        Description = "Exclude GCE instance debug logs",
        Filter = "resource.type = gce_instance AND severity <= DEBUG",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.logging.OrganizationExclusion;
import com.pulumi.gcp.logging.OrganizationExclusionArgs;
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 my_exclusion = new OrganizationExclusion("my-exclusion", OrganizationExclusionArgs.builder()
            .name("my-instance-debug-exclusion")
            .orgId("123456789")
            .description("Exclude GCE instance debug logs")
            .filter("resource.type = gce_instance AND severity <= DEBUG")
            .build());

    }
}
Copy
resources:
  my-exclusion:
    type: gcp:logging:OrganizationExclusion
    properties:
      name: my-instance-debug-exclusion
      orgId: '123456789'
      description: Exclude GCE instance debug logs
      filter: resource.type = gce_instance AND severity <= DEBUG
Copy

Create OrganizationExclusion Resource

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

Constructor syntax

new OrganizationExclusion(name: string, args: OrganizationExclusionArgs, opts?: CustomResourceOptions);
@overload
def OrganizationExclusion(resource_name: str,
                          args: OrganizationExclusionArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def OrganizationExclusion(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          filter: Optional[str] = None,
                          org_id: Optional[str] = None,
                          description: Optional[str] = None,
                          disabled: Optional[bool] = None,
                          name: Optional[str] = None)
func NewOrganizationExclusion(ctx *Context, name string, args OrganizationExclusionArgs, opts ...ResourceOption) (*OrganizationExclusion, error)
public OrganizationExclusion(string name, OrganizationExclusionArgs args, CustomResourceOptions? opts = null)
public OrganizationExclusion(String name, OrganizationExclusionArgs args)
public OrganizationExclusion(String name, OrganizationExclusionArgs args, CustomResourceOptions options)
type: gcp:logging:OrganizationExclusion
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

Constructor example

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

var organizationExclusionResource = new Gcp.Logging.OrganizationExclusion("organizationExclusionResource", new()
{
    Filter = "string",
    OrgId = "string",
    Description = "string",
    Disabled = false,
    Name = "string",
});
Copy
example, err := logging.NewOrganizationExclusion(ctx, "organizationExclusionResource", &logging.OrganizationExclusionArgs{
	Filter:      pulumi.String("string"),
	OrgId:       pulumi.String("string"),
	Description: pulumi.String("string"),
	Disabled:    pulumi.Bool(false),
	Name:        pulumi.String("string"),
})
Copy
var organizationExclusionResource = new OrganizationExclusion("organizationExclusionResource", OrganizationExclusionArgs.builder()
    .filter("string")
    .orgId("string")
    .description("string")
    .disabled(false)
    .name("string")
    .build());
Copy
organization_exclusion_resource = gcp.logging.OrganizationExclusion("organizationExclusionResource",
    filter="string",
    org_id="string",
    description="string",
    disabled=False,
    name="string")
Copy
const organizationExclusionResource = new gcp.logging.OrganizationExclusion("organizationExclusionResource", {
    filter: "string",
    orgId: "string",
    description: "string",
    disabled: false,
    name: "string",
});
Copy
type: gcp:logging:OrganizationExclusion
properties:
    description: string
    disabled: false
    filter: string
    name: string
    orgId: string
Copy

OrganizationExclusion Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The OrganizationExclusion resource accepts the following input properties:

Filter This property is required. string
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
OrgId
This property is required.
Changes to this property will trigger replacement.
string
The organization to create the exclusion in.
Description string
A human-readable description.
Disabled bool
Whether this exclusion rule should be disabled or not. This defaults to false.
Name Changes to this property will trigger replacement. string
The name of the logging exclusion.
Filter This property is required. string
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
OrgId
This property is required.
Changes to this property will trigger replacement.
string
The organization to create the exclusion in.
Description string
A human-readable description.
Disabled bool
Whether this exclusion rule should be disabled or not. This defaults to false.
Name Changes to this property will trigger replacement. string
The name of the logging exclusion.
filter This property is required. String
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
orgId
This property is required.
Changes to this property will trigger replacement.
String
The organization to create the exclusion in.
description String
A human-readable description.
disabled Boolean
Whether this exclusion rule should be disabled or not. This defaults to false.
name Changes to this property will trigger replacement. String
The name of the logging exclusion.
filter This property is required. string
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
orgId
This property is required.
Changes to this property will trigger replacement.
string
The organization to create the exclusion in.
description string
A human-readable description.
disabled boolean
Whether this exclusion rule should be disabled or not. This defaults to false.
name Changes to this property will trigger replacement. string
The name of the logging exclusion.
filter This property is required. str
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
org_id
This property is required.
Changes to this property will trigger replacement.
str
The organization to create the exclusion in.
description str
A human-readable description.
disabled bool
Whether this exclusion rule should be disabled or not. This defaults to false.
name Changes to this property will trigger replacement. str
The name of the logging exclusion.
filter This property is required. String
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
orgId
This property is required.
Changes to this property will trigger replacement.
String
The organization to create the exclusion in.
description String
A human-readable description.
disabled Boolean
Whether this exclusion rule should be disabled or not. This defaults to false.
name Changes to this property will trigger replacement. String
The name of the logging exclusion.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing OrganizationExclusion Resource

Get an existing OrganizationExclusion 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?: OrganizationExclusionState, opts?: CustomResourceOptions): OrganizationExclusion
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        disabled: Optional[bool] = None,
        filter: Optional[str] = None,
        name: Optional[str] = None,
        org_id: Optional[str] = None) -> OrganizationExclusion
func GetOrganizationExclusion(ctx *Context, name string, id IDInput, state *OrganizationExclusionState, opts ...ResourceOption) (*OrganizationExclusion, error)
public static OrganizationExclusion Get(string name, Input<string> id, OrganizationExclusionState? state, CustomResourceOptions? opts = null)
public static OrganizationExclusion get(String name, Output<String> id, OrganizationExclusionState state, CustomResourceOptions options)
resources:  _:    type: gcp:logging:OrganizationExclusion    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Description string
A human-readable description.
Disabled bool
Whether this exclusion rule should be disabled or not. This defaults to false.
Filter string
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
Name Changes to this property will trigger replacement. string
The name of the logging exclusion.
OrgId Changes to this property will trigger replacement. string
The organization to create the exclusion in.
Description string
A human-readable description.
Disabled bool
Whether this exclusion rule should be disabled or not. This defaults to false.
Filter string
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
Name Changes to this property will trigger replacement. string
The name of the logging exclusion.
OrgId Changes to this property will trigger replacement. string
The organization to create the exclusion in.
description String
A human-readable description.
disabled Boolean
Whether this exclusion rule should be disabled or not. This defaults to false.
filter String
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name Changes to this property will trigger replacement. String
The name of the logging exclusion.
orgId Changes to this property will trigger replacement. String
The organization to create the exclusion in.
description string
A human-readable description.
disabled boolean
Whether this exclusion rule should be disabled or not. This defaults to false.
filter string
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name Changes to this property will trigger replacement. string
The name of the logging exclusion.
orgId Changes to this property will trigger replacement. string
The organization to create the exclusion in.
description str
A human-readable description.
disabled bool
Whether this exclusion rule should be disabled or not. This defaults to false.
filter str
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name Changes to this property will trigger replacement. str
The name of the logging exclusion.
org_id Changes to this property will trigger replacement. str
The organization to create the exclusion in.
description String
A human-readable description.
disabled Boolean
Whether this exclusion rule should be disabled or not. This defaults to false.
filter String
The filter to apply when excluding logs. Only log entries that match the filter are excluded. See Advanced Log Filters for information on how to write a filter.
name Changes to this property will trigger replacement. String
The name of the logging exclusion.
orgId Changes to this property will trigger replacement. String
The organization to create the exclusion in.

Import

Organization-level logging exclusions can be imported using their URI, e.g.

  • organizations/{{organization}}/exclusions/{{name}}

When using the pulumi import command, organization-level logging exclusions can be imported using one of the formats above. For example:

$ pulumi import gcp:logging/organizationExclusion:OrganizationExclusion default organizations/{{organization}}/exclusions/{{name}}
Copy

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.