Kafka v3.8.0 published on Monday, Aug 26, 2024 by Pulumi
kafka.Quota
Explore with Pulumi AI
A resource for managing Kafka quotas.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as kafka from "@pulumi/kafka";
const quota = new kafka.Quota("quota", {
entityName: "app_consumer",
entityType: "client-id",
config: {
consumer_byte_rate: "5000000",
producer_byte_rate: "2500000",
},
});
import pulumi
import pulumi_kafka as kafka
quota = kafka.Quota("quota",
entity_name="app_consumer",
entity_type="client-id",
config={
"consumer_byte_rate": "5000000",
"producer_byte_rate": "2500000",
})
package main
import (
"github.com/pulumi/pulumi-kafka/sdk/v3/go/kafka"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kafka.NewQuota(ctx, "quota", &kafka.QuotaArgs{
EntityName: pulumi.String("app_consumer"),
EntityType: pulumi.String("client-id"),
Config: pulumi.StringMap{
"consumer_byte_rate": pulumi.String("5000000"),
"producer_byte_rate": pulumi.String("2500000"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Kafka = Pulumi.Kafka;
return await Deployment.RunAsync(() =>
{
var quota = new Kafka.Quota("quota", new()
{
EntityName = "app_consumer",
EntityType = "client-id",
Config =
{
{ "consumer_byte_rate", "5000000" },
{ "producer_byte_rate", "2500000" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.kafka.Quota;
import com.pulumi.kafka.QuotaArgs;
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 quota = new Quota("quota", QuotaArgs.builder()
.entityName("app_consumer")
.entityType("client-id")
.config(Map.ofEntries(
Map.entry("consumer_byte_rate", "5000000"),
Map.entry("producer_byte_rate", "2500000")
))
.build());
}
}
resources:
quota:
type: kafka:Quota
properties:
entityName: app_consumer
entityType: client-id
config:
consumer_byte_rate: '5000000'
producer_byte_rate: '2500000'
Create Quota Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Quota(name: string, args: QuotaArgs, opts?: CustomResourceOptions);
@overload
def Quota(resource_name: str,
args: QuotaArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Quota(resource_name: str,
opts: Optional[ResourceOptions] = None,
entity_name: Optional[str] = None,
entity_type: Optional[str] = None,
config: Optional[Mapping[str, str]] = None)
func NewQuota(ctx *Context, name string, args QuotaArgs, opts ...ResourceOption) (*Quota, error)
public Quota(string name, QuotaArgs args, CustomResourceOptions? opts = null)
type: kafka:Quota
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 QuotaArgs
- 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 QuotaArgs
- 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 QuotaArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args QuotaArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args QuotaArgs
- 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 quotaResource = new Kafka.Quota("quotaResource", new()
{
EntityName = "string",
EntityType = "string",
Config =
{
{ "string", "string" },
},
});
example, err := kafka.NewQuota(ctx, "quotaResource", &kafka.QuotaArgs{
EntityName: pulumi.String("string"),
EntityType: pulumi.String("string"),
Config: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var quotaResource = new Quota("quotaResource", QuotaArgs.builder()
.entityName("string")
.entityType("string")
.config(Map.of("string", "string"))
.build());
quota_resource = kafka.Quota("quotaResource",
entity_name="string",
entity_type="string",
config={
"string": "string",
})
const quotaResource = new kafka.Quota("quotaResource", {
entityName: "string",
entityType: "string",
config: {
string: "string",
},
});
type: kafka:Quota
properties:
config:
string: string
entityName: string
entityType: string
Quota Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Quota resource accepts the following input properties:
- Entity
Name string - The name of the entity to target.
- Entity
Type string - The type of entity. Valid values are
client-id
,user
,ip
. - Config Dictionary<string, string>
- A map of string k/v attributes.
- Entity
Name string - The name of the entity to target.
- Entity
Type string - The type of entity. Valid values are
client-id
,user
,ip
. - Config map[string]string
- A map of string k/v attributes.
- entity
Name String - The name of the entity to target.
- entity
Type String - The type of entity. Valid values are
client-id
,user
,ip
. - config Map<String,String>
- A map of string k/v attributes.
- entity
Name string - The name of the entity to target.
- entity
Type string - The type of entity. Valid values are
client-id
,user
,ip
. - config {[key: string]: string}
- A map of string k/v attributes.
- entity_
name str - The name of the entity to target.
- entity_
type str - The type of entity. Valid values are
client-id
,user
,ip
. - config Mapping[str, str]
- A map of string k/v attributes.
- entity
Name String - The name of the entity to target.
- entity
Type String - The type of entity. Valid values are
client-id
,user
,ip
. - config Map<String>
- A map of string k/v attributes.
Outputs
All input properties are implicitly available as output properties. Additionally, the Quota 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 Quota Resource
Get an existing Quota 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?: QuotaState, opts?: CustomResourceOptions): Quota
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
config: Optional[Mapping[str, str]] = None,
entity_name: Optional[str] = None,
entity_type: Optional[str] = None) -> Quota
func GetQuota(ctx *Context, name string, id IDInput, state *QuotaState, opts ...ResourceOption) (*Quota, error)
public static Quota Get(string name, Input<string> id, QuotaState? state, CustomResourceOptions? opts = null)
public static Quota get(String name, Output<String> id, QuotaState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Config Dictionary<string, string>
- A map of string k/v attributes.
- Entity
Name string - The name of the entity to target.
- Entity
Type string - The type of entity. Valid values are
client-id
,user
,ip
.
- Config map[string]string
- A map of string k/v attributes.
- Entity
Name string - The name of the entity to target.
- Entity
Type string - The type of entity. Valid values are
client-id
,user
,ip
.
- config Map<String,String>
- A map of string k/v attributes.
- entity
Name String - The name of the entity to target.
- entity
Type String - The type of entity. Valid values are
client-id
,user
,ip
.
- config {[key: string]: string}
- A map of string k/v attributes.
- entity
Name string - The name of the entity to target.
- entity
Type string - The type of entity. Valid values are
client-id
,user
,ip
.
- config Mapping[str, str]
- A map of string k/v attributes.
- entity_
name str - The name of the entity to target.
- entity_
type str - The type of entity. Valid values are
client-id
,user
,ip
.
- config Map<String>
- A map of string k/v attributes.
- entity
Name String - The name of the entity to target.
- entity
Type String - The type of entity. Valid values are
client-id
,user
,ip
.
Package Details
- Repository
- Kafka pulumi/pulumi-kafka
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
kafka
Terraform Provider.