mirror of
https://github.com/graphql-hive/console
synced 2026-04-26 00:47:16 +00:00
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import * as pulumi from '@pulumi/pulumi';
|
|
import { ServiceSecret } from '../utils/secrets';
|
|
|
|
export type Kafka = ReturnType<typeof deployKafka>;
|
|
|
|
export class KafkaSecret extends ServiceSecret<{
|
|
ssl: '0' | '1' | pulumi.Output<'0' | '1'>;
|
|
saslUsername: string | pulumi.Output<string>;
|
|
saslPassword: string | pulumi.Output<string>;
|
|
endpoint: string | pulumi.Output<string>;
|
|
}> {}
|
|
|
|
export function deployKafka() {
|
|
const eventhubConfig = new pulumi.Config('eventhub');
|
|
const secret = new KafkaSecret('kafka', {
|
|
ssl: '1',
|
|
saslUsername: '$ConnectionString',
|
|
saslPassword: eventhubConfig.requireSecret('key'),
|
|
endpoint: eventhubConfig.require('endpoint'),
|
|
});
|
|
|
|
return {
|
|
secret,
|
|
config: {
|
|
saslMechanism: 'plain',
|
|
concurrency: '1',
|
|
bufferSize: eventhubConfig.require('bufferSize'),
|
|
bufferInterval: eventhubConfig.require('bufferInterval'),
|
|
bufferDynamic: eventhubConfig.require('bufferDynamic'),
|
|
topic: eventhubConfig.require('topic'),
|
|
consumerGroup: eventhubConfig.require('consumerGroup'),
|
|
},
|
|
};
|
|
}
|