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());
}
}
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
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,
});
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)
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
})
}
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,
});
});
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());
}
}
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}
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 string
- The unique name of the resource.
- args EventStreamsQuotaArgs
- 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 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 string
- The unique name of the resource.
- args EventStreamsQuotaArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EventStreamsQuotaArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
var eventStreamsQuotaResource = new EventStreamsQuota("eventStreamsQuotaResource", EventStreamsQuotaArgs.builder()
.consumerByteRate(0)
.entity("string")
.producerByteRate(0)
.resourceInstanceId("string")
.eventStreamsQuotaId("string")
.build());
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")
const eventStreamsQuotaResource = new ibm.EventStreamsQuota("eventStreamsQuotaResource", {
consumerByteRate: 0,
entity: "string",
producerByteRate: 0,
resourceInstanceId: "string",
eventStreamsQuotaId: "string",
});
type: ibm:EventStreamsQuota
properties:
consumerByteRate: 0
entity: string
eventStreamsQuotaId: string
producerByteRate: 0
resourceInstanceId: string
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:
- Consumer
Byte doubleRate - 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. - Producer
Byte doubleRate - The producer quota in bytes/second. Use -1 for no quota.
- Resource
Instance stringId - The ID or the CRN of the Event Streams service instance.
- Event
Streams stringQuota Id - (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 float64Rate - 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. - Producer
Byte float64Rate - The producer quota in bytes/second. Use -1 for no quota.
- Resource
Instance stringId - The ID or the CRN of the Event Streams service instance.
- Event
Streams stringQuota Id - (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 DoubleRate - 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. - producer
Byte DoubleRate - The producer quota in bytes/second. Use -1 for no quota.
- resource
Instance StringId - The ID or the CRN of the Event Streams service instance.
- event
Streams StringQuota Id - (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 numberRate - 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. - producer
Byte numberRate - The producer quota in bytes/second. Use -1 for no quota.
- resource
Instance stringId - The ID or the CRN of the Event Streams service instance.
- event
Streams stringQuota Id - (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_ floatrate - 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. - producer_
byte_ floatrate - The producer quota in bytes/second. Use -1 for no quota.
- resource_
instance_ strid - The ID or the CRN of the Event Streams service instance.
- event_
streams_ strquota_ id - (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 NumberRate - 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. - producer
Byte NumberRate - The producer quota in bytes/second. Use -1 for no quota.
- resource
Instance StringId - The ID or the CRN of the Event Streams service instance.
- event
Streams StringQuota Id - (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
- 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.
- Consumer
Byte doubleRate - 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. - Event
Streams stringQuota Id - (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 doubleRate - The producer quota in bytes/second. Use -1 for no quota.
- Resource
Instance stringId - The ID or the CRN of the Event Streams service instance.
- Consumer
Byte float64Rate - 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. - Event
Streams stringQuota Id - (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 float64Rate - The producer quota in bytes/second. Use -1 for no quota.
- Resource
Instance stringId - The ID or the CRN of the Event Streams service instance.
- consumer
Byte DoubleRate - 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. - event
Streams StringQuota Id - (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 DoubleRate - The producer quota in bytes/second. Use -1 for no quota.
- resource
Instance StringId - The ID or the CRN of the Event Streams service instance.
- consumer
Byte numberRate - 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. - event
Streams stringQuota Id - (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 numberRate - The producer quota in bytes/second. Use -1 for no quota.
- resource
Instance stringId - The ID or the CRN of the Event Streams service instance.
- consumer_
byte_ floatrate - 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_ strquota_ id - (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_ floatrate - The producer quota in bytes/second. Use -1 for no quota.
- resource_
instance_ strid - The ID or the CRN of the Event Streams service instance.
- consumer
Byte NumberRate - 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. - event
Streams StringQuota Id - (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 NumberRate - The producer quota in bytes/second. Use -1 for no quota.
- resource
Instance StringId - 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>
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
$ 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
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.