oci.Logging.LogGroup
Explore with Pulumi AI
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("test_log_group", {
compartmentId: compartmentId,
displayName: logGroupDisplayName,
definedTags: {
"Operations.CostCenter": "42",
},
description: logGroupDescription,
freeformTags: {
Department: "Finance",
},
});
import pulumi
import pulumi_oci as oci
test_log_group = oci.logging.LogGroup("test_log_group",
compartment_id=compartment_id,
display_name=log_group_display_name,
defined_tags={
"Operations.CostCenter": "42",
},
description=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, "test_log_group", &Logging.LogGroupArgs{
CompartmentId: pulumi.Any(compartmentId),
DisplayName: pulumi.Any(logGroupDisplayName),
DefinedTags: pulumi.Map{
"Operations.CostCenter": pulumi.Any("42"),
},
Description: pulumi.Any(logGroupDescription),
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("test_log_group", new()
{
CompartmentId = compartmentId,
DisplayName = logGroupDisplayName,
DefinedTags =
{
{ "Operations.CostCenter", "42" },
},
Description = logGroupDescription,
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(compartmentId)
.displayName(logGroupDisplayName)
.definedTags(Map.of("Operations.CostCenter", "42"))
.description(logGroupDescription)
.freeformTags(Map.of("Department", "Finance"))
.build());
}
}
resources:
testLogGroup:
type: oci:Logging:LogGroup
name: test_log_group
properties:
compartmentId: ${compartmentId}
displayName: ${logGroupDisplayName}
definedTags:
Operations.CostCenter: '42'
description: ${logGroupDescription}
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.
Constructor 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:
- Compartment
Id string - (Updatable) The OCID of the compartment that the resource belongs to.
- Display
Name string - (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- 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.
- 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
- Compartment
Id string - (Updatable) The OCID of the compartment that the resource belongs to.
- Display
Name string - (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- 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.
- 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
- compartment
Id String - (Updatable) The OCID of the compartment that the resource belongs to.
- display
Name String - (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- 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.
- 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
- compartment
Id string - (Updatable) The OCID of the compartment that the resource belongs to.
- display
Name string - (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- {[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.
- {[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.
- 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.
- 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
- compartment
Id String - (Updatable) The OCID of the compartment that the resource belongs to.
- display
Name String - (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- 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.
- 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.
- Time
Created string - Time the resource was created.
- Time
Last stringModified - Time the resource was last modified.
- Id string
- The provider-assigned unique ID for this managed resource.
- State string
- The log group object state.
- Time
Created string - Time the resource was created.
- Time
Last stringModified - Time the resource was last modified.
- id String
- The provider-assigned unique ID for this managed resource.
- state String
- The log group object state.
- time
Created String - Time the resource was created.
- time
Last StringModified - Time the resource was last modified.
- id string
- The provider-assigned unique ID for this managed resource.
- state string
- The log group object state.
- time
Created string - Time the resource was created.
- time
Last stringModified - 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_ strmodified - Time the resource was last modified.
- id String
- The provider-assigned unique ID for this managed resource.
- state String
- The log group object state.
- time
Created String - Time the resource was created.
- time
Last StringModified - 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.
- Compartment
Id string - (Updatable) The OCID of the compartment that the resource belongs to.
- 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.
- Display
Name string - (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- 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.
- Time
Created string - Time the resource was created.
- Time
Last stringModified - Time the resource was last modified.
- Compartment
Id string - (Updatable) The OCID of the compartment that the resource belongs to.
- 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.
- Display
Name string - (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- 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.
- Time
Created string - Time the resource was created.
- Time
Last stringModified - Time the resource was last modified.
- compartment
Id String - (Updatable) The OCID of the compartment that the resource belongs to.
- 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.
- display
Name String - (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- 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.
- time
Created String - Time the resource was created.
- time
Last StringModified - Time the resource was last modified.
- compartment
Id string - (Updatable) The OCID of the compartment that the resource belongs to.
- {[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.
- display
Name string - (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- {[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.
- time
Created string - Time the resource was created.
- time
Last stringModified - Time the resource was last modified.
- compartment_
id str - (Updatable) The OCID of the compartment that the resource belongs to.
- 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.
- 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_ strmodified - Time the resource was last modified.
- compartment
Id String - (Updatable) The OCID of the compartment that the resource belongs to.
- 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.
- display
Name String - (Updatable) The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
- 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.
- time
Created String - Time the resource was created.
- time
Last StringModified - 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.