1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. logging
  5. LogScope
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.logging.LogScope

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    Describes a group of resources to read log entries from

    To get more information about LogScope, see:

    Example Usage

    Logging Log Scope Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const loggingLogScope = new gcp.logging.LogScope("logging_log_scope", {
        parent: "projects/my-project-name",
        location: "global",
        name: "projects/my-project-name/locations/global/logScopes/my-log-scope",
        resourceNames: [
            "projects/my-project-name",
            "projects/my-project-name/locations/global/buckets/_Default/views/view1",
            "projects/my-project-name/locations/global/buckets/_Default/views/view2",
        ],
        description: "A log scope configured with Terraform",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    logging_log_scope = gcp.logging.LogScope("logging_log_scope",
        parent="projects/my-project-name",
        location="global",
        name="projects/my-project-name/locations/global/logScopes/my-log-scope",
        resource_names=[
            "projects/my-project-name",
            "projects/my-project-name/locations/global/buckets/_Default/views/view1",
            "projects/my-project-name/locations/global/buckets/_Default/views/view2",
        ],
        description="A log scope configured with Terraform")
    
    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.NewLogScope(ctx, "logging_log_scope", &logging.LogScopeArgs{
    			Parent:   pulumi.String("projects/my-project-name"),
    			Location: pulumi.String("global"),
    			Name:     pulumi.String("projects/my-project-name/locations/global/logScopes/my-log-scope"),
    			ResourceNames: pulumi.StringArray{
    				pulumi.String("projects/my-project-name"),
    				pulumi.String("projects/my-project-name/locations/global/buckets/_Default/views/view1"),
    				pulumi.String("projects/my-project-name/locations/global/buckets/_Default/views/view2"),
    			},
    			Description: pulumi.String("A log scope configured with Terraform"),
    		})
    		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 loggingLogScope = new Gcp.Logging.LogScope("logging_log_scope", new()
        {
            Parent = "projects/my-project-name",
            Location = "global",
            Name = "projects/my-project-name/locations/global/logScopes/my-log-scope",
            ResourceNames = new[]
            {
                "projects/my-project-name",
                "projects/my-project-name/locations/global/buckets/_Default/views/view1",
                "projects/my-project-name/locations/global/buckets/_Default/views/view2",
            },
            Description = "A log scope configured with Terraform",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.logging.LogScope;
    import com.pulumi.gcp.logging.LogScopeArgs;
    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 loggingLogScope = new LogScope("loggingLogScope", LogScopeArgs.builder()
                .parent("projects/my-project-name")
                .location("global")
                .name("projects/my-project-name/locations/global/logScopes/my-log-scope")
                .resourceNames(            
                    "projects/my-project-name",
                    "projects/my-project-name/locations/global/buckets/_Default/views/view1",
                    "projects/my-project-name/locations/global/buckets/_Default/views/view2")
                .description("A log scope configured with Terraform")
                .build());
    
        }
    }
    
    resources:
      loggingLogScope:
        type: gcp:logging:LogScope
        name: logging_log_scope
        properties:
          parent: projects/my-project-name
          location: global
          name: projects/my-project-name/locations/global/logScopes/my-log-scope
          resourceNames:
            - projects/my-project-name
            - projects/my-project-name/locations/global/buckets/_Default/views/view1
            - projects/my-project-name/locations/global/buckets/_Default/views/view2
          description: A log scope configured with Terraform
    

    Create LogScope Resource

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

    Constructor syntax

    new LogScope(name: string, args: LogScopeArgs, opts?: CustomResourceOptions);
    @overload
    def LogScope(resource_name: str,
                 args: LogScopeArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def LogScope(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 resource_names: Optional[Sequence[str]] = None,
                 description: Optional[str] = None,
                 location: Optional[str] = None,
                 name: Optional[str] = None,
                 parent: Optional[str] = None)
    func NewLogScope(ctx *Context, name string, args LogScopeArgs, opts ...ResourceOption) (*LogScope, error)
    public LogScope(string name, LogScopeArgs args, CustomResourceOptions? opts = null)
    public LogScope(String name, LogScopeArgs args)
    public LogScope(String name, LogScopeArgs args, CustomResourceOptions options)
    
    type: gcp:logging:LogScope
    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 LogScopeArgs
    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 LogScopeArgs
    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 LogScopeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LogScopeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LogScopeArgs
    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 logScopeResource = new Gcp.Logging.LogScope("logScopeResource", new()
    {
        ResourceNames = new[]
        {
            "string",
        },
        Description = "string",
        Location = "string",
        Name = "string",
        Parent = "string",
    });
    
    example, err := logging.NewLogScope(ctx, "logScopeResource", &logging.LogScopeArgs{
    	ResourceNames: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	Location:    pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	Parent:      pulumi.String("string"),
    })
    
    var logScopeResource = new LogScope("logScopeResource", LogScopeArgs.builder()
        .resourceNames("string")
        .description("string")
        .location("string")
        .name("string")
        .parent("string")
        .build());
    
    log_scope_resource = gcp.logging.LogScope("logScopeResource",
        resource_names=["string"],
        description="string",
        location="string",
        name="string",
        parent="string")
    
    const logScopeResource = new gcp.logging.LogScope("logScopeResource", {
        resourceNames: ["string"],
        description: "string",
        location: "string",
        name: "string",
        parent: "string",
    });
    
    type: gcp:logging:LogScope
    properties:
        description: string
        location: string
        name: string
        parent: string
        resourceNames:
            - string
    

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

    ResourceNames List<string>
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    Description string
    Describes this log scopes.
    Location string
    The location of the resource. The only supported location is global so far.
    Name string
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    Parent string
    The parent of the resource.
    ResourceNames []string
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    Description string
    Describes this log scopes.
    Location string
    The location of the resource. The only supported location is global so far.
    Name string
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    Parent string
    The parent of the resource.
    resourceNames List<String>
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    description String
    Describes this log scopes.
    location String
    The location of the resource. The only supported location is global so far.
    name String
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    parent String
    The parent of the resource.
    resourceNames string[]
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    description string
    Describes this log scopes.
    location string
    The location of the resource. The only supported location is global so far.
    name string
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    parent string
    The parent of the resource.
    resource_names Sequence[str]
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    description str
    Describes this log scopes.
    location str
    The location of the resource. The only supported location is global so far.
    name str
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    parent str
    The parent of the resource.
    resourceNames List<String>
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    description String
    Describes this log scopes.
    location String
    The location of the resource. The only supported location is global so far.
    name String
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    parent String
    The parent of the resource.

    Outputs

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

    CreateTime string
    Output only. The creation timestamp of the log scopes.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdateTime string
    Output only. The last update timestamp of the log scopes.
    CreateTime string
    Output only. The creation timestamp of the log scopes.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdateTime string
    Output only. The last update timestamp of the log scopes.
    createTime String
    Output only. The creation timestamp of the log scopes.
    id String
    The provider-assigned unique ID for this managed resource.
    updateTime String
    Output only. The last update timestamp of the log scopes.
    createTime string
    Output only. The creation timestamp of the log scopes.
    id string
    The provider-assigned unique ID for this managed resource.
    updateTime string
    Output only. The last update timestamp of the log scopes.
    create_time str
    Output only. The creation timestamp of the log scopes.
    id str
    The provider-assigned unique ID for this managed resource.
    update_time str
    Output only. The last update timestamp of the log scopes.
    createTime String
    Output only. The creation timestamp of the log scopes.
    id String
    The provider-assigned unique ID for this managed resource.
    updateTime String
    Output only. The last update timestamp of the log scopes.

    Look up Existing LogScope Resource

    Get an existing LogScope 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?: LogScopeState, opts?: CustomResourceOptions): LogScope
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            parent: Optional[str] = None,
            resource_names: Optional[Sequence[str]] = None,
            update_time: Optional[str] = None) -> LogScope
    func GetLogScope(ctx *Context, name string, id IDInput, state *LogScopeState, opts ...ResourceOption) (*LogScope, error)
    public static LogScope Get(string name, Input<string> id, LogScopeState? state, CustomResourceOptions? opts = null)
    public static LogScope get(String name, Output<String> id, LogScopeState 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:
    CreateTime string
    Output only. The creation timestamp of the log scopes.
    Description string
    Describes this log scopes.
    Location string
    The location of the resource. The only supported location is global so far.
    Name string
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    Parent string
    The parent of the resource.
    ResourceNames List<string>
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    UpdateTime string
    Output only. The last update timestamp of the log scopes.
    CreateTime string
    Output only. The creation timestamp of the log scopes.
    Description string
    Describes this log scopes.
    Location string
    The location of the resource. The only supported location is global so far.
    Name string
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    Parent string
    The parent of the resource.
    ResourceNames []string
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    UpdateTime string
    Output only. The last update timestamp of the log scopes.
    createTime String
    Output only. The creation timestamp of the log scopes.
    description String
    Describes this log scopes.
    location String
    The location of the resource. The only supported location is global so far.
    name String
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    parent String
    The parent of the resource.
    resourceNames List<String>
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    updateTime String
    Output only. The last update timestamp of the log scopes.
    createTime string
    Output only. The creation timestamp of the log scopes.
    description string
    Describes this log scopes.
    location string
    The location of the resource. The only supported location is global so far.
    name string
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    parent string
    The parent of the resource.
    resourceNames string[]
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    updateTime string
    Output only. The last update timestamp of the log scopes.
    create_time str
    Output only. The creation timestamp of the log scopes.
    description str
    Describes this log scopes.
    location str
    The location of the resource. The only supported location is global so far.
    name str
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    parent str
    The parent of the resource.
    resource_names Sequence[str]
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    update_time str
    Output only. The last update timestamp of the log scopes.
    createTime String
    Output only. The creation timestamp of the log scopes.
    description String
    Describes this log scopes.
    location String
    The location of the resource. The only supported location is global so far.
    name String
    The resource name of the log scope. For example: `projects/my-project/locations/global/logScopes/my-log-scope`
    parent String
    The parent of the resource.
    resourceNames List<String>
    Names of one or more parent resources : * `projects/[PROJECT_ID]` May alternatively be one or more views : * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` A log scope can include a maximum of 50 projects and a maximum of 100 resources in total.


    updateTime String
    Output only. The last update timestamp of the log scopes.

    Import

    LogScope can be imported using any of these accepted formats:

    • {{parent}}/locations/{{location}}/logScopes/{{name}}

    When using the pulumi import command, LogScope can be imported using one of the formats above. For example:

    $ pulumi import gcp:logging/logScope:LogScope default {{parent}}/locations/{{location}}/logScopes/{{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 v8.9.3 published on Monday, Nov 18, 2024 by Pulumi