Class OrganizationSink
Manages a organization-level logging sink. For more information see the official documentation and Exporting Logs in the API.
Note that you must have the "Logs Configuration Writer" IAM role (roles/logging.configWriter)
granted to the credentials used with this provider.
Example Usage
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var log_bucket = new Gcp.Storage.Bucket("log-bucket", new Gcp.Storage.BucketArgs
{
});
var my_sink = new Gcp.Logging.OrganizationSink("my-sink", new Gcp.Logging.OrganizationSinkArgs
{
OrgId = "123456789",
Destination = log_bucket.Name.Apply(name => $"storage.googleapis.com/{name}"),
Filter = "resource.type = gce_instance AND severity >= WARN",
});
var log_writer = new Gcp.Projects.IAMMember("log-writer", new Gcp.Projects.IAMMemberArgs
{
Role = "roles/storage.objectCreator",
Member = my_sink.WriterIdentity,
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Logging
Assembly: Pulumi.Gcp.dll
Syntax
public class OrganizationSink : CustomResource
Constructors
View SourceOrganizationSink(String, OrganizationSinkArgs, CustomResourceOptions)
Create a OrganizationSink resource with the given unique name, arguments, and options.
Declaration
public OrganizationSink(string name, OrganizationSinkArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| OrganizationSinkArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceBigqueryOptions
Options that affect sinks exporting data to BigQuery. Structure documented below.
Declaration
public Output<OrganizationSinkBigqueryOptions> BigqueryOptions { get; }
Property Value
| Type | Description |
|---|---|
| Output<OrganizationSinkBigqueryOptions> |
Destination
The destination of the sink (or, in other words, where logs are written to). Can be a Cloud Storage bucket, a PubSub topic, or a BigQuery dataset. Examples:
Declaration
public Output<string> Destination { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Filter
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.
Declaration
public Output<string> Filter { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IncludeChildren
Whether or not to include children organizations in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided organization are included.
Declaration
public Output<bool?> IncludeChildren { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Name
The name of the logging sink.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
OrgId
The numeric ID of the organization to be exported to the sink.
Declaration
public Output<string> OrgId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
WriterIdentity
The identity associated with this sink. This identity must be granted write access to the
configured destination.
Declaration
public Output<string> WriterIdentity { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, OrganizationSinkState, CustomResourceOptions)
Get an existing OrganizationSink resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static OrganizationSink Get(string name, Input<string> id, OrganizationSinkState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| OrganizationSinkState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| OrganizationSink |