1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. gemini
  5. LoggingSetting
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.gemini.LoggingSetting

Explore with Pulumi AI

The resource for managing Logging settings for Admin Control.

Example Usage

Gemini Logging Setting Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const example = new gcp.gemini.LoggingSetting("example", {
    loggingSettingId: "ls1-tf",
    location: "global",
    labels: {
        my_key: "my_value",
    },
    logPromptsAndResponses: true,
    logMetadata: true,
});
Copy
import pulumi
import pulumi_gcp as gcp

example = gcp.gemini.LoggingSetting("example",
    logging_setting_id="ls1-tf",
    location="global",
    labels={
        "my_key": "my_value",
    },
    log_prompts_and_responses=True,
    log_metadata=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/gemini"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gemini.NewLoggingSetting(ctx, "example", &gemini.LoggingSettingArgs{
			LoggingSettingId: pulumi.String("ls1-tf"),
			Location:         pulumi.String("global"),
			Labels: pulumi.StringMap{
				"my_key": pulumi.String("my_value"),
			},
			LogPromptsAndResponses: pulumi.Bool(true),
			LogMetadata:            pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var example = new Gcp.Gemini.LoggingSetting("example", new()
    {
        LoggingSettingId = "ls1-tf",
        Location = "global",
        Labels = 
        {
            { "my_key", "my_value" },
        },
        LogPromptsAndResponses = true,
        LogMetadata = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.gemini.LoggingSetting;
import com.pulumi.gcp.gemini.LoggingSettingArgs;
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 example = new LoggingSetting("example", LoggingSettingArgs.builder()
            .loggingSettingId("ls1-tf")
            .location("global")
            .labels(Map.of("my_key", "my_value"))
            .logPromptsAndResponses(true)
            .logMetadata(true)
            .build());

    }
}
Copy
resources:
  example:
    type: gcp:gemini:LoggingSetting
    properties:
      loggingSettingId: ls1-tf
      location: global
      labels:
        my_key: my_value
      logPromptsAndResponses: true
      logMetadata: true
Copy

Create LoggingSetting Resource

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

Constructor syntax

new LoggingSetting(name: string, args: LoggingSettingArgs, opts?: CustomResourceOptions);
@overload
def LoggingSetting(resource_name: str,
                   args: LoggingSettingArgs,
                   opts: Optional[ResourceOptions] = None)

@overload
def LoggingSetting(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   location: Optional[str] = None,
                   logging_setting_id: Optional[str] = None,
                   labels: Optional[Mapping[str, str]] = None,
                   log_metadata: Optional[bool] = None,
                   log_prompts_and_responses: Optional[bool] = None,
                   project: Optional[str] = None)
func NewLoggingSetting(ctx *Context, name string, args LoggingSettingArgs, opts ...ResourceOption) (*LoggingSetting, error)
public LoggingSetting(string name, LoggingSettingArgs args, CustomResourceOptions? opts = null)
public LoggingSetting(String name, LoggingSettingArgs args)
public LoggingSetting(String name, LoggingSettingArgs args, CustomResourceOptions options)
type: gcp:gemini:LoggingSetting
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. LoggingSettingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. LoggingSettingArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. LoggingSettingArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. LoggingSettingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. LoggingSettingArgs
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 loggingSettingResource = new Gcp.Gemini.LoggingSetting("loggingSettingResource", new()
{
    Location = "string",
    LoggingSettingId = "string",
    Labels = 
    {
        { "string", "string" },
    },
    LogMetadata = false,
    LogPromptsAndResponses = false,
    Project = "string",
});
Copy
example, err := gemini.NewLoggingSetting(ctx, "loggingSettingResource", &gemini.LoggingSettingArgs{
	Location:         pulumi.String("string"),
	LoggingSettingId: pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	LogMetadata:            pulumi.Bool(false),
	LogPromptsAndResponses: pulumi.Bool(false),
	Project:                pulumi.String("string"),
})
Copy
var loggingSettingResource = new LoggingSetting("loggingSettingResource", LoggingSettingArgs.builder()
    .location("string")
    .loggingSettingId("string")
    .labels(Map.of("string", "string"))
    .logMetadata(false)
    .logPromptsAndResponses(false)
    .project("string")
    .build());
Copy
logging_setting_resource = gcp.gemini.LoggingSetting("loggingSettingResource",
    location="string",
    logging_setting_id="string",
    labels={
        "string": "string",
    },
    log_metadata=False,
    log_prompts_and_responses=False,
    project="string")
Copy
const loggingSettingResource = new gcp.gemini.LoggingSetting("loggingSettingResource", {
    location: "string",
    loggingSettingId: "string",
    labels: {
        string: "string",
    },
    logMetadata: false,
    logPromptsAndResponses: false,
    project: "string",
});
Copy
type: gcp:gemini:LoggingSetting
properties:
    labels:
        string: string
    location: string
    logMetadata: false
    logPromptsAndResponses: false
    loggingSettingId: string
    project: string
Copy

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

Location
This property is required.
Changes to this property will trigger replacement.
string
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
LoggingSettingId
This property is required.
Changes to this property will trigger replacement.
string
Id of the Logging Setting.


Labels Dictionary<string, string>
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
LogMetadata bool
Whether to log metadata.
LogPromptsAndResponses bool
Whether to log prompts and responses.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Location
This property is required.
Changes to this property will trigger replacement.
string
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
LoggingSettingId
This property is required.
Changes to this property will trigger replacement.
string
Id of the Logging Setting.


Labels map[string]string
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
LogMetadata bool
Whether to log metadata.
LogPromptsAndResponses bool
Whether to log prompts and responses.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
location
This property is required.
Changes to this property will trigger replacement.
String
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
loggingSettingId
This property is required.
Changes to this property will trigger replacement.
String
Id of the Logging Setting.


labels Map<String,String>
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
logMetadata Boolean
Whether to log metadata.
logPromptsAndResponses Boolean
Whether to log prompts and responses.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
location
This property is required.
Changes to this property will trigger replacement.
string
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
loggingSettingId
This property is required.
Changes to this property will trigger replacement.
string
Id of the Logging Setting.


labels {[key: string]: string}
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
logMetadata boolean
Whether to log metadata.
logPromptsAndResponses boolean
Whether to log prompts and responses.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
location
This property is required.
Changes to this property will trigger replacement.
str
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
logging_setting_id
This property is required.
Changes to this property will trigger replacement.
str
Id of the Logging Setting.


labels Mapping[str, str]
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
log_metadata bool
Whether to log metadata.
log_prompts_and_responses bool
Whether to log prompts and responses.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
location
This property is required.
Changes to this property will trigger replacement.
String
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
loggingSettingId
This property is required.
Changes to this property will trigger replacement.
String
Id of the Logging Setting.


labels Map<String>
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
logMetadata Boolean
Whether to log metadata.
logPromptsAndResponses Boolean
Whether to log prompts and responses.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Outputs

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

CreateTime string
Create time stamp.
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
UpdateTime string
Update time stamp.
CreateTime string
Create time stamp.
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
UpdateTime string
Update time stamp.
createTime String
Create time stamp.
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id String
The provider-assigned unique ID for this managed resource.
name String
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
updateTime String
Update time stamp.
createTime string
Create time stamp.
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id string
The provider-assigned unique ID for this managed resource.
name string
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
updateTime string
Update time stamp.
create_time str
Create time stamp.
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id str
The provider-assigned unique ID for this managed resource.
name str
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
update_time str
Update time stamp.
createTime String
Create time stamp.
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
id String
The provider-assigned unique ID for this managed resource.
name String
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
updateTime String
Update time stamp.

Look up Existing LoggingSetting Resource

Get an existing LoggingSetting 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?: LoggingSettingState, opts?: CustomResourceOptions): LoggingSetting
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        create_time: Optional[str] = None,
        effective_labels: Optional[Mapping[str, str]] = None,
        labels: Optional[Mapping[str, str]] = None,
        location: Optional[str] = None,
        log_metadata: Optional[bool] = None,
        log_prompts_and_responses: Optional[bool] = None,
        logging_setting_id: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        pulumi_labels: Optional[Mapping[str, str]] = None,
        update_time: Optional[str] = None) -> LoggingSetting
func GetLoggingSetting(ctx *Context, name string, id IDInput, state *LoggingSettingState, opts ...ResourceOption) (*LoggingSetting, error)
public static LoggingSetting Get(string name, Input<string> id, LoggingSettingState? state, CustomResourceOptions? opts = null)
public static LoggingSetting get(String name, Output<String> id, LoggingSettingState state, CustomResourceOptions options)
resources:  _:    type: gcp:gemini:LoggingSetting    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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
Create time stamp.
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Labels Dictionary<string, string>
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
Location Changes to this property will trigger replacement. string
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
LogMetadata bool
Whether to log metadata.
LogPromptsAndResponses bool
Whether to log prompts and responses.
LoggingSettingId Changes to this property will trigger replacement. string
Id of the Logging Setting.


Name string
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
UpdateTime string
Update time stamp.
CreateTime string
Create time stamp.
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Labels map[string]string
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
Location Changes to this property will trigger replacement. string
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
LogMetadata bool
Whether to log metadata.
LogPromptsAndResponses bool
Whether to log prompts and responses.
LoggingSettingId Changes to this property will trigger replacement. string
Id of the Logging Setting.


Name string
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
UpdateTime string
Update time stamp.
createTime String
Create time stamp.
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
labels Map<String,String>
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
location Changes to this property will trigger replacement. String
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
logMetadata Boolean
Whether to log metadata.
logPromptsAndResponses Boolean
Whether to log prompts and responses.
loggingSettingId Changes to this property will trigger replacement. String
Id of the Logging Setting.


name String
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
updateTime String
Update time stamp.
createTime string
Create time stamp.
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
labels {[key: string]: string}
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
location Changes to this property will trigger replacement. string
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
logMetadata boolean
Whether to log metadata.
logPromptsAndResponses boolean
Whether to log prompts and responses.
loggingSettingId Changes to this property will trigger replacement. string
Id of the Logging Setting.


name string
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
updateTime string
Update time stamp.
create_time str
Create time stamp.
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
labels Mapping[str, str]
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
location Changes to this property will trigger replacement. str
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
log_metadata bool
Whether to log metadata.
log_prompts_and_responses bool
Whether to log prompts and responses.
logging_setting_id Changes to this property will trigger replacement. str
Id of the Logging Setting.


name str
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
update_time str
Update time stamp.
createTime String
Create time stamp.
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
labels Map<String>
Labels as key value pairs. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
location Changes to this property will trigger replacement. String
Resource ID segment making up resource name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.
logMetadata Boolean
Whether to log metadata.
logPromptsAndResponses Boolean
Whether to log prompts and responses.
loggingSettingId Changes to this property will trigger replacement. String
Id of the Logging Setting.


name String
Identifier. Name of the resource. Format:projects/{project}/locations/{location}/loggingsettings/{loggingsetting}
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
updateTime String
Update time stamp.

Import

LoggingSetting can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/loggingSettings/{{logging_setting_id}}

  • {{project}}/{{location}}/{{logging_setting_id}}

  • {{location}}/{{logging_setting_id}}

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

$ pulumi import gcp:gemini/loggingSetting:LoggingSetting default projects/{{project}}/locations/{{location}}/loggingSettings/{{logging_setting_id}}
Copy
$ pulumi import gcp:gemini/loggingSetting:LoggingSetting default {{project}}/{{location}}/{{logging_setting_id}}
Copy
$ pulumi import gcp:gemini/loggingSetting:LoggingSetting default {{location}}/{{logging_setting_id}}
Copy

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.