AiLogicPromptTemplateLock class
A resource that manages the lock state of a PromptTemplate. When this resource is created, the template is locked. When this resource is deleted, the template is unlocked.
> Warning: This resource is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources.
Example Usage
Firebaseailogic Prompt Template Lock Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const basic = new gcp.firebase.AiLogicPromptTemplate("basic", {
location: "global",
templateId: "lock-template",
templateString: `---
model: googleai/gemini-1.5-flash
---
Hello World
`,
});
const basicLock = new gcp.firebase.AiLogicPromptTemplateLock("basic_lock", {
location: basic.location,
templateId: basic.templateId,
});
import pulumi
import pulumi_gcp as gcp
basic = gcp.firebase.AiLogicPromptTemplate("basic",
location="global",
template_id="lock-template",
template_string="""---
model: googleai/gemini-1.5-flash
---
Hello World
""")
basic_lock = gcp.firebase.AiLogicPromptTemplateLock("basic_lock",
location=basic.location,
template_id=basic.template_id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var basic = new Gcp.Firebase.AiLogicPromptTemplate("basic", new()
{
Location = "global",
TemplateId = "lock-template",
TemplateString = @"---
model: googleai/gemini-1.5-flash
---
Hello World
",
});
var basicLock = new Gcp.Firebase.AiLogicPromptTemplateLock("basic_lock", new()
{
Location = basic.Location,
TemplateId = basic.TemplateId,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/firebase"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
basic, err := firebase.NewAiLogicPromptTemplate(ctx, "basic", &firebase.AiLogicPromptTemplateArgs{
Location: pulumi.String("global"),
TemplateId: pulumi.String("lock-template"),
TemplateString: pulumi.String("---\nmodel: googleai/gemini-1.5-flash\n---\nHello World\n"),
})
if err != nil {
return err
}
_, err = firebase.NewAiLogicPromptTemplateLock(ctx, "basic_lock", &firebase.AiLogicPromptTemplateLockArgs{
Location: basic.Location,
TemplateId: basic.TemplateId,
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_firebase_ailogicprompttemplate" "basic" {
location = "global"
template_id = "lock-template"
template_string = "---\nmodel: googleai/gemini-1.5-flash\n---\nHello World\n"
}
resource "gcp_firebase_ailogicprompttemplatelock" "basic_lock" {
location = gcp_firebase_ailogicprompttemplate.basic.location
template_id = gcp_firebase_ailogicprompttemplate.basic.template_id
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.firebase.AiLogicPromptTemplate;
import com.pulumi.gcp.firebase.AiLogicPromptTemplateArgs;
import com.pulumi.gcp.firebase.AiLogicPromptTemplateLock;
import com.pulumi.gcp.firebase.AiLogicPromptTemplateLockArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 basic = new AiLogicPromptTemplate("basic", AiLogicPromptTemplateArgs.builder()
.location("global")
.templateId("lock-template")
.templateString("""
---
model: googleai/gemini-1.5-flash
---
Hello World
""")
.build());
var basicLock = new AiLogicPromptTemplateLock("basicLock", AiLogicPromptTemplateLockArgs.builder()
.location(basic.location())
.templateId(basic.templateId())
.build());
}
}
resources:
basic:
type: gcp:firebase:AiLogicPromptTemplate
properties:
location: global
templateId: lock-template
templateString: |
---
model: googleai/gemini-1.5-flash
---
Hello World
basicLock:
type: gcp:firebase:AiLogicPromptTemplateLock
name: basic_lock
properties:
location: ${basic.location}
templateId: ${basic.templateId}
Firebaseailogic Prompt Template Lock Global Only
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const globalOnly = new gcp.firebase.AiLogicPromptTemplate("global_only", {
location: "global",
templateId: "global-only-lock-template",
templateString: `---
model: googleai/gemini-1.5-flash
---
Hello World
`,
});
const globalOnlyLock = new gcp.firebase.AiLogicPromptTemplateLock("global_only_lock", {
location: globalOnly.location,
templateId: globalOnly.templateId,
regionalPropagationDisabled: true,
});
import pulumi
import pulumi_gcp as gcp
global_only = gcp.firebase.AiLogicPromptTemplate("global_only",
location="global",
template_id="global-only-lock-template",
template_string="""---
model: googleai/gemini-1.5-flash
---
Hello World
""")
global_only_lock = gcp.firebase.AiLogicPromptTemplateLock("global_only_lock",
location=global_only.location,
template_id=global_only.template_id,
regional_propagation_disabled=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var globalOnly = new Gcp.Firebase.AiLogicPromptTemplate("global_only", new()
{
Location = "global",
TemplateId = "global-only-lock-template",
TemplateString = @"---
model: googleai/gemini-1.5-flash
---
Hello World
",
});
var globalOnlyLock = new Gcp.Firebase.AiLogicPromptTemplateLock("global_only_lock", new()
{
Location = globalOnly.Location,
TemplateId = globalOnly.TemplateId,
RegionalPropagationDisabled = true,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/firebase"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
globalOnly, err := firebase.NewAiLogicPromptTemplate(ctx, "global_only", &firebase.AiLogicPromptTemplateArgs{
Location: pulumi.String("global"),
TemplateId: pulumi.String("global-only-lock-template"),
TemplateString: pulumi.String("---\nmodel: googleai/gemini-1.5-flash\n---\nHello World\n"),
})
if err != nil {
return err
}
_, err = firebase.NewAiLogicPromptTemplateLock(ctx, "global_only_lock", &firebase.AiLogicPromptTemplateLockArgs{
Location: globalOnly.Location,
TemplateId: globalOnly.TemplateId,
RegionalPropagationDisabled: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_firebase_ailogicprompttemplate" "global_only" {
location = "global"
template_id = "global-only-lock-template"
template_string = "---\nmodel: googleai/gemini-1.5-flash\n---\nHello World\n"
}
resource "gcp_firebase_ailogicprompttemplatelock" "global_only_lock" {
location = gcp_firebase_ailogicprompttemplate.global_only.location
template_id = gcp_firebase_ailogicprompttemplate.global_only.template_id
regional_propagation_disabled = true
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.firebase.AiLogicPromptTemplate;
import com.pulumi.gcp.firebase.AiLogicPromptTemplateArgs;
import com.pulumi.gcp.firebase.AiLogicPromptTemplateLock;
import com.pulumi.gcp.firebase.AiLogicPromptTemplateLockArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 globalOnly = new AiLogicPromptTemplate("globalOnly", AiLogicPromptTemplateArgs.builder()
.location("global")
.templateId("global-only-lock-template")
.templateString("""
---
model: googleai/gemini-1.5-flash
---
Hello World
""")
.build());
var globalOnlyLock = new AiLogicPromptTemplateLock("globalOnlyLock", AiLogicPromptTemplateLockArgs.builder()
.location(globalOnly.location())
.templateId(globalOnly.templateId())
.regionalPropagationDisabled(true)
.build());
}
}
resources:
globalOnly:
type: gcp:firebase:AiLogicPromptTemplate
name: global_only
properties:
location: global
templateId: global-only-lock-template
templateString: |
---
model: googleai/gemini-1.5-flash
---
Hello World
globalOnlyLock:
type: gcp:firebase:AiLogicPromptTemplateLock
name: global_only_lock
properties:
location: ${globalOnly.location}
templateId: ${globalOnly.templateId}
regionalPropagationDisabled: true
Import
PromptTemplateLock can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/templates/{{template_id}}{{project}}/{{location}}/{{template_id}}{{location}}/{{template_id}}
When using the pulumi import command, PromptTemplateLock can be imported using one of the formats above. For example:
$ pulumi import gcp:firebase/aiLogicPromptTemplateLock:AiLogicPromptTemplateLock default projects/{{project}}/locations/{{location}}/templates/{{template_id}}
$ pulumi import gcp:firebase/aiLogicPromptTemplateLock:AiLogicPromptTemplateLock default {{project}}/{{location}}/{{template_id}}
$ pulumi import gcp:firebase/aiLogicPromptTemplateLock:AiLogicPromptTemplateLock default {{location}}/{{template_id}}
Constructors
- AiLogicPromptTemplateLock(String name, {AiLogicPromptTemplateLockArgs? args, CustomResourceOptions? options})
-
Creates a new AiLogicPromptTemplateLock.
nameThe Pulumi resource name.argsArguments used to configure this AiLogicPromptTemplateLock. The set of arguments for AiLogicPromptTemplateLock.optionsResource options controlling this resource's behavior. - AiLogicPromptTemplateLock.reference(String urn)
- Creates a typed reference to an existing AiLogicPromptTemplateLock resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
deletionPolicy
↔ Output<
String> -
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
When a 'terraform destroy' or 'pulumi up' would delete the resource,
the command will fail if this field is set to "PREVENT" in Terraform state.
When set to "ABANDON", the command will remove the resource from Terraform
management without updating or deleting the resource in the API.
When set to "DELETE", deleting the resource is allowed.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
location
↔ Output<
String> -
The location of the prompt template.
latefinal
-
locked
↔ Output<
bool> -
Indicates if the prompt template is currently locked.
This is verified against the server-side PromptTemplate resource.
latefinal
-
name
↔ Output<
String> -
The resource name of the prompt template.
latefinal
-
project
↔ Output<
String> -
The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
latefinal
-
regionalPropagationDisabled
↔ Output<
bool?> -
For the
globallocation only. If true, the modifyLock operation will apply to the global region only. Otherwise, the operation will also propagate to all applicable regions.latefinal -
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
templateId
↔ Output<
String> -
The ID of the prompt template.
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {AiLogicPromptTemplateLockState? state, CustomResourceOptions? options}) → AiLogicPromptTemplateLock -
Gets an existing AiLogicPromptTemplateLock resource's state with the given
nameandid.