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.
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)
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
})
}
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 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.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 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}
Create AiLogicPromptTemplateLock Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AiLogicPromptTemplateLock(name: string, args: AiLogicPromptTemplateLockArgs, opts?: CustomResourceOptions);@overload
def AiLogicPromptTemplateLock(resource_name: str,
args: AiLogicPromptTemplateLockArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AiLogicPromptTemplateLock(resource_name: str,
opts: Optional[ResourceOptions] = None,
location: Optional[str] = None,
template_id: Optional[str] = None,
project: Optional[str] = None)func NewAiLogicPromptTemplateLock(ctx *Context, name string, args AiLogicPromptTemplateLockArgs, opts ...ResourceOption) (*AiLogicPromptTemplateLock, error)public AiLogicPromptTemplateLock(string name, AiLogicPromptTemplateLockArgs args, CustomResourceOptions? opts = null)
public AiLogicPromptTemplateLock(String name, AiLogicPromptTemplateLockArgs args)
public AiLogicPromptTemplateLock(String name, AiLogicPromptTemplateLockArgs args, CustomResourceOptions options)
type: gcp:firebase:AiLogicPromptTemplateLock
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 AiLogicPromptTemplateLockArgs
- 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 AiLogicPromptTemplateLockArgs
- 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 AiLogicPromptTemplateLockArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AiLogicPromptTemplateLockArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AiLogicPromptTemplateLockArgs
- 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 aiLogicPromptTemplateLockResource = new Gcp.Firebase.AiLogicPromptTemplateLock("aiLogicPromptTemplateLockResource", new()
{
Location = "string",
TemplateId = "string",
Project = "string",
});
example, err := firebase.NewAiLogicPromptTemplateLock(ctx, "aiLogicPromptTemplateLockResource", &firebase.AiLogicPromptTemplateLockArgs{
Location: pulumi.String("string"),
TemplateId: pulumi.String("string"),
Project: pulumi.String("string"),
})
var aiLogicPromptTemplateLockResource = new AiLogicPromptTemplateLock("aiLogicPromptTemplateLockResource", AiLogicPromptTemplateLockArgs.builder()
.location("string")
.templateId("string")
.project("string")
.build());
ai_logic_prompt_template_lock_resource = gcp.firebase.AiLogicPromptTemplateLock("aiLogicPromptTemplateLockResource",
location="string",
template_id="string",
project="string")
const aiLogicPromptTemplateLockResource = new gcp.firebase.AiLogicPromptTemplateLock("aiLogicPromptTemplateLockResource", {
location: "string",
templateId: "string",
project: "string",
});
type: gcp:firebase:AiLogicPromptTemplateLock
properties:
location: string
project: string
templateId: string
AiLogicPromptTemplateLock 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 AiLogicPromptTemplateLock resource accepts the following input properties:
- Location string
- The location of the prompt template.
- Template
Id string - The ID of the prompt template.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Location string
- The location of the prompt template.
- Template
Id string - The ID of the prompt template.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- location String
- The location of the prompt template.
- template
Id String - The ID of the prompt template.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- location string
- The location of the prompt template.
- template
Id string - The ID of the prompt template.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- location str
- The location of the prompt template.
- template_
id str - The ID of the prompt template.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- location String
- The location of the prompt template.
- template
Id String - The ID of the prompt template.
- project 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 AiLogicPromptTemplateLock resource produces the following output properties:
Look up Existing AiLogicPromptTemplateLock Resource
Get an existing AiLogicPromptTemplateLock 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?: AiLogicPromptTemplateLockState, opts?: CustomResourceOptions): AiLogicPromptTemplateLock@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
location: Optional[str] = None,
locked: Optional[bool] = None,
name: Optional[str] = None,
project: Optional[str] = None,
template_id: Optional[str] = None) -> AiLogicPromptTemplateLockfunc GetAiLogicPromptTemplateLock(ctx *Context, name string, id IDInput, state *AiLogicPromptTemplateLockState, opts ...ResourceOption) (*AiLogicPromptTemplateLock, error)public static AiLogicPromptTemplateLock Get(string name, Input<string> id, AiLogicPromptTemplateLockState? state, CustomResourceOptions? opts = null)public static AiLogicPromptTemplateLock get(String name, Output<String> id, AiLogicPromptTemplateLockState state, CustomResourceOptions options)resources: _: type: gcp:firebase:AiLogicPromptTemplateLock get: id: ${id}- 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.
- Location string
- The location of the prompt template.
- Locked bool
- Indicates if the prompt template is currently locked. This is verified against the server-side PromptTemplate resource.
- Name string
- The resource name of the prompt template.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Template
Id string - The ID of the prompt template.
- Location string
- The location of the prompt template.
- Locked bool
- Indicates if the prompt template is currently locked. This is verified against the server-side PromptTemplate resource.
- Name string
- The resource name of the prompt template.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Template
Id string - The ID of the prompt template.
- location String
- The location of the prompt template.
- locked Boolean
- Indicates if the prompt template is currently locked. This is verified against the server-side PromptTemplate resource.
- name String
- The resource name of the prompt template.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- template
Id String - The ID of the prompt template.
- location string
- The location of the prompt template.
- locked boolean
- Indicates if the prompt template is currently locked. This is verified against the server-side PromptTemplate resource.
- name string
- The resource name of the prompt template.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- template
Id string - The ID of the prompt template.
- location str
- The location of the prompt template.
- locked bool
- Indicates if the prompt template is currently locked. This is verified against the server-side PromptTemplate resource.
- name str
- The resource name of the prompt template.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- template_
id str - The ID of the prompt template.
- location String
- The location of the prompt template.
- locked Boolean
- Indicates if the prompt template is currently locked. This is verified against the server-side PromptTemplate resource.
- name String
- The resource name of the prompt template.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- template
Id String - The ID of the prompt template.
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}}
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-betaTerraform Provider.
