AivenKafka

Service-level Aiven Kafka topics, users, and ACLs component.

Remarks

This component supports creation and external references for Kafka topics, users, and ACLs. It emits resolved references by key. Configuration comes from either a typed definition or separate JSON files; the modes cannot be mixed. Typed handles preserve plan-time relationships and are resolved before resource registration; use { literal: '...' } for wildcard or external ACL subjects. Map keys determine child logical identity, while provider-level topicName and username remain independent. Created topics are always registered with Pulumi protect: true because Aiven topic replacement or deletion can destroy Kafka data.

Naming:

  • Root: type ${namespace}:aiven:AivenKafka; capability aiven-kafka; logical-only raw identity args.identity; ${env}-${projectHash}-aiven-kafka-${sanitised args.identity}. Punctuation-only values fail shared logical-identity validation.
  • Direct aiven:index/kafkaTopic:KafkaTopic, aiven:index/kafkaUser:KafkaUser, and aiven:index/kafkaAcl:KafkaAcl children each use [args.identity, args.topics.<key> | args.users.<key> | args.acls.<key>], yielding ${env}-${projectHash}-${sanitised args.identity}-${sanitised key}. Keys are raw identity discriminators and are preflighted per qualified provider type.
  • Provider names are Aiven-native semantic values, not AWS six-style names. KafkaTopic.topicName forwards args.topics.<key>.create.topicName, and KafkaUser.username forwards args.users.<key>.create.username, unchanged. KafkaAcl.permission forwards args.acls.<key>.create.permission; its topic and username come from the existing literal-or-key-selector resolution and are trimmed before forwarding. Aiven Kafka topic names have a known 1–249-character constraint, intentionally left to provider validation; the component enforces only plain non-empty strings. args.service.project and args.service.serviceName select the native service scope after the existing trim-and-scope validation. Intentional.

Example

CODE
const topics = defineAivenKafkaTopics({
  orders: { create: { topicName: 'company.orders.v1', partitions: 6, replication: 3 } },
});
const users = defineAivenKafkaUsers({ producer: { create: { username: 'svc-orders-producer' } } });
const definition = defineAivenKafkaDefinition({
  topics,
  users,
  acls: { write: { create: { permission: 'write', topic: topics.orders, username: users.producer } } },
});
const kafka = new AivenKafka({
  identity: 'orders',
  service: { project: 'platform', serviceName: 'kafka-main' },
  definition,
});
export const ordersTopicId = kafka.topicIdsByKey.orders;

Constructors

new AivenKafka( args: AivenKafkaArgs, options?: ComponentResourceOptions, ): AivenKafka

Parameters

  • args (AivenKafkaArgs)
  • options (ComponentResourceOptions, optional)

Returns

AivenKafka

Hierarchy

  • ComponentResource
  • AivenKafka

Properties

aclIdsByKey: Record<string, pulumi.Output<string>>

readonly

Resolved ACL ids keyed by canonical key.

aclsByKey: Record<string, pulumi.Output<AivenKafkaAclReferenceOutput>>

readonly

Resolved ACL references keyed by input key.

createdAcls: Record<string, aiven.KafkaAcl>

readonly

Create ACL resources keyed by input key.

createdTopics: Record<string, aiven.KafkaTopic>

readonly

Create topic resources keyed by input key.

createdUsers: Record<string, aiven.KafkaUser>

readonly

Create user resources keyed by input key.

project: Output<string>

readonly

Resolved project name for this component scope.

serviceName: Output<string>

readonly

Resolved service name for this component scope.

topicIdsByKey: Record<string, pulumi.Output<string>>

readonly

Resolved topic ids keyed by canonical key.

topicsByKey: Record<string, pulumi.Output<AivenKafkaTopicReferenceOutput>>

readonly

Resolved topic references keyed by input key.

urn: Output<string>

readonly

Inherited from urn

The stable logical URN used to distinctly address a resource, both before and after deployments.

userIdsByKey: Record<string, pulumi.Output<string>>

readonly

Resolved user ids keyed by canonical key.

usersByKey: Record<string, pulumi.Output<AivenKafkaUserReferenceOutput>>

readonly

Resolved user references keyed by input key.

Methods

getData(): Promise<any>

protectedasync

Inherited from getData

Retrieves the data produces by initialize. The data is immediately available in a derived class's constructor after the super(...) call to ComponentResource.

Returns

  • Promise<any>

getProvider(moduleMember: string): ProviderResource | undefined

Inherited from getProvider

Returns the provider for the given module member, if one exists.

Parameters

  • moduleMember (string)

Returns

  • ProviderResource | undefined

initialize( args: Inputs, opts?: ComponentResourceOptions, name?: string, type?: string, ): Promise<any>

protectedasync

Inherited from initialize

Can be overridden by a subclass to asynchronously initialize data for this component automatically when constructed. The data will be available immediately for subclass constructors to use. To access the data use getData.

Parameters

  • args (Inputs)
  • opts (ComponentResourceOptions, optional)
  • name (string, optional)
  • type (string, optional)

Returns

  • Promise<any>

registerOutputs( outputs?: Inputs | Promise<Inputs> | Output<Inputs>, ): void

protected

Inherited from registerOutputs

Registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.

Component resources can call this at the end of their constructor to indicate that they are done creating child resources. This is not strictly necessary as this will automatically be called after the initialize method completes.

Parameters

  • outputs (Inputs | Promise<Inputs> | Output<Inputs>, optional)

Returns

  • void

Static Methods

isInstance(obj: any): obj is ComponentResource<any>

static

Inherited from isInstance

Returns true if the given object is a CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

Parameters

  • obj (any)

Returns

  • obj is ComponentResource<any>