1. Packages
  2. Logfire
  3. API Docs
  4. WriteToken
Viewing docs for Logfire v0.1.9
published on Wednesday, Apr 8, 2026 by Pydantic
logfire logo
Viewing docs for Logfire v0.1.9
published on Wednesday, Apr 8, 2026 by Pydantic

    Manages a Logfire write token.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as logfire from "@pydantic/pulumi-logfire";
    
    const exampleProject = new logfire.Project("exampleProject", {});
    const exampleWriteToken = new logfire.WriteToken("exampleWriteToken", {
        projectId: exampleProject.id,
        expiresAt: "2099-12-31T23:59:59Z",
    });
    
    import pulumi
    import pulumi_logfire as logfire
    
    example_project = logfire.Project("exampleProject")
    example_write_token = logfire.WriteToken("exampleWriteToken",
        project_id=example_project.id,
        expires_at="2099-12-31T23:59:59Z")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pydantic/pulumi-logfire/sdk/go/logfire"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleProject, err := logfire.NewProject(ctx, "exampleProject", nil)
    		if err != nil {
    			return err
    		}
    		_, err = logfire.NewWriteToken(ctx, "exampleWriteToken", &logfire.WriteTokenArgs{
    			ProjectId: exampleProject.ID(),
    			ExpiresAt: pulumi.String("2099-12-31T23:59:59Z"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Logfire = Pulumi.Logfire;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleProject = new Logfire.Project("exampleProject");
    
        var exampleWriteToken = new Logfire.WriteToken("exampleWriteToken", new()
        {
            ProjectId = exampleProject.Id,
            ExpiresAt = "2099-12-31T23:59:59Z",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.logfire.Project;
    import com.pulumi.logfire.WriteToken;
    import com.pulumi.logfire.WriteTokenArgs;
    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 exampleProject = new Project("exampleProject");
    
            var exampleWriteToken = new WriteToken("exampleWriteToken", WriteTokenArgs.builder()
                .projectId(exampleProject.id())
                .expiresAt("2099-12-31T23:59:59Z")
                .build());
    
        }
    }
    
    resources:
      exampleProject:
        type: logfire:Project
      exampleWriteToken:
        type: logfire:WriteToken
        properties:
          projectId: ${exampleProject.id}
          expiresAt: 2099-12-31T23:59:59Z
    

    Create WriteToken Resource

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

    Constructor syntax

    new WriteToken(name: string, args: WriteTokenArgs, opts?: CustomResourceOptions);
    @overload
    def WriteToken(resource_name: str,
                   args: WriteTokenArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def WriteToken(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   project_id: Optional[str] = None,
                   expires_at: Optional[str] = None)
    func NewWriteToken(ctx *Context, name string, args WriteTokenArgs, opts ...ResourceOption) (*WriteToken, error)
    public WriteToken(string name, WriteTokenArgs args, CustomResourceOptions? opts = null)
    public WriteToken(String name, WriteTokenArgs args)
    public WriteToken(String name, WriteTokenArgs args, CustomResourceOptions options)
    
    type: logfire:WriteToken
    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 WriteTokenArgs
    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 WriteTokenArgs
    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 WriteTokenArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WriteTokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WriteTokenArgs
    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 writeTokenResource = new Logfire.Index.WriteToken("writeTokenResource", new()
    {
        ProjectId = "string",
        ExpiresAt = "string",
    });
    
    example, err := logfire.NewWriteToken(ctx, "writeTokenResource", &logfire.WriteTokenArgs{
    	ProjectId: pulumi.String("string"),
    	ExpiresAt: pulumi.String("string"),
    })
    
    var writeTokenResource = new WriteToken("writeTokenResource", WriteTokenArgs.builder()
        .projectId("string")
        .expiresAt("string")
        .build());
    
    write_token_resource = logfire.WriteToken("writeTokenResource",
        project_id="string",
        expires_at="string")
    
    const writeTokenResource = new logfire.WriteToken("writeTokenResource", {
        projectId: "string",
        expiresAt: "string",
    });
    
    type: logfire:WriteToken
    properties:
        expiresAt: string
        projectId: string
    

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

    ProjectId string
    UUID of the project that owns the token.
    ExpiresAt string
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.
    ProjectId string
    UUID of the project that owns the token.
    ExpiresAt string
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.
    projectId String
    UUID of the project that owns the token.
    expiresAt String
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.
    projectId string
    UUID of the project that owns the token.
    expiresAt string
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.
    project_id str
    UUID of the project that owns the token.
    expires_at str
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.
    projectId String
    UUID of the project that owns the token.
    expiresAt String
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.

    Outputs

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

    CreatedAt string
    Timestamp when the token was created.
    CreatedByName string
    Display name of the user that created the token.
    Description string
    Description is fixed to "Created by Public API" for provider-managed tokens.
    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectName string
    Name of the project that owns the token.
    Token string
    The generated write token. Only returned on creation.
    TokenPrefix string
    Prefix of the generated write token.
    CreatedAt string
    Timestamp when the token was created.
    CreatedByName string
    Display name of the user that created the token.
    Description string
    Description is fixed to "Created by Public API" for provider-managed tokens.
    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectName string
    Name of the project that owns the token.
    Token string
    The generated write token. Only returned on creation.
    TokenPrefix string
    Prefix of the generated write token.
    createdAt String
    Timestamp when the token was created.
    createdByName String
    Display name of the user that created the token.
    description String
    Description is fixed to "Created by Public API" for provider-managed tokens.
    id String
    The provider-assigned unique ID for this managed resource.
    projectName String
    Name of the project that owns the token.
    token String
    The generated write token. Only returned on creation.
    tokenPrefix String
    Prefix of the generated write token.
    createdAt string
    Timestamp when the token was created.
    createdByName string
    Display name of the user that created the token.
    description string
    Description is fixed to "Created by Public API" for provider-managed tokens.
    id string
    The provider-assigned unique ID for this managed resource.
    projectName string
    Name of the project that owns the token.
    token string
    The generated write token. Only returned on creation.
    tokenPrefix string
    Prefix of the generated write token.
    created_at str
    Timestamp when the token was created.
    created_by_name str
    Display name of the user that created the token.
    description str
    Description is fixed to "Created by Public API" for provider-managed tokens.
    id str
    The provider-assigned unique ID for this managed resource.
    project_name str
    Name of the project that owns the token.
    token str
    The generated write token. Only returned on creation.
    token_prefix str
    Prefix of the generated write token.
    createdAt String
    Timestamp when the token was created.
    createdByName String
    Display name of the user that created the token.
    description String
    Description is fixed to "Created by Public API" for provider-managed tokens.
    id String
    The provider-assigned unique ID for this managed resource.
    projectName String
    Name of the project that owns the token.
    token String
    The generated write token. Only returned on creation.
    tokenPrefix String
    Prefix of the generated write token.

    Look up Existing WriteToken Resource

    Get an existing WriteToken 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?: WriteTokenState, opts?: CustomResourceOptions): WriteToken
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            created_by_name: Optional[str] = None,
            description: Optional[str] = None,
            expires_at: Optional[str] = None,
            project_id: Optional[str] = None,
            project_name: Optional[str] = None,
            token: Optional[str] = None,
            token_prefix: Optional[str] = None) -> WriteToken
    func GetWriteToken(ctx *Context, name string, id IDInput, state *WriteTokenState, opts ...ResourceOption) (*WriteToken, error)
    public static WriteToken Get(string name, Input<string> id, WriteTokenState? state, CustomResourceOptions? opts = null)
    public static WriteToken get(String name, Output<String> id, WriteTokenState state, CustomResourceOptions options)
    resources:  _:    type: logfire:WriteToken    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.
    The following state arguments are supported:
    CreatedAt string
    Timestamp when the token was created.
    CreatedByName string
    Display name of the user that created the token.
    Description string
    Description is fixed to "Created by Public API" for provider-managed tokens.
    ExpiresAt string
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.
    ProjectId string
    UUID of the project that owns the token.
    ProjectName string
    Name of the project that owns the token.
    Token string
    The generated write token. Only returned on creation.
    TokenPrefix string
    Prefix of the generated write token.
    CreatedAt string
    Timestamp when the token was created.
    CreatedByName string
    Display name of the user that created the token.
    Description string
    Description is fixed to "Created by Public API" for provider-managed tokens.
    ExpiresAt string
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.
    ProjectId string
    UUID of the project that owns the token.
    ProjectName string
    Name of the project that owns the token.
    Token string
    The generated write token. Only returned on creation.
    TokenPrefix string
    Prefix of the generated write token.
    createdAt String
    Timestamp when the token was created.
    createdByName String
    Display name of the user that created the token.
    description String
    Description is fixed to "Created by Public API" for provider-managed tokens.
    expiresAt String
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.
    projectId String
    UUID of the project that owns the token.
    projectName String
    Name of the project that owns the token.
    token String
    The generated write token. Only returned on creation.
    tokenPrefix String
    Prefix of the generated write token.
    createdAt string
    Timestamp when the token was created.
    createdByName string
    Display name of the user that created the token.
    description string
    Description is fixed to "Created by Public API" for provider-managed tokens.
    expiresAt string
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.
    projectId string
    UUID of the project that owns the token.
    projectName string
    Name of the project that owns the token.
    token string
    The generated write token. Only returned on creation.
    tokenPrefix string
    Prefix of the generated write token.
    created_at str
    Timestamp when the token was created.
    created_by_name str
    Display name of the user that created the token.
    description str
    Description is fixed to "Created by Public API" for provider-managed tokens.
    expires_at str
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.
    project_id str
    UUID of the project that owns the token.
    project_name str
    Name of the project that owns the token.
    token str
    The generated write token. Only returned on creation.
    token_prefix str
    Prefix of the generated write token.
    createdAt String
    Timestamp when the token was created.
    createdByName String
    Display name of the user that created the token.
    description String
    Description is fixed to "Created by Public API" for provider-managed tokens.
    expiresAt String
    Optional RFC3339 expiration timestamp for the token (for example 2026-12-31T23:59:59Z). If omitted, the token does not expire.
    projectId String
    UUID of the project that owns the token.
    projectName String
    Name of the project that owns the token.
    token String
    The generated write token. Only returned on creation.
    tokenPrefix String
    Prefix of the generated write token.

    Package Details

    Repository
    logfire pydantic/pulumi-logfire
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the logfire Terraform Provider.
    logfire logo
    Viewing docs for Logfire v0.1.9
    published on Wednesday, Apr 8, 2026 by Pydantic
      Try Pulumi Cloud free. Your team will thank you.