1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. logging
  5. FolderSink
Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi

gcp.logging.FolderSink

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi

    Manages a folder-level logging sink. For more information see:

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const log_bucket = new gcp.storage.Bucket("log-bucket", {
        name: "folder-logging-bucket",
        location: "US",
    });
    const my_folder = new gcp.organizations.Folder("my-folder", {
        displayName: "My folder",
        parent: "organizations/123456",
    });
    const my_sink = new gcp.logging.FolderSink("my-sink", {
        name: "my-sink",
        description: "some explanation on what this is",
        folder: my_folder.name,
        destination: pulumi.interpolate`storage.googleapis.com/${log_bucket.name}`,
        filter: "resource.type = gce_instance AND severity >= WARNING",
    });
    const log_writer = new gcp.projects.IAMBinding("log-writer", {
        project: "your-project-id",
        role: "roles/storage.objectCreator",
        members: [my_sink.writerIdentity],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    log_bucket = gcp.storage.Bucket("log-bucket",
        name="folder-logging-bucket",
        location="US")
    my_folder = gcp.organizations.Folder("my-folder",
        display_name="My folder",
        parent="organizations/123456")
    my_sink = gcp.logging.FolderSink("my-sink",
        name="my-sink",
        description="some explanation on what this is",
        folder=my_folder.name,
        destination=log_bucket.name.apply(lambda name: f"storage.googleapis.com/{name}"),
        filter="resource.type = gce_instance AND severity >= WARNING")
    log_writer = gcp.projects.IAMBinding("log-writer",
        project="your-project-id",
        role="roles/storage.objectCreator",
        members=[my_sink.writer_identity])
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/logging"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/projects"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := storage.NewBucket(ctx, "log-bucket", &storage.BucketArgs{
    			Name:     pulumi.String("folder-logging-bucket"),
    			Location: pulumi.String("US"),
    		})
    		if err != nil {
    			return err
    		}
    		_, 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.NewFolderSink(ctx, "my-sink", &logging.FolderSinkArgs{
    			Name:        pulumi.String("my-sink"),
    			Description: pulumi.String("some explanation on what this is"),
    			Folder:      my_folder.Name,
    			Destination: log_bucket.Name.ApplyT(func(name string) (string, error) {
    				return fmt.Sprintf("storage.googleapis.com/%v", name), nil
    			}).(pulumi.StringOutput),
    			Filter: pulumi.String("resource.type = gce_instance AND severity >= WARNING"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = projects.NewIAMBinding(ctx, "log-writer", &projects.IAMBindingArgs{
    			Project: pulumi.String("your-project-id"),
    			Role:    pulumi.String("roles/storage.objectCreator"),
    			Members: pulumi.StringArray{
    				my_sink.WriterIdentity,
    			},
    		})
    		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 log_bucket = new Gcp.Storage.Bucket("log-bucket", new()
        {
            Name = "folder-logging-bucket",
            Location = "US",
        });
    
        var my_folder = new Gcp.Organizations.Folder("my-folder", new()
        {
            DisplayName = "My folder",
            Parent = "organizations/123456",
        });
    
        var my_sink = new Gcp.Logging.FolderSink("my-sink", new()
        {
            Name = "my-sink",
            Description = "some explanation on what this is",
            Folder = my_folder.Name,
            Destination = log_bucket.Name.Apply(name => $"storage.googleapis.com/{name}"),
            Filter = "resource.type = gce_instance AND severity >= WARNING",
        });
    
        var log_writer = new Gcp.Projects.IAMBinding("log-writer", new()
        {
            Project = "your-project-id",
            Role = "roles/storage.objectCreator",
            Members = new[]
            {
                my_sink.WriterIdentity,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.storage.Bucket;
    import com.pulumi.gcp.storage.BucketArgs;
    import com.pulumi.gcp.organizations.Folder;
    import com.pulumi.gcp.organizations.FolderArgs;
    import com.pulumi.gcp.logging.FolderSink;
    import com.pulumi.gcp.logging.FolderSinkArgs;
    import com.pulumi.gcp.projects.IAMBinding;
    import com.pulumi.gcp.projects.IAMBindingArgs;
    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 log_bucket = new Bucket("log-bucket", BucketArgs.builder()        
                .name("folder-logging-bucket")
                .location("US")
                .build());
    
            var my_folder = new Folder("my-folder", FolderArgs.builder()        
                .displayName("My folder")
                .parent("organizations/123456")
                .build());
    
            var my_sink = new FolderSink("my-sink", FolderSinkArgs.builder()        
                .name("my-sink")
                .description("some explanation on what this is")
                .folder(my_folder.name())
                .destination(log_bucket.name().applyValue(name -> String.format("storage.googleapis.com/%s", name)))
                .filter("resource.type = gce_instance AND severity >= WARNING")
                .build());
    
            var log_writer = new IAMBinding("log-writer", IAMBindingArgs.builder()        
                .project("your-project-id")
                .role("roles/storage.objectCreator")
                .members(my_sink.writerIdentity())
                .build());
    
        }
    }
    
    resources:
      my-sink:
        type: gcp:logging:FolderSink
        properties:
          name: my-sink
          description: some explanation on what this is
          folder: ${["my-folder"].name}
          destination: storage.googleapis.com/${["log-bucket"].name}
          filter: resource.type = gce_instance AND severity >= WARNING
      log-bucket:
        type: gcp:storage:Bucket
        properties:
          name: folder-logging-bucket
          location: US
      log-writer:
        type: gcp:projects:IAMBinding
        properties:
          project: your-project-id
          role: roles/storage.objectCreator
          members:
            - ${["my-sink"].writerIdentity}
      my-folder:
        type: gcp:organizations:Folder
        properties:
          displayName: My folder
          parent: organizations/123456
    

    Create FolderSink Resource

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

    Constructor syntax

    new FolderSink(name: string, args: FolderSinkArgs, opts?: CustomResourceOptions);
    @overload
    def FolderSink(resource_name: str,
                   args: FolderSinkArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def FolderSink(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   destination: Optional[str] = None,
                   folder: Optional[str] = None,
                   bigquery_options: Optional[FolderSinkBigqueryOptionsArgs] = None,
                   description: Optional[str] = None,
                   disabled: Optional[bool] = None,
                   exclusions: Optional[Sequence[FolderSinkExclusionArgs]] = None,
                   filter: Optional[str] = None,
                   include_children: Optional[bool] = None,
                   name: Optional[str] = None)
    func NewFolderSink(ctx *Context, name string, args FolderSinkArgs, opts ...ResourceOption) (*FolderSink, error)
    public FolderSink(string name, FolderSinkArgs args, CustomResourceOptions? opts = null)
    public FolderSink(String name, FolderSinkArgs args)
    public FolderSink(String name, FolderSinkArgs args, CustomResourceOptions options)
    
    type: gcp:logging:FolderSink
    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 FolderSinkArgs
    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 FolderSinkArgs
    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 FolderSinkArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FolderSinkArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FolderSinkArgs
    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 folderSinkResource = new Gcp.Logging.FolderSink("folderSinkResource", new()
    {
        Destination = "string",
        Folder = "string",
        BigqueryOptions = new Gcp.Logging.Inputs.FolderSinkBigqueryOptionsArgs
        {
            UsePartitionedTables = false,
        },
        Description = "string",
        Disabled = false,
        Exclusions = new[]
        {
            new Gcp.Logging.Inputs.FolderSinkExclusionArgs
            {
                Filter = "string",
                Name = "string",
                Description = "string",
                Disabled = false,
            },
        },
        Filter = "string",
        IncludeChildren = false,
        Name = "string",
    });
    
    example, err := logging.NewFolderSink(ctx, "folderSinkResource", &logging.FolderSinkArgs{
    	Destination: pulumi.String("string"),
    	Folder:      pulumi.String("string"),
    	BigqueryOptions: &logging.FolderSinkBigqueryOptionsArgs{
    		UsePartitionedTables: pulumi.Bool(false),
    	},
    	Description: pulumi.String("string"),
    	Disabled:    pulumi.Bool(false),
    	Exclusions: logging.FolderSinkExclusionArray{
    		&logging.FolderSinkExclusionArgs{
    			Filter:      pulumi.String("string"),
    			Name:        pulumi.String("string"),
    			Description: pulumi.String("string"),
    			Disabled:    pulumi.Bool(false),
    		},
    	},
    	Filter:          pulumi.String("string"),
    	IncludeChildren: pulumi.Bool(false),
    	Name:            pulumi.String("string"),
    })
    
    var folderSinkResource = new FolderSink("folderSinkResource", FolderSinkArgs.builder()        
        .destination("string")
        .folder("string")
        .bigqueryOptions(FolderSinkBigqueryOptionsArgs.builder()
            .usePartitionedTables(false)
            .build())
        .description("string")
        .disabled(false)
        .exclusions(FolderSinkExclusionArgs.builder()
            .filter("string")
            .name("string")
            .description("string")
            .disabled(false)
            .build())
        .filter("string")
        .includeChildren(false)
        .name("string")
        .build());
    
    folder_sink_resource = gcp.logging.FolderSink("folderSinkResource",
        destination="string",
        folder="string",
        bigquery_options=gcp.logging.FolderSinkBigqueryOptionsArgs(
            use_partitioned_tables=False,
        ),
        description="string",
        disabled=False,
        exclusions=[gcp.logging.FolderSinkExclusionArgs(
            filter="string",
            name="string",
            description="string",
            disabled=False,
        )],
        filter="string",
        include_children=False,
        name="string")
    
    const folderSinkResource = new gcp.logging.FolderSink("folderSinkResource", {
        destination: "string",
        folder: "string",
        bigqueryOptions: {
            usePartitionedTables: false,
        },
        description: "string",
        disabled: false,
        exclusions: [{
            filter: "string",
            name: "string",
            description: "string",
            disabled: false,
        }],
        filter: "string",
        includeChildren: false,
        name: "string",
    });
    
    type: gcp:logging:FolderSink
    properties:
        bigqueryOptions:
            usePartitionedTables: false
        description: string
        destination: string
        disabled: false
        exclusions:
            - description: string
              disabled: false
              filter: string
              name: string
        filter: string
        folder: string
        includeChildren: false
        name: string
    

    FolderSink 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 FolderSink resource accepts the following input properties:

    Destination string

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    Folder string
    The folder to be exported to the sink. Note that either [FOLDER_ID] or folders/[FOLDER_ID] is accepted.
    BigqueryOptions FolderSinkBigqueryOptions
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    Description string
    A description of this sink. The maximum length of the description is 8000 characters.
    Disabled bool
    If set to True, then this sink is disabled and it does not export any log entries.
    Exclusions List<FolderSinkExclusion>
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    Filter string
    The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
    IncludeChildren bool
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    Name string
    The name of the logging sink.
    Destination string

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    Folder string
    The folder to be exported to the sink. Note that either [FOLDER_ID] or folders/[FOLDER_ID] is accepted.
    BigqueryOptions FolderSinkBigqueryOptionsArgs
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    Description string
    A description of this sink. The maximum length of the description is 8000 characters.
    Disabled bool
    If set to True, then this sink is disabled and it does not export any log entries.
    Exclusions []FolderSinkExclusionArgs
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    Filter string
    The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
    IncludeChildren bool
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    Name string
    The name of the logging sink.
    destination String

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    folder String
    The folder to be exported to the sink. Note that either [FOLDER_ID] or folders/[FOLDER_ID] is accepted.
    bigqueryOptions FolderSinkBigqueryOptions
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    description String
    A description of this sink. The maximum length of the description is 8000 characters.
    disabled Boolean
    If set to True, then this sink is disabled and it does not export any log entries.
    exclusions List<FolderSinkExclusion>
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    filter String
    The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
    includeChildren Boolean
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    name String
    The name of the logging sink.
    destination string

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    folder string
    The folder to be exported to the sink. Note that either [FOLDER_ID] or folders/[FOLDER_ID] is accepted.
    bigqueryOptions FolderSinkBigqueryOptions
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    description string
    A description of this sink. The maximum length of the description is 8000 characters.
    disabled boolean
    If set to True, then this sink is disabled and it does not export any log entries.
    exclusions FolderSinkExclusion[]
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    filter string
    The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
    includeChildren boolean
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    name string
    The name of the logging sink.
    destination str

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    folder str
    The folder to be exported to the sink. Note that either [FOLDER_ID] or folders/[FOLDER_ID] is accepted.
    bigquery_options FolderSinkBigqueryOptionsArgs
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    description str
    A description of this sink. The maximum length of the description is 8000 characters.
    disabled bool
    If set to True, then this sink is disabled and it does not export any log entries.
    exclusions Sequence[FolderSinkExclusionArgs]
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    filter str
    The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
    include_children bool
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    name str
    The name of the logging sink.
    destination String

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    folder String
    The folder to be exported to the sink. Note that either [FOLDER_ID] or folders/[FOLDER_ID] is accepted.
    bigqueryOptions Property Map
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    description String
    A description of this sink. The maximum length of the description is 8000 characters.
    disabled Boolean
    If set to True, then this sink is disabled and it does not export any log entries.
    exclusions List<Property Map>
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    filter String
    The filter to apply when exporting logs. Only log entries that match the filter are exported. See Advanced Log Filters for information on how to write a filter.
    includeChildren Boolean
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    name String
    The name of the logging sink.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    WriterIdentity string
    The identity associated with this sink. This identity must be granted write access to the configured destination.
    Id string
    The provider-assigned unique ID for this managed resource.
    WriterIdentity string
    The identity associated with this sink. This identity must be granted write access to the configured destination.
    id String
    The provider-assigned unique ID for this managed resource.
    writerIdentity String
    The identity associated with this sink. This identity must be granted write access to the configured destination.
    id string
    The provider-assigned unique ID for this managed resource.
    writerIdentity string
    The identity associated with this sink. This identity must be granted write access to the configured destination.
    id str
    The provider-assigned unique ID for this managed resource.
    writer_identity str
    The identity associated with this sink. This identity must be granted write access to the configured destination.
    id String
    The provider-assigned unique ID for this managed resource.
    writerIdentity String
    The identity associated with this sink. This identity must be granted write access to the configured destination.

    Look up Existing FolderSink Resource

    Get an existing FolderSink 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?: FolderSinkState, opts?: CustomResourceOptions): FolderSink
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bigquery_options: Optional[FolderSinkBigqueryOptionsArgs] = None,
            description: Optional[str] = None,
            destination: Optional[str] = None,
            disabled: Optional[bool] = None,
            exclusions: Optional[Sequence[FolderSinkExclusionArgs]] = None,
            filter: Optional[str] = None,
            folder: Optional[str] = None,
            include_children: Optional[bool] = None,
            name: Optional[str] = None,
            writer_identity: Optional[str] = None) -> FolderSink
    func GetFolderSink(ctx *Context, name string, id IDInput, state *FolderSinkState, opts ...ResourceOption) (*FolderSink, error)
    public static FolderSink Get(string name, Input<string> id, FolderSinkState? state, CustomResourceOptions? opts = null)
    public static FolderSink get(String name, Output<String> id, FolderSinkState 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:
    BigqueryOptions FolderSinkBigqueryOptions
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    Description string
    A description of this sink. The maximum length of the description is 8000 characters.
    Destination string

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    Disabled bool
    If set to True, then this sink is disabled and it does not export any log entries.
    Exclusions List<FolderSinkExclusion>
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    Filter string
    The filter to apply when exporting logs. Only log entries that match the filter are exported. 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.
    IncludeChildren bool
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    Name string
    The name of the logging sink.
    WriterIdentity string
    The identity associated with this sink. This identity must be granted write access to the configured destination.
    BigqueryOptions FolderSinkBigqueryOptionsArgs
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    Description string
    A description of this sink. The maximum length of the description is 8000 characters.
    Destination string

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    Disabled bool
    If set to True, then this sink is disabled and it does not export any log entries.
    Exclusions []FolderSinkExclusionArgs
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    Filter string
    The filter to apply when exporting logs. Only log entries that match the filter are exported. 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.
    IncludeChildren bool
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    Name string
    The name of the logging sink.
    WriterIdentity string
    The identity associated with this sink. This identity must be granted write access to the configured destination.
    bigqueryOptions FolderSinkBigqueryOptions
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    description String
    A description of this sink. The maximum length of the description is 8000 characters.
    destination String

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    disabled Boolean
    If set to True, then this sink is disabled and it does not export any log entries.
    exclusions List<FolderSinkExclusion>
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    filter String
    The filter to apply when exporting logs. Only log entries that match the filter are exported. 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.
    includeChildren Boolean
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    name String
    The name of the logging sink.
    writerIdentity String
    The identity associated with this sink. This identity must be granted write access to the configured destination.
    bigqueryOptions FolderSinkBigqueryOptions
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    description string
    A description of this sink. The maximum length of the description is 8000 characters.
    destination string

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    disabled boolean
    If set to True, then this sink is disabled and it does not export any log entries.
    exclusions FolderSinkExclusion[]
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    filter string
    The filter to apply when exporting logs. Only log entries that match the filter are exported. 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.
    includeChildren boolean
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    name string
    The name of the logging sink.
    writerIdentity string
    The identity associated with this sink. This identity must be granted write access to the configured destination.
    bigquery_options FolderSinkBigqueryOptionsArgs
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    description str
    A description of this sink. The maximum length of the description is 8000 characters.
    destination str

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    disabled bool
    If set to True, then this sink is disabled and it does not export any log entries.
    exclusions Sequence[FolderSinkExclusionArgs]
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    filter str
    The filter to apply when exporting logs. Only log entries that match the filter are exported. 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.
    include_children bool
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    name str
    The name of the logging sink.
    writer_identity str
    The identity associated with this sink. This identity must be granted write access to the configured destination.
    bigqueryOptions Property Map
    Options that affect sinks exporting data to BigQuery. Structure documented below.
    description String
    A description of this sink. The maximum length of the description is 8000 characters.
    destination String

    The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, a BigQuery dataset, a Cloud Logging bucket, or a Google Cloud project. Examples:

    • storage.googleapis.com/[GCS_BUCKET]
    • bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]
    • pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]/locations/global/buckets/[BUCKET_ID]
    • logging.googleapis.com/projects/[PROJECT_ID]

    The writer associated with the sink must have access to write to the above resource.

    disabled Boolean
    If set to True, then this sink is disabled and it does not export any log entries.
    exclusions List<Property Map>
    Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below.
    filter String
    The filter to apply when exporting logs. Only log entries that match the filter are exported. 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.
    includeChildren Boolean
    Whether or not to include children folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided folder are included.
    name String
    The name of the logging sink.
    writerIdentity String
    The identity associated with this sink. This identity must be granted write access to the configured destination.

    Supporting Types

    FolderSinkBigqueryOptions, FolderSinkBigqueryOptionsArgs

    UsePartitionedTables bool
    Whether to use BigQuery's partition tables. By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned tables, the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
    UsePartitionedTables bool
    Whether to use BigQuery's partition tables. By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned tables, the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
    usePartitionedTables Boolean
    Whether to use BigQuery's partition tables. By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned tables, the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
    usePartitionedTables boolean
    Whether to use BigQuery's partition tables. By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned tables, the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
    use_partitioned_tables bool
    Whether to use BigQuery's partition tables. By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned tables, the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.
    usePartitionedTables Boolean
    Whether to use BigQuery's partition tables. By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned tables, the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.

    FolderSinkExclusion, FolderSinkExclusionArgs

    Filter string
    An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. See Advanced Log Filters for information on how to write a filter.
    Name string
    A client-assigned identifier, such as load-balancer-exclusion. Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.
    Description string
    A description of this exclusion.
    Disabled bool
    If set to True, then this exclusion is disabled and it does not exclude any log entries.
    Filter string
    An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. See Advanced Log Filters for information on how to write a filter.
    Name string
    A client-assigned identifier, such as load-balancer-exclusion. Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.
    Description string
    A description of this exclusion.
    Disabled bool
    If set to True, then this exclusion is disabled and it does not exclude any log entries.
    filter String
    An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. See Advanced Log Filters for information on how to write a filter.
    name String
    A client-assigned identifier, such as load-balancer-exclusion. Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.
    description String
    A description of this exclusion.
    disabled Boolean
    If set to True, then this exclusion is disabled and it does not exclude any log entries.
    filter string
    An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. See Advanced Log Filters for information on how to write a filter.
    name string
    A client-assigned identifier, such as load-balancer-exclusion. Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.
    description string
    A description of this exclusion.
    disabled boolean
    If set to True, then this exclusion is disabled and it does not exclude any log entries.
    filter str
    An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. See Advanced Log Filters for information on how to write a filter.
    name str
    A client-assigned identifier, such as load-balancer-exclusion. Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.
    description str
    A description of this exclusion.
    disabled bool
    If set to True, then this exclusion is disabled and it does not exclude any log entries.
    filter String
    An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. See Advanced Log Filters for information on how to write a filter.
    name String
    A client-assigned identifier, such as load-balancer-exclusion. Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.
    description String
    A description of this exclusion.
    disabled Boolean
    If set to True, then this exclusion is disabled and it does not exclude any log entries.

    Import

    Folder-level logging sinks can be imported using this format:

    • folders/{{folder_id}}/sinks/{{name}}

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

    $ pulumi import gcp:logging/folderSink:FolderSink default folders/{{folder_id}}/sinks/{{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.19.0 published on Thursday, Apr 18, 2024 by Pulumi