published on Friday, Aug 14, 2026 by Pulumi
published on Friday, Aug 14, 2026 by Pulumi
Meters specify how to aggregate meter events over a billing period. Meter events represent the actions that customers take in your system. Meters attach to prices and form the basis of the bill.
Related guide: Usage based billing
Create BillingMeter Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BillingMeter(name: string, args: BillingMeterArgs, opts?: CustomResourceOptions);@overload
def BillingMeter(resource_name: str,
args: BillingMeterArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BillingMeter(resource_name: str,
opts: Optional[ResourceOptions] = None,
display_name: Optional[str] = None,
event_name: Optional[str] = None,
customer_mappings: Optional[Sequence[BillingMeterCustomerMappingArgs]] = None,
default_aggregations: Optional[Sequence[BillingMeterDefaultAggregationArgs]] = None,
event_time_window: Optional[str] = None,
value_settings: Optional[Sequence[BillingMeterValueSettingArgs]] = None)func NewBillingMeter(ctx *Context, name string, args BillingMeterArgs, opts ...ResourceOption) (*BillingMeter, error)public BillingMeter(string name, BillingMeterArgs args, CustomResourceOptions? opts = null)
public BillingMeter(String name, BillingMeterArgs args)
public BillingMeter(String name, BillingMeterArgs args, CustomResourceOptions options)
type: stripe:BillingMeter
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "stripe_billing_meter" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args BillingMeterArgs
- 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 BillingMeterArgs
- 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 BillingMeterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BillingMeterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BillingMeterArgs
- 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 billingMeterResource = new Stripe.BillingMeter("billingMeterResource", new()
{
DisplayName = "string",
EventName = "string",
CustomerMappings = new[]
{
new Stripe.Inputs.BillingMeterCustomerMappingArgs
{
EventPayloadKey = "string",
Type = "string",
},
},
DefaultAggregations = new[]
{
new Stripe.Inputs.BillingMeterDefaultAggregationArgs
{
Formula = "string",
},
},
EventTimeWindow = "string",
ValueSettings = new[]
{
new Stripe.Inputs.BillingMeterValueSettingArgs
{
EventPayloadKey = "string",
},
},
});
example, err := stripe.NewBillingMeter(ctx, "billingMeterResource", &stripe.BillingMeterArgs{
DisplayName: pulumi.String("string"),
EventName: pulumi.String("string"),
CustomerMappings: stripe.BillingMeterCustomerMappingArray{
&stripe.BillingMeterCustomerMappingArgs{
EventPayloadKey: pulumi.String("string"),
Type: pulumi.String("string"),
},
},
DefaultAggregations: stripe.BillingMeterDefaultAggregationArray{
&stripe.BillingMeterDefaultAggregationArgs{
Formula: pulumi.String("string"),
},
},
EventTimeWindow: pulumi.String("string"),
ValueSettings: stripe.BillingMeterValueSettingArray{
&stripe.BillingMeterValueSettingArgs{
EventPayloadKey: pulumi.String("string"),
},
},
})
resource "stripe_billing_meter" "billingMeterResource" {
lifecycle {
create_before_destroy = true
}
display_name = "string"
event_name = "string"
customer_mappings {
event_payload_key = "string"
type = "string"
}
default_aggregations {
formula = "string"
}
event_time_window = "string"
value_settings {
event_payload_key = "string"
}
}
var billingMeterResource = new BillingMeter("billingMeterResource", BillingMeterArgs.builder()
.displayName("string")
.eventName("string")
.customerMappings(BillingMeterCustomerMappingArgs.builder()
.eventPayloadKey("string")
.type("string")
.build())
.defaultAggregations(BillingMeterDefaultAggregationArgs.builder()
.formula("string")
.build())
.eventTimeWindow("string")
.valueSettings(BillingMeterValueSettingArgs.builder()
.eventPayloadKey("string")
.build())
.build());
billing_meter_resource = stripe.BillingMeter("billingMeterResource",
display_name="string",
event_name="string",
customer_mappings=[{
"event_payload_key": "string",
"type": "string",
}],
default_aggregations=[{
"formula": "string",
}],
event_time_window="string",
value_settings=[{
"event_payload_key": "string",
}])
const billingMeterResource = new stripe.BillingMeter("billingMeterResource", {
displayName: "string",
eventName: "string",
customerMappings: [{
eventPayloadKey: "string",
type: "string",
}],
defaultAggregations: [{
formula: "string",
}],
eventTimeWindow: "string",
valueSettings: [{
eventPayloadKey: "string",
}],
});
type: stripe:BillingMeter
properties:
customerMappings:
- eventPayloadKey: string
type: string
defaultAggregations:
- formula: string
displayName: string
eventName: string
eventTimeWindow: string
valueSettings:
- eventPayloadKey: string
BillingMeter 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 BillingMeter resource accepts the following input properties:
- Display
Name string - The meter's name.
- Event
Name string - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - Customer
Mappings List<BillingMeter Customer Mapping> - Default
Aggregations List<BillingMeter Default Aggregation> - Event
Time stringWindow - The time window which meter events have been pre-aggregated for, if any.
- Value
Settings List<BillingMeter Value Setting>
- Display
Name string - The meter's name.
- Event
Name string - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - Customer
Mappings []BillingMeter Customer Mapping Args - Default
Aggregations []BillingMeter Default Aggregation Args - Event
Time stringWindow - The time window which meter events have been pre-aggregated for, if any.
- Value
Settings []BillingMeter Value Setting Args
- display_
name string - The meter's name.
- event_
name string - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - customer_
mappings list(object) - default_
aggregations list(object) - event_
time_ stringwindow - The time window which meter events have been pre-aggregated for, if any.
- value_
settings list(object)
- display
Name String - The meter's name.
- event
Name String - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - customer
Mappings List<BillingMeter Customer Mapping> - default
Aggregations List<BillingMeter Default Aggregation> - event
Time StringWindow - The time window which meter events have been pre-aggregated for, if any.
- value
Settings List<BillingMeter Value Setting>
- display
Name string - The meter's name.
- event
Name string - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - customer
Mappings BillingMeter Customer Mapping[] - default
Aggregations BillingMeter Default Aggregation[] - event
Time stringWindow - The time window which meter events have been pre-aggregated for, if any.
- value
Settings BillingMeter Value Setting[]
- display_
name str - The meter's name.
- event_
name str - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - customer_
mappings Sequence[BillingMeter Customer Mapping Args] - default_
aggregations Sequence[BillingMeter Default Aggregation Args] - event_
time_ strwindow - The time window which meter events have been pre-aggregated for, if any.
- value_
settings Sequence[BillingMeter Value Setting Args]
- display
Name String - The meter's name.
- event
Name String - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - customer
Mappings List<Property Map> - default
Aggregations List<Property Map> - event
Time StringWindow - The time window which meter events have been pre-aggregated for, if any.
- value
Settings List<Property Map>
Outputs
All input properties are implicitly available as output properties. Additionally, the BillingMeter resource produces the following output properties:
- Created double
- Time at which the object was created. Measured in seconds since the Unix epoch.
- Id string
- The provider-assigned unique ID for this managed resource.
- Livemode bool
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - Object string
- String representing the object's type. Objects of the same type share the same value.
- Status string
- The meter's status.
- Status
Transitions BillingMeter Status Transitions - Updated double
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- Created float64
- Time at which the object was created. Measured in seconds since the Unix epoch.
- Id string
- The provider-assigned unique ID for this managed resource.
- Livemode bool
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - Object string
- String representing the object's type. Objects of the same type share the same value.
- Status string
- The meter's status.
- Status
Transitions BillingMeter Status Transitions - Updated float64
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- created number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- id string
- The provider-assigned unique ID for this managed resource.
- livemode bool
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - object string
- String representing the object's type. Objects of the same type share the same value.
- status string
- The meter's status.
- status_
transitions object - updated number
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- created Double
- Time at which the object was created. Measured in seconds since the Unix epoch.
- id String
- The provider-assigned unique ID for this managed resource.
- livemode Boolean
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - object String
- String representing the object's type. Objects of the same type share the same value.
- status String
- The meter's status.
- status
Transitions BillingMeter Status Transitions - updated Double
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- created number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- id string
- The provider-assigned unique ID for this managed resource.
- livemode boolean
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - object string
- String representing the object's type. Objects of the same type share the same value.
- status string
- The meter's status.
- status
Transitions BillingMeter Status Transitions - updated number
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- created float
- Time at which the object was created. Measured in seconds since the Unix epoch.
- id str
- The provider-assigned unique ID for this managed resource.
- livemode bool
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - object str
- String representing the object's type. Objects of the same type share the same value.
- status str
- The meter's status.
- status_
transitions BillingMeter Status Transitions - updated float
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- created Number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- id String
- The provider-assigned unique ID for this managed resource.
- livemode Boolean
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - object String
- String representing the object's type. Objects of the same type share the same value.
- status String
- The meter's status.
- status
Transitions Property Map - updated Number
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
Look up Existing BillingMeter Resource
Get an existing BillingMeter 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?: BillingMeterState, opts?: CustomResourceOptions): BillingMeter@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created: Optional[float] = None,
customer_mappings: Optional[Sequence[BillingMeterCustomerMappingArgs]] = None,
default_aggregations: Optional[Sequence[BillingMeterDefaultAggregationArgs]] = None,
display_name: Optional[str] = None,
event_name: Optional[str] = None,
event_time_window: Optional[str] = None,
livemode: Optional[bool] = None,
object: Optional[str] = None,
status: Optional[str] = None,
status_transitions: Optional[BillingMeterStatusTransitionsArgs] = None,
updated: Optional[float] = None,
value_settings: Optional[Sequence[BillingMeterValueSettingArgs]] = None) -> BillingMeterfunc GetBillingMeter(ctx *Context, name string, id IDInput, state *BillingMeterState, opts ...ResourceOption) (*BillingMeter, error)public static BillingMeter Get(string name, Input<string> id, BillingMeterState? state, CustomResourceOptions? opts = null)public static BillingMeter get(String name, Output<String> id, BillingMeterState state, CustomResourceOptions options)resources: _: type: stripe:BillingMeter get: id: ${id}import {
to = stripe_billing_meter.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.
- Created double
- Time at which the object was created. Measured in seconds since the Unix epoch.
- Customer
Mappings List<BillingMeter Customer Mapping> - Default
Aggregations List<BillingMeter Default Aggregation> - Display
Name string - The meter's name.
- Event
Name string - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - Event
Time stringWindow - The time window which meter events have been pre-aggregated for, if any.
- Livemode bool
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - Object string
- String representing the object's type. Objects of the same type share the same value.
- Status string
- The meter's status.
- Status
Transitions BillingMeter Status Transitions - Updated double
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- Value
Settings List<BillingMeter Value Setting>
- Created float64
- Time at which the object was created. Measured in seconds since the Unix epoch.
- Customer
Mappings []BillingMeter Customer Mapping Args - Default
Aggregations []BillingMeter Default Aggregation Args - Display
Name string - The meter's name.
- Event
Name string - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - Event
Time stringWindow - The time window which meter events have been pre-aggregated for, if any.
- Livemode bool
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - Object string
- String representing the object's type. Objects of the same type share the same value.
- Status string
- The meter's status.
- Status
Transitions BillingMeter Status Transitions Args - Updated float64
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- Value
Settings []BillingMeter Value Setting Args
- created number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- customer_
mappings list(object) - default_
aggregations list(object) - display_
name string - The meter's name.
- event_
name string - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - event_
time_ stringwindow - The time window which meter events have been pre-aggregated for, if any.
- livemode bool
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - object string
- String representing the object's type. Objects of the same type share the same value.
- status string
- The meter's status.
- status_
transitions object - updated number
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- value_
settings list(object)
- created Double
- Time at which the object was created. Measured in seconds since the Unix epoch.
- customer
Mappings List<BillingMeter Customer Mapping> - default
Aggregations List<BillingMeter Default Aggregation> - display
Name String - The meter's name.
- event
Name String - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - event
Time StringWindow - The time window which meter events have been pre-aggregated for, if any.
- livemode Boolean
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - object String
- String representing the object's type. Objects of the same type share the same value.
- status String
- The meter's status.
- status
Transitions BillingMeter Status Transitions - updated Double
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- value
Settings List<BillingMeter Value Setting>
- created number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- customer
Mappings BillingMeter Customer Mapping[] - default
Aggregations BillingMeter Default Aggregation[] - display
Name string - The meter's name.
- event
Name string - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - event
Time stringWindow - The time window which meter events have been pre-aggregated for, if any.
- livemode boolean
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - object string
- String representing the object's type. Objects of the same type share the same value.
- status string
- The meter's status.
- status
Transitions BillingMeter Status Transitions - updated number
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- value
Settings BillingMeter Value Setting[]
- created float
- Time at which the object was created. Measured in seconds since the Unix epoch.
- customer_
mappings Sequence[BillingMeter Customer Mapping Args] - default_
aggregations Sequence[BillingMeter Default Aggregation Args] - display_
name str - The meter's name.
- event_
name str - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - event_
time_ strwindow - The time window which meter events have been pre-aggregated for, if any.
- livemode bool
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - object str
- String representing the object's type. Objects of the same type share the same value.
- status str
- The meter's status.
- status_
transitions BillingMeter Status Transitions Args - updated float
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- value_
settings Sequence[BillingMeter Value Setting Args]
- created Number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- customer
Mappings List<Property Map> - default
Aggregations List<Property Map> - display
Name String - The meter's name.
- event
Name String - The name of the meter event to record usage for. Corresponds with the
event_namefield on meter events. - event
Time StringWindow - The time window which meter events have been pre-aggregated for, if any.
- livemode Boolean
- If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - object String
- String representing the object's type. Objects of the same type share the same value.
- status String
- The meter's status.
- status
Transitions Property Map - updated Number
- Time at which the object was last updated. Measured in seconds since the Unix epoch.
- value
Settings List<Property Map>
Supporting Types
BillingMeterCustomerMapping, BillingMeterCustomerMappingArgs
- Event
Payload stringKey - The key in the meter event payload to use for mapping the event to a customer.
- Type string
- The method for mapping a meter event to a customer.
- Event
Payload stringKey - The key in the meter event payload to use for mapping the event to a customer.
- Type string
- The method for mapping a meter event to a customer.
- event_
payload_ stringkey - The key in the meter event payload to use for mapping the event to a customer.
- type string
- The method for mapping a meter event to a customer.
- event
Payload StringKey - The key in the meter event payload to use for mapping the event to a customer.
- type String
- The method for mapping a meter event to a customer.
- event
Payload stringKey - The key in the meter event payload to use for mapping the event to a customer.
- type string
- The method for mapping a meter event to a customer.
- event_
payload_ strkey - The key in the meter event payload to use for mapping the event to a customer.
- type str
- The method for mapping a meter event to a customer.
- event
Payload StringKey - The key in the meter event payload to use for mapping the event to a customer.
- type String
- The method for mapping a meter event to a customer.
BillingMeterDefaultAggregation, BillingMeterDefaultAggregationArgs
- Formula string
- Specifies how events are aggregated.
- Formula string
- Specifies how events are aggregated.
- formula string
- Specifies how events are aggregated.
- formula String
- Specifies how events are aggregated.
- formula string
- Specifies how events are aggregated.
- formula str
- Specifies how events are aggregated.
- formula String
- Specifies how events are aggregated.
BillingMeterStatusTransitions, BillingMeterStatusTransitionsArgs
- Deactivated
At double - The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
- Deactivated
At float64 - The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
- deactivated_
at number - The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
- deactivated
At Double - The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
- deactivated
At number - The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
- deactivated_
at float - The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
- deactivated
At Number - The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
BillingMeterValueSetting, BillingMeterValueSettingArgs
- Event
Payload stringKey - The key in the meter event payload to use as the value for this meter.
- Event
Payload stringKey - The key in the meter event payload to use as the value for this meter.
- event_
payload_ stringkey - The key in the meter event payload to use as the value for this meter.
- event
Payload StringKey - The key in the meter event payload to use as the value for this meter.
- event
Payload stringKey - The key in the meter event payload to use as the value for this meter.
- event_
payload_ strkey - The key in the meter event payload to use as the value for this meter.
- event
Payload StringKey - The key in the meter event payload to use as the value for this meter.
Package Details
- Repository
- stripe stripe/terraform-provider-stripe
- License
- Notes
- This Pulumi package is based on the
stripeTerraform Provider.
published on Friday, Aug 14, 2026 by Pulumi