1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Logging
  5. LogGroup
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

oci.Logging.LogGroup

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

    This resource provides the Log Group resource in Oracle Cloud Infrastructure Logging service.

    Create a new log group with a unique display name. This call fails if the log group is already created with the same displayName in the compartment.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testLogGroup = new oci.logging.LogGroup("testLogGroup", {
        compartmentId: _var.compartment_id,
        displayName: _var.log_group_display_name,
        definedTags: {
            "Operations.CostCenter": "42",
        },
        description: _var.log_group_description,
        freeformTags: {
            Department: "Finance",
        },
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_log_group = oci.logging.LogGroup("testLogGroup",
        compartment_id=var["compartment_id"],
        display_name=var["log_group_display_name"],
        defined_tags={
            "Operations.CostCenter": "42",
        },
        description=var["log_group_description"],
        freeform_tags={
            "Department": "Finance",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/Logging"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Logging.NewLogGroup(ctx, "testLogGroup", &Logging.LogGroupArgs{
    			CompartmentId: pulumi.Any(_var.Compartment_id),
    			DisplayName:   pulumi.Any(_var.Log_group_display_name),
    			DefinedTags: pulumi.Map{
    				"Operations.CostCenter": pulumi.Any("42"),
    			},
    			Description: pulumi.Any(_var.Log_group_description),
    			FreeformTags: pulumi.Map{
    				"Department": pulumi.Any("Finance"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testLogGroup = new Oci.Logging.LogGroup("testLogGroup", new()
        {
            CompartmentId = @var.Compartment_id,
            DisplayName = @var.Log_group_display_name,
            DefinedTags = 
            {
                { "Operations.CostCenter", "42" },
            },
            Description = @var.Log_group_description,
            FreeformTags = 
            {
                { "Department", "Finance" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Logging.LogGroup;
    import com.pulumi.oci.Logging.LogGroupArgs;
    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 testLogGroup = new LogGroup("testLogGroup", LogGroupArgs.builder()        
                .compartmentId(var_.compartment_id())
                .displayName(var_.log_group_display_name())
                .definedTags(Map.of("Operations.CostCenter", "42"))
                .description(var_.log_group_description())
                .freeformTags(Map.of("Department", "Finance"))
                .build());
    
        }
    }
    
    resources:
      testLogGroup:
        type: oci:Logging:LogGroup
        properties:
          #Required
          compartmentId: ${var.compartment_id}
          displayName: ${var.log_group_display_name}
          #Optional
          definedTags:
            Operations.CostCenter: '42'
          description: ${var.log_group_description}
          freeformTags:
            Department: Finance
    

    Create LogGroup Resource

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

    Constructor syntax

    new LogGroup(name: string, args: LogGroupArgs, opts?: CustomResourceOptions);
    @overload
    def LogGroup(resource_name: str,
                 args: LogGroupArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def LogGroup(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 compartment_id: Optional[str] = None,
                 display_name: Optional[str] = None,
                 defined_tags: Optional[Mapping[str, Any]] = None,
                 description: Optional[str] = None,
                 freeform_tags: Optional[Mapping[str, Any]] = None)
    func NewLogGroup(ctx *Context, name string, args LogGroupArgs, opts ...ResourceOption) (*LogGroup, error)
    public LogGroup(string name, LogGroupArgs args, CustomResourceOptions? opts = null)
    public LogGroup(String name, LogGroupArgs args)
    public LogGroup(String name, LogGroupArgs args, CustomResourceOptions options)
    
    type: oci:Logging:LogGroup
    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 LogGroupArgs
    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 LogGroupArgs
    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 LogGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LogGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LogGroupArgs
    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 logGroupResource = new Oci.Logging.LogGroup("logGroupResource", new()
    {
        CompartmentId = "string",
        DisplayName = "string",
        DefinedTags = 
        {
            { "string", "any" },
        },
        Description = "string",
        FreeformTags = 
        {
            { "string", "any" },
        },
    });
    
    example, err := Logging.NewLogGroup(ctx, "logGroupResource", &Logging.LogGroupArgs{
    	CompartmentId: pulumi.String("string"),
    	DisplayName:   pulumi.String("string"),
    	DefinedTags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	Description: pulumi.String("string"),
    	FreeformTags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    var logGroupResource = new LogGroup("logGroupResource", LogGroupArgs.builder()        
        .compartmentId("string")
        .displayName("string")
        .definedTags(Map.of("string", "any"))
        .description("string")
        .freeformTags(Map.of("string", "any"))
        .build());
    
    log_group_resource = oci.logging.LogGroup("logGroupResource",
        compartment_id="string",
        display_name="string",
        defined_tags={
            "string": "any",
        },
        description="string",
        freeform_tags={
            "string": "any",
        })
    
    const logGroupResource = new oci.logging.LogGroup("logGroupResource", {
        compartmentId: "string",
        displayName: "string",
        definedTags: {
            string: "any",
        },
        description: "string",
        freeformTags: {
            string: "any",
        },
    });
    
    type: oci:Logging:LogGroup
    properties:
        compartmentId: string
        definedTags:
            string: any
        description: string
        displayName: string
        freeformTags:
            string: any
    

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

    CompartmentId string
    (Updatable) The OCID of the compartment that the resource belongs to.
    DisplayName string
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    DefinedTags Dictionary<string, object>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    Description string
    (Updatable) Description for this resource.
    FreeformTags Dictionary<string, object>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CompartmentId string
    (Updatable) The OCID of the compartment that the resource belongs to.
    DisplayName string
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    DefinedTags map[string]interface{}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    Description string
    (Updatable) Description for this resource.
    FreeformTags map[string]interface{}

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId String
    (Updatable) The OCID of the compartment that the resource belongs to.
    displayName String
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    definedTags Map<String,Object>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description String
    (Updatable) Description for this resource.
    freeformTags Map<String,Object>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId string
    (Updatable) The OCID of the compartment that the resource belongs to.
    displayName string
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    definedTags {[key: string]: any}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description string
    (Updatable) Description for this resource.
    freeformTags {[key: string]: any}

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartment_id str
    (Updatable) The OCID of the compartment that the resource belongs to.
    display_name str
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    defined_tags Mapping[str, Any]
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description str
    (Updatable) Description for this resource.
    freeform_tags Mapping[str, Any]

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentId String
    (Updatable) The OCID of the compartment that the resource belongs to.
    displayName String
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    definedTags Map<Any>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description String
    (Updatable) Description for this resource.
    freeformTags Map<Any>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    The log group object state.
    TimeCreated string
    Time the resource was created.
    TimeLastModified string
    Time the resource was last modified.
    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    The log group object state.
    TimeCreated string
    Time the resource was created.
    TimeLastModified string
    Time the resource was last modified.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    The log group object state.
    timeCreated String
    Time the resource was created.
    timeLastModified String
    Time the resource was last modified.
    id string
    The provider-assigned unique ID for this managed resource.
    state string
    The log group object state.
    timeCreated string
    Time the resource was created.
    timeLastModified string
    Time the resource was last modified.
    id str
    The provider-assigned unique ID for this managed resource.
    state str
    The log group object state.
    time_created str
    Time the resource was created.
    time_last_modified str
    Time the resource was last modified.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    The log group object state.
    timeCreated String
    Time the resource was created.
    timeLastModified String
    Time the resource was last modified.

    Look up Existing LogGroup Resource

    Get an existing LogGroup 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?: LogGroupState, opts?: CustomResourceOptions): LogGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            compartment_id: Optional[str] = None,
            defined_tags: Optional[Mapping[str, Any]] = None,
            description: Optional[str] = None,
            display_name: Optional[str] = None,
            freeform_tags: Optional[Mapping[str, Any]] = None,
            state: Optional[str] = None,
            time_created: Optional[str] = None,
            time_last_modified: Optional[str] = None) -> LogGroup
    func GetLogGroup(ctx *Context, name string, id IDInput, state *LogGroupState, opts ...ResourceOption) (*LogGroup, error)
    public static LogGroup Get(string name, Input<string> id, LogGroupState? state, CustomResourceOptions? opts = null)
    public static LogGroup get(String name, Output<String> id, LogGroupState 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:
    CompartmentId string
    (Updatable) The OCID of the compartment that the resource belongs to.
    DefinedTags Dictionary<string, object>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    Description string
    (Updatable) Description for this resource.
    DisplayName string
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    FreeformTags Dictionary<string, object>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    State string
    The log group object state.
    TimeCreated string
    Time the resource was created.
    TimeLastModified string
    Time the resource was last modified.
    CompartmentId string
    (Updatable) The OCID of the compartment that the resource belongs to.
    DefinedTags map[string]interface{}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    Description string
    (Updatable) Description for this resource.
    DisplayName string
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    FreeformTags map[string]interface{}

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    State string
    The log group object state.
    TimeCreated string
    Time the resource was created.
    TimeLastModified string
    Time the resource was last modified.
    compartmentId String
    (Updatable) The OCID of the compartment that the resource belongs to.
    definedTags Map<String,Object>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description String
    (Updatable) Description for this resource.
    displayName String
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    freeformTags Map<String,Object>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state String
    The log group object state.
    timeCreated String
    Time the resource was created.
    timeLastModified String
    Time the resource was last modified.
    compartmentId string
    (Updatable) The OCID of the compartment that the resource belongs to.
    definedTags {[key: string]: any}
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description string
    (Updatable) Description for this resource.
    displayName string
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    freeformTags {[key: string]: any}

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state string
    The log group object state.
    timeCreated string
    Time the resource was created.
    timeLastModified string
    Time the resource was last modified.
    compartment_id str
    (Updatable) The OCID of the compartment that the resource belongs to.
    defined_tags Mapping[str, Any]
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description str
    (Updatable) Description for this resource.
    display_name str
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    freeform_tags Mapping[str, Any]

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state str
    The log group object state.
    time_created str
    Time the resource was created.
    time_last_modified str
    Time the resource was last modified.
    compartmentId String
    (Updatable) The OCID of the compartment that the resource belongs to.
    definedTags Map<Any>
    (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description String
    (Updatable) Description for this resource.
    displayName String
    (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    freeformTags Map<Any>

    (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    state String
    The log group object state.
    timeCreated String
    Time the resource was created.
    timeLastModified String
    Time the resource was last modified.

    Import

    LogGroups can be imported using the id, e.g.

    $ pulumi import oci:Logging/logGroup:LogGroup test_log_group "id"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi