1. Packages
  2. Ibm Provider
  3. API Docs
  4. EventStreamsQuota
ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud

ibm.EventStreamsQuota

Explore with Pulumi AI

Create, update or delete a quota of an Event Streams service instance. Both the default quota and user quotas may be managed. Quotas are only available on Event Streams Enterprise plan service instances. For more information about Event Streams quotas, see Setting Kafka quotas.

Example Usage

Sample 1: Create an Event Streams service instance and apply a default quota

Using entity = default in the quota resource sets the default quota, which applies to all users for which no user quota has been set.

Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.ResourceInstance;
import com.pulumi.ibm.ResourceInstanceArgs;
import com.pulumi.ibm.EventStreamsQuota;
import com.pulumi.ibm.EventStreamsQuotaArgs;
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 esInstance1 = new ResourceInstance("esInstance1", ResourceInstanceArgs.builder()
            .service("messagehub")
            .plan("enterprise-3nodes-2tb")
            .location("us-south")
            .resourceGroupId(data.ibm_resource_group().group().id())
            .timeouts(ResourceInstanceTimeoutsArgs.builder()
                .create("3h")
                .update("1h")
                .delete("15m")
                .build())
            .build());

        var esQuota1 = new EventStreamsQuota("esQuota1", EventStreamsQuotaArgs.builder()
            .resourceInstanceId(esInstance1.resourceInstanceId())
            .entity("default")
            .producerByteRate(16384)
            .consumerByteRate(32768)
            .build());

    }
}
Copy
resources:
  esInstance1:
    type: ibm:ResourceInstance
    properties:
      service: messagehub
      plan: enterprise-3nodes-2tb
      location: us-south
      resourceGroupId: ${data.ibm_resource_group.group.id}
      timeouts:
        - create: 3h
          update: 1h
          delete: 15m
  esQuota1:
    type: ibm:EventStreamsQuota
    properties:
      resourceInstanceId: ${esInstance1.resourceInstanceId}
      entity: default
      producerByteRate: 16384
      consumerByteRate: 32768
Copy

Sample 2: Create a user quota on an existing Event Streams instance

The quota is set for the user with the given IAM ID. The producer rate is limited, the consumer rate is unlimited (-1).

import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";

const esInstance2 = ibm.getResourceInstance({
    name: "terraform-integration-2",
    resourceGroupId: data.ibm_resource_group.group.id,
});
const esQuota2 = new ibm.EventStreamsQuota("esQuota2", {
    resourceInstanceId: ibm_resource_instance.es_instance_2.id,
    entity: "iam-ServiceId-00001111-2222-3333-4444-555566667777",
    producerByteRate: 16384,
    consumerByteRate: -1,
});
Copy
import pulumi
import pulumi_ibm as ibm

es_instance2 = ibm.get_resource_instance(name="terraform-integration-2",
    resource_group_id=data["ibm_resource_group"]["group"]["id"])
es_quota2 = ibm.EventStreamsQuota("esQuota2",
    resource_instance_id=ibm_resource_instance["es_instance_2"]["id"],
    entity="iam-ServiceId-00001111-2222-3333-4444-555566667777",
    producer_byte_rate=16384,
    consumer_byte_rate=-1)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ibm.LookupResourceInstance(ctx, &ibm.LookupResourceInstanceArgs{
			Name:            pulumi.StringRef("terraform-integration-2"),
			ResourceGroupId: pulumi.StringRef(data.Ibm_resource_group.Group.Id),
		}, nil)
		if err != nil {
			return err
		}
		_, err = ibm.NewEventStreamsQuota(ctx, "esQuota2", &ibm.EventStreamsQuotaArgs{
			ResourceInstanceId: pulumi.Any(ibm_resource_instance.Es_instance_2.Id),
			Entity:             pulumi.String("iam-ServiceId-00001111-2222-3333-4444-555566667777"),
			ProducerByteRate:   pulumi.Float64(16384),
			ConsumerByteRate:   pulumi.Float64(-1),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;

return await Deployment.RunAsync(() => 
{
    var esInstance2 = Ibm.GetResourceInstance.Invoke(new()
    {
        Name = "terraform-integration-2",
        ResourceGroupId = data.Ibm_resource_group.Group.Id,
    });

    var esQuota2 = new Ibm.EventStreamsQuota("esQuota2", new()
    {
        ResourceInstanceId = ibm_resource_instance.Es_instance_2.Id,
        Entity = "iam-ServiceId-00001111-2222-3333-4444-555566667777",
        ProducerByteRate = 16384,
        ConsumerByteRate = -1,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IbmFunctions;
import com.pulumi.ibm.inputs.GetResourceInstanceArgs;
import com.pulumi.ibm.EventStreamsQuota;
import com.pulumi.ibm.EventStreamsQuotaArgs;
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) {
        final var esInstance2 = IbmFunctions.getResourceInstance(GetResourceInstanceArgs.builder()
            .name("terraform-integration-2")
            .resourceGroupId(data.ibm_resource_group().group().id())
            .build());

        var esQuota2 = new EventStreamsQuota("esQuota2", EventStreamsQuotaArgs.builder()
            .resourceInstanceId(ibm_resource_instance.es_instance_2().id())
            .entity("iam-ServiceId-00001111-2222-3333-4444-555566667777")
            .producerByteRate(16384)
            .consumerByteRate(-1)
            .build());

    }
}
Copy
resources:
  esQuota2:
    type: ibm:EventStreamsQuota
    properties:
      resourceInstanceId: ${ibm_resource_instance.es_instance_2.id}
      entity: iam-ServiceId-00001111-2222-3333-4444-555566667777
      producerByteRate: 16384
      consumerByteRate: -1
variables:
  esInstance2:
    fn::invoke:
      function: ibm:getResourceInstance
      arguments:
        name: terraform-integration-2
        resourceGroupId: ${data.ibm_resource_group.group.id}
Copy

Create EventStreamsQuota Resource

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

Constructor syntax

new EventStreamsQuota(name: string, args: EventStreamsQuotaArgs, opts?: CustomResourceOptions);
@overload
def EventStreamsQuota(resource_name: str,
                      args: EventStreamsQuotaArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def EventStreamsQuota(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      consumer_byte_rate: Optional[float] = None,
                      entity: Optional[str] = None,
                      producer_byte_rate: Optional[float] = None,
                      resource_instance_id: Optional[str] = None,
                      event_streams_quota_id: Optional[str] = None)
func NewEventStreamsQuota(ctx *Context, name string, args EventStreamsQuotaArgs, opts ...ResourceOption) (*EventStreamsQuota, error)
public EventStreamsQuota(string name, EventStreamsQuotaArgs args, CustomResourceOptions? opts = null)
public EventStreamsQuota(String name, EventStreamsQuotaArgs args)
public EventStreamsQuota(String name, EventStreamsQuotaArgs args, CustomResourceOptions options)
type: ibm:EventStreamsQuota
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. EventStreamsQuotaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. EventStreamsQuotaArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. EventStreamsQuotaArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. EventStreamsQuotaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. EventStreamsQuotaArgs
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 eventStreamsQuotaResource = new Ibm.EventStreamsQuota("eventStreamsQuotaResource", new()
{
    ConsumerByteRate = 0,
    Entity = "string",
    ProducerByteRate = 0,
    ResourceInstanceId = "string",
    EventStreamsQuotaId = "string",
});
Copy
example, err := ibm.NewEventStreamsQuota(ctx, "eventStreamsQuotaResource", &ibm.EventStreamsQuotaArgs{
ConsumerByteRate: pulumi.Float64(0),
Entity: pulumi.String("string"),
ProducerByteRate: pulumi.Float64(0),
ResourceInstanceId: pulumi.String("string"),
EventStreamsQuotaId: pulumi.String("string"),
})
Copy
var eventStreamsQuotaResource = new EventStreamsQuota("eventStreamsQuotaResource", EventStreamsQuotaArgs.builder()
    .consumerByteRate(0)
    .entity("string")
    .producerByteRate(0)
    .resourceInstanceId("string")
    .eventStreamsQuotaId("string")
    .build());
Copy
event_streams_quota_resource = ibm.EventStreamsQuota("eventStreamsQuotaResource",
    consumer_byte_rate=0,
    entity="string",
    producer_byte_rate=0,
    resource_instance_id="string",
    event_streams_quota_id="string")
Copy
const eventStreamsQuotaResource = new ibm.EventStreamsQuota("eventStreamsQuotaResource", {
    consumerByteRate: 0,
    entity: "string",
    producerByteRate: 0,
    resourceInstanceId: "string",
    eventStreamsQuotaId: "string",
});
Copy
type: ibm:EventStreamsQuota
properties:
    consumerByteRate: 0
    entity: string
    eventStreamsQuotaId: string
    producerByteRate: 0
    resourceInstanceId: string
Copy

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

ConsumerByteRate This property is required. double
The consumer quota in bytes/second. Use -1 for no quota.
Entity This property is required. string
Either default to set the default quota, or an IAM ID for a user quota.
ProducerByteRate This property is required. double
The producer quota in bytes/second. Use -1 for no quota.
ResourceInstanceId This property is required. string
The ID or the CRN of the Event Streams service instance.
EventStreamsQuotaId string
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.
ConsumerByteRate This property is required. float64
The consumer quota in bytes/second. Use -1 for no quota.
Entity This property is required. string
Either default to set the default quota, or an IAM ID for a user quota.
ProducerByteRate This property is required. float64
The producer quota in bytes/second. Use -1 for no quota.
ResourceInstanceId This property is required. string
The ID or the CRN of the Event Streams service instance.
EventStreamsQuotaId string
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.
consumerByteRate This property is required. Double
The consumer quota in bytes/second. Use -1 for no quota.
entity This property is required. String
Either default to set the default quota, or an IAM ID for a user quota.
producerByteRate This property is required. Double
The producer quota in bytes/second. Use -1 for no quota.
resourceInstanceId This property is required. String
The ID or the CRN of the Event Streams service instance.
eventStreamsQuotaId String
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.
consumerByteRate This property is required. number
The consumer quota in bytes/second. Use -1 for no quota.
entity This property is required. string
Either default to set the default quota, or an IAM ID for a user quota.
producerByteRate This property is required. number
The producer quota in bytes/second. Use -1 for no quota.
resourceInstanceId This property is required. string
The ID or the CRN of the Event Streams service instance.
eventStreamsQuotaId string
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.
consumer_byte_rate This property is required. float
The consumer quota in bytes/second. Use -1 for no quota.
entity This property is required. str
Either default to set the default quota, or an IAM ID for a user quota.
producer_byte_rate This property is required. float
The producer quota in bytes/second. Use -1 for no quota.
resource_instance_id This property is required. str
The ID or the CRN of the Event Streams service instance.
event_streams_quota_id str
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.
consumerByteRate This property is required. Number
The consumer quota in bytes/second. Use -1 for no quota.
entity This property is required. String
Either default to set the default quota, or an IAM ID for a user quota.
producerByteRate This property is required. Number
The producer quota in bytes/second. Use -1 for no quota.
resourceInstanceId This property is required. String
The ID or the CRN of the Event Streams service instance.
eventStreamsQuotaId String
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.

Outputs

All input properties are implicitly available as output properties. Additionally, the EventStreamsQuota 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 str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing EventStreamsQuota Resource

Get an existing EventStreamsQuota 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?: EventStreamsQuotaState, opts?: CustomResourceOptions): EventStreamsQuota
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        consumer_byte_rate: Optional[float] = None,
        entity: Optional[str] = None,
        event_streams_quota_id: Optional[str] = None,
        producer_byte_rate: Optional[float] = None,
        resource_instance_id: Optional[str] = None) -> EventStreamsQuota
func GetEventStreamsQuota(ctx *Context, name string, id IDInput, state *EventStreamsQuotaState, opts ...ResourceOption) (*EventStreamsQuota, error)
public static EventStreamsQuota Get(string name, Input<string> id, EventStreamsQuotaState? state, CustomResourceOptions? opts = null)
public static EventStreamsQuota get(String name, Output<String> id, EventStreamsQuotaState state, CustomResourceOptions options)
resources:  _:    type: ibm:EventStreamsQuota    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ConsumerByteRate double
The consumer quota in bytes/second. Use -1 for no quota.
Entity string
Either default to set the default quota, or an IAM ID for a user quota.
EventStreamsQuotaId string
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.
ProducerByteRate double
The producer quota in bytes/second. Use -1 for no quota.
ResourceInstanceId string
The ID or the CRN of the Event Streams service instance.
ConsumerByteRate float64
The consumer quota in bytes/second. Use -1 for no quota.
Entity string
Either default to set the default quota, or an IAM ID for a user quota.
EventStreamsQuotaId string
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.
ProducerByteRate float64
The producer quota in bytes/second. Use -1 for no quota.
ResourceInstanceId string
The ID or the CRN of the Event Streams service instance.
consumerByteRate Double
The consumer quota in bytes/second. Use -1 for no quota.
entity String
Either default to set the default quota, or an IAM ID for a user quota.
eventStreamsQuotaId String
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.
producerByteRate Double
The producer quota in bytes/second. Use -1 for no quota.
resourceInstanceId String
The ID or the CRN of the Event Streams service instance.
consumerByteRate number
The consumer quota in bytes/second. Use -1 for no quota.
entity string
Either default to set the default quota, or an IAM ID for a user quota.
eventStreamsQuotaId string
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.
producerByteRate number
The producer quota in bytes/second. Use -1 for no quota.
resourceInstanceId string
The ID or the CRN of the Event Streams service instance.
consumer_byte_rate float
The consumer quota in bytes/second. Use -1 for no quota.
entity str
Either default to set the default quota, or an IAM ID for a user quota.
event_streams_quota_id str
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.
producer_byte_rate float
The producer quota in bytes/second. Use -1 for no quota.
resource_instance_id str
The ID or the CRN of the Event Streams service instance.
consumerByteRate Number
The consumer quota in bytes/second. Use -1 for no quota.
entity String
Either default to set the default quota, or an IAM ID for a user quota.
eventStreamsQuotaId String
(String) The ID of the quota in CRN format. The last field of the CRN is either default, or the IAM ID of the user. See the examples in the import section.
producerByteRate Number
The producer quota in bytes/second. Use -1 for no quota.
resourceInstanceId String
The ID or the CRN of the Event Streams service instance.

Import

The ibm_event_streams_quota resource can be imported by using the ID in CRN format. The three colon-separated parameters of the CRN are:

  • instance CRN = CRN of the Event Streams instance

  • resource type = quota

  • quota entity = default or the IAM ID of the user

Syntax

$ pulumi import ibm:index/eventStreamsQuota:EventStreamsQuota es_quota <crn>
Copy

Examples

$ pulumi import ibm:index/eventStreamsQuota:EventStreamsQuota es_quota_default crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:ffffffff-eeee-dddd-cccc-bbbbaaaa9999:quota:default
Copy
$ pulumi import ibm:index/eventStreamsQuota:EventStreamsQuota es_quota_user crn:v1:bluemix:public:messagehub:us-south:a/6db1b0d0b5c54ee5c201552547febcd8:ffffffff-eeee-dddd-cccc-bbbbaaaa9999:quota:iam-ServiceId-00001111-2222-3333-4444-555566667777
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
ibm ibm-cloud/terraform-provider-ibm
License
Notes
This Pulumi package is based on the ibm Terraform Provider.