gcp.logging.FolderExclusion
Explore with Pulumi AI
Manages a folder-level logging exclusion. For more information see:
- API documentation
- How-to Guides
You can specify exclusions for log sinks created by the provider by using the exclusions field of
gcp.logging.FolderSink
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const my_folder = new gcp.organizations.Folder("my-folder", {
displayName: "My folder",
parent: "organizations/123456",
});
const my_exclusion = new gcp.logging.FolderExclusion("my-exclusion", {
name: "my-instance-debug-exclusion",
folder: my_folder.name,
description: "Exclude GCE instance debug logs",
filter: "resource.type = gce_instance AND severity <= DEBUG",
});
import pulumi
import pulumi_gcp as gcp
my_folder = gcp.organizations.Folder("my-folder",
display_name="My folder",
parent="organizations/123456")
my_exclusion = gcp.logging.FolderExclusion("my-exclusion",
name="my-instance-debug-exclusion",
folder=my_folder.name,
description="Exclude GCE instance debug logs",
filter="resource.type = gce_instance AND severity <= DEBUG")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/logging"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := organizations.NewFolder(ctx, "my-folder", &organizations.FolderArgs{
DisplayName: pulumi.String("My folder"),
Parent: pulumi.String("organizations/123456"),
})
if err != nil {
return err
}
_, err = logging.NewFolderExclusion(ctx, "my-exclusion", &logging.FolderExclusionArgs{
Name: pulumi.String("my-instance-debug-exclusion"),
Folder: my_folder.Name,
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
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var my_folder = new Gcp.Organizations.Folder("my-folder", new()
{
DisplayName = "My folder",
Parent = "organizations/123456",
});
var my_exclusion = new Gcp.Logging.FolderExclusion("my-exclusion", new()
{
Name = "my-instance-debug-exclusion",
Folder = my_folder.Name,
Description = "Exclude GCE instance debug logs",
Filter = "resource.type = gce_instance AND severity <= DEBUG",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.Folder;
import com.pulumi.gcp.organizations.FolderArgs;
import com.pulumi.gcp.logging.FolderExclusion;
import com.pulumi.gcp.logging.FolderExclusionArgs;
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_folder = new Folder("my-folder", FolderArgs.builder()
.displayName("My folder")
.parent("organizations/123456")
.build());
var my_exclusion = new FolderExclusion("my-exclusion", FolderExclusionArgs.builder()
.name("my-instance-debug-exclusion")
.folder(my_folder.name())
.description("Exclude GCE instance debug logs")
.filter("resource.type = gce_instance AND severity <= DEBUG")
.build());
}
}
resources:
my-exclusion:
type: gcp:logging:FolderExclusion
properties:
name: my-instance-debug-exclusion
folder: ${["my-folder"].name}
description: Exclude GCE instance debug logs
filter: resource.type = gce_instance AND severity <= DEBUG
my-folder:
type: gcp:organizations:Folder
properties:
displayName: My folder
parent: organizations/123456
Create FolderExclusion Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FolderExclusion(name: string, args: FolderExclusionArgs, opts?: CustomResourceOptions);
@overload
def FolderExclusion(resource_name: str,
args: FolderExclusionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FolderExclusion(resource_name: str,
opts: Optional[ResourceOptions] = None,
filter: Optional[str] = None,
folder: Optional[str] = None,
description: Optional[str] = None,
disabled: Optional[bool] = None,
name: Optional[str] = None)
func NewFolderExclusion(ctx *Context, name string, args FolderExclusionArgs, opts ...ResourceOption) (*FolderExclusion, error)
public FolderExclusion(string name, FolderExclusionArgs args, CustomResourceOptions? opts = null)
public FolderExclusion(String name, FolderExclusionArgs args)
public FolderExclusion(String name, FolderExclusionArgs args, CustomResourceOptions options)
type: gcp:logging:FolderExclusion
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 FolderExclusionArgs
- 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 FolderExclusionArgs
- 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 FolderExclusionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FolderExclusionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FolderExclusionArgs
- 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 folderExclusionResource = new Gcp.Logging.FolderExclusion("folderExclusionResource", new()
{
Filter = "string",
Folder = "string",
Description = "string",
Disabled = false,
Name = "string",
});
example, err := logging.NewFolderExclusion(ctx, "folderExclusionResource", &logging.FolderExclusionArgs{
Filter: pulumi.String("string"),
Folder: pulumi.String("string"),
Description: pulumi.String("string"),
Disabled: pulumi.Bool(false),
Name: pulumi.String("string"),
})
var folderExclusionResource = new FolderExclusion("folderExclusionResource", FolderExclusionArgs.builder()
.filter("string")
.folder("string")
.description("string")
.disabled(false)
.name("string")
.build());
folder_exclusion_resource = gcp.logging.FolderExclusion("folderExclusionResource",
filter="string",
folder="string",
description="string",
disabled=False,
name="string")
const folderExclusionResource = new gcp.logging.FolderExclusion("folderExclusionResource", {
filter: "string",
folder: "string",
description: "string",
disabled: false,
name: "string",
});
type: gcp:logging:FolderExclusion
properties:
description: string
disabled: false
filter: string
folder: string
name: string
FolderExclusion 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 FolderExclusion resource accepts the following input properties:
- 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.
- Folder string
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- Description string
- A human-readable description.
- Disabled bool
- Whether this exclusion rule should be disabled or not. This defaults to false.
- Name string
- The name of the logging exclusion.
- 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.
- Folder string
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- Description string
- A human-readable description.
- Disabled bool
- Whether this exclusion rule should be disabled or not. This defaults to false.
- Name string
- The name of the logging exclusion.
- 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.
- folder String
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- description String
- A human-readable description.
- disabled Boolean
- Whether this exclusion rule should be disabled or not. This defaults to false.
- name String
- The name of the logging exclusion.
- 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.
- folder string
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- description string
- A human-readable description.
- disabled boolean
- Whether this exclusion rule should be disabled or not. This defaults to false.
- name string
- The name of the logging exclusion.
- 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.
- folder str
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- description str
- A human-readable description.
- disabled bool
- Whether this exclusion rule should be disabled or not. This defaults to false.
- name str
- The name of the logging exclusion.
- 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.
- folder String
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- description String
- A human-readable description.
- disabled Boolean
- Whether this exclusion rule should be disabled or not. This defaults to false.
- name String
- The name of the logging exclusion.
Outputs
All input properties are implicitly available as output properties. Additionally, the FolderExclusion 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 FolderExclusion Resource
Get an existing FolderExclusion 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?: FolderExclusionState, opts?: CustomResourceOptions): FolderExclusion
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
disabled: Optional[bool] = None,
filter: Optional[str] = None,
folder: Optional[str] = None,
name: Optional[str] = None) -> FolderExclusion
func GetFolderExclusion(ctx *Context, name string, id IDInput, state *FolderExclusionState, opts ...ResourceOption) (*FolderExclusion, error)
public static FolderExclusion Get(string name, Input<string> id, FolderExclusionState? state, CustomResourceOptions? opts = null)
public static FolderExclusion get(String name, Output<String> id, FolderExclusionState 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.
- 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.
- Folder string
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- Name string
- The name of the logging exclusion.
- 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.
- Folder string
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- Name string
- The name of the logging exclusion.
- 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.
- folder String
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- name String
- The name of the logging exclusion.
- 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.
- folder string
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- name string
- The name of the logging exclusion.
- 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.
- folder str
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- name str
- The name of the logging exclusion.
- 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.
- folder String
- The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted.
- name String
- The name of the logging exclusion.
Import
Folder-level logging exclusions can be imported using their URI, e.g.
folders/{{folder}}/exclusions/{{name}}
When using the pulumi import
command, folder-level logging exclusions can be imported using one of the formats above. For example:
$ pulumi import gcp:logging/folderExclusion:FolderExclusion default folders/{{folder}}/exclusions/{{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.