published on Tuesday, Nov 3, 2026 by Pydantic
published on Tuesday, Nov 3, 2026 by Pydantic
Manages the AI Gateway spending limits of the organization. An organization limit caps the Gateway spend of every project and credential in the organization. Requires a plan that includes the AI Gateway and a token with organization:read_gateway and organization:write_gateway scopes (organization:read and organization:write are also accepted).
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as logfire from "@pydantic/pulumi-logfire";
// Cap the Gateway spend of the whole organization. A window you omit has no limit.
const _this = new logfire.GatewaySpendingLimits("this", {
dailyUsd: 500,
monthlyUsd: 10000,
});
import pulumi
import pulumi_logfire as logfire
# Cap the Gateway spend of the whole organization. A window you omit has no limit.
this = logfire.GatewaySpendingLimits("this",
daily_usd=500,
monthly_usd=10000)
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 {
// Cap the Gateway spend of the whole organization. A window you omit has no limit.
_, err := logfire.NewGatewaySpendingLimits(ctx, "this", &logfire.GatewaySpendingLimitsArgs{
DailyUsd: pulumi.Int(500),
MonthlyUsd: pulumi.Int(10000),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Logfire = Pulumi.Logfire;
return await Deployment.RunAsync(() =>
{
// Cap the Gateway spend of the whole organization. A window you omit has no limit.
var @this = new Logfire.GatewaySpendingLimits("this", new()
{
DailyUsd = 500,
MonthlyUsd = 10000,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.logfire.GatewaySpendingLimits;
import com.pulumi.logfire.GatewaySpendingLimitsArgs;
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) {
// Cap the Gateway spend of the whole organization. A window you omit has no limit.
var this_ = new GatewaySpendingLimits("this", GatewaySpendingLimitsArgs.builder()
.dailyUsd(500)
.monthlyUsd(10000)
.build());
}
}
resources:
# Cap the Gateway spend of the whole organization. A window you omit has no limit.
this:
type: logfire:GatewaySpendingLimits
properties:
dailyUsd: 500
monthlyUsd: 10000
Example coming soon!
Ownership
The resource owns all three windows. A window you omit has no limit, and destroying the resource removes every organization limit.
Creating the resource replaces any limits set in the Logfire UI. To keep them, import the resource first and copy the imported values into your configuration.
Declare at most one of this resource for each organization. The resource manages the organization of the provider’s credentials and stores no organization ID. If the provider switches to another organization’s credentials, the next plan reads and manages that organization’s limits.
Create GatewaySpendingLimits Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GatewaySpendingLimits(name: string, args?: GatewaySpendingLimitsArgs, opts?: CustomResourceOptions);@overload
def GatewaySpendingLimits(resource_name: str,
args: Optional[GatewaySpendingLimitsArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def GatewaySpendingLimits(resource_name: str,
opts: Optional[ResourceOptions] = None,
daily_usd: Optional[int] = None,
monthly_usd: Optional[int] = None,
weekly_usd: Optional[int] = None)func NewGatewaySpendingLimits(ctx *Context, name string, args *GatewaySpendingLimitsArgs, opts ...ResourceOption) (*GatewaySpendingLimits, error)public GatewaySpendingLimits(string name, GatewaySpendingLimitsArgs? args = null, CustomResourceOptions? opts = null)
public GatewaySpendingLimits(String name, GatewaySpendingLimitsArgs args)
public GatewaySpendingLimits(String name, GatewaySpendingLimitsArgs args, CustomResourceOptions options)
type: logfire:GatewaySpendingLimits
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "logfire_gateway_spending_limits" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args GatewaySpendingLimitsArgs
- 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 GatewaySpendingLimitsArgs
- 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 GatewaySpendingLimitsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GatewaySpendingLimitsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GatewaySpendingLimitsArgs
- 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 gatewaySpendingLimitsResource = new Logfire.GatewaySpendingLimits("gatewaySpendingLimitsResource", new()
{
DailyUsd = 0,
MonthlyUsd = 0,
WeeklyUsd = 0,
});
example, err := logfire.NewGatewaySpendingLimits(ctx, "gatewaySpendingLimitsResource", &logfire.GatewaySpendingLimitsArgs{
DailyUsd: pulumi.Int(0),
MonthlyUsd: pulumi.Int(0),
WeeklyUsd: pulumi.Int(0),
})
resource "logfire_gateway_spending_limits" "gatewaySpendingLimitsResource" {
lifecycle {
create_before_destroy = true
}
daily_usd = 0
monthly_usd = 0
weekly_usd = 0
}
var gatewaySpendingLimitsResource = new GatewaySpendingLimits("gatewaySpendingLimitsResource", GatewaySpendingLimitsArgs.builder()
.dailyUsd(0)
.monthlyUsd(0)
.weeklyUsd(0)
.build());
gateway_spending_limits_resource = logfire.GatewaySpendingLimits("gatewaySpendingLimitsResource",
daily_usd=0,
monthly_usd=0,
weekly_usd=0)
const gatewaySpendingLimitsResource = new logfire.GatewaySpendingLimits("gatewaySpendingLimitsResource", {
dailyUsd: 0,
monthlyUsd: 0,
weeklyUsd: 0,
});
type: logfire:GatewaySpendingLimits
properties:
dailyUsd: 0
monthlyUsd: 0
weeklyUsd: 0
GatewaySpendingLimits 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 GatewaySpendingLimits resource accepts the following input properties:
- Daily
Usd int - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- Monthly
Usd int - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- Weekly
Usd int - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- Daily
Usd int - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- Monthly
Usd int - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- Weekly
Usd int - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- daily_
usd number - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- monthly_
usd number - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- weekly_
usd number - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- daily
Usd Integer - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- monthly
Usd Integer - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- weekly
Usd Integer - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- daily
Usd number - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- monthly
Usd number - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- weekly
Usd number - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- daily_
usd int - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- monthly_
usd int - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- weekly_
usd int - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- daily
Usd Number - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- monthly
Usd Number - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- weekly
Usd Number - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
Outputs
All input properties are implicitly available as output properties. Additionally, the GatewaySpendingLimits resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing GatewaySpendingLimits Resource
Get an existing GatewaySpendingLimits 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?: GatewaySpendingLimitsState, opts?: CustomResourceOptions): GatewaySpendingLimits@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
daily_usd: Optional[int] = None,
monthly_usd: Optional[int] = None,
weekly_usd: Optional[int] = None) -> GatewaySpendingLimitsfunc GetGatewaySpendingLimits(ctx *Context, name string, id IDInput, state *GatewaySpendingLimitsState, opts ...ResourceOption) (*GatewaySpendingLimits, error)public static GatewaySpendingLimits Get(string name, Input<string> id, GatewaySpendingLimitsState? state, CustomResourceOptions? opts = null)public static GatewaySpendingLimits get(String name, Output<String> id, GatewaySpendingLimitsState state, CustomResourceOptions options)resources: _: type: logfire:GatewaySpendingLimits get: id: ${id}import {
to = logfire_gateway_spending_limits.example
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.
- Daily
Usd int - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- Monthly
Usd int - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- Weekly
Usd int - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- Daily
Usd int - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- Monthly
Usd int - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- Weekly
Usd int - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- daily_
usd number - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- monthly_
usd number - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- weekly_
usd number - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- daily
Usd Integer - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- monthly
Usd Integer - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- weekly
Usd Integer - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- daily
Usd number - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- monthly
Usd number - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- weekly
Usd number - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- daily_
usd int - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- monthly_
usd int - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- weekly_
usd int - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
- daily
Usd Number - The daily limit in whole US dollars. A day starts at 00:00 UTC. Omit it to have no daily limit.
- monthly
Usd Number - The monthly limit in whole US dollars. A month starts on the 1st at 00:00 UTC. Omit it to have no monthly limit.
- weekly
Usd Number - The weekly limit in whole US dollars. A week starts on Monday at 00:00 UTC. Omit it to have no weekly limit.
Import
The organization has one set of spending limits, so the import ID is always
organization:
terraform
import {
to = logfire_gateway_spending_limits.this
id = “organization”
}
Or use the command line:
The organization has one set of spending limits, so the import ID is always “organization”.
$ pulumi import logfire:index/gatewaySpendingLimits:GatewaySpendingLimits this' "organization"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- logfire pydantic/pulumi-logfire
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
logfireTerraform Provider.
published on Tuesday, Nov 3, 2026 by Pydantic