mirror of
https://github.com/graphql-hive/console
synced 2026-04-27 17:37:17 +00:00
33 lines
862 B
TypeScript
33 lines
862 B
TypeScript
import { Config, Output } from '@pulumi/pulumi';
|
|
import { ServiceSecret } from '../utils/secrets';
|
|
import { Environment } from './environment';
|
|
|
|
export class ZendeskSecret extends ServiceSecret<{
|
|
subdomain: string | Output<string>;
|
|
username: string | Output<string>;
|
|
password: string | Output<string>;
|
|
}> {}
|
|
|
|
export function configureZendesk(input: { environment: Environment }) {
|
|
if (!input.environment.isProduction) {
|
|
return {
|
|
enabled: false,
|
|
secret: null,
|
|
};
|
|
}
|
|
|
|
const zendeskConfig = new Config('zendesk');
|
|
|
|
const secret = new ZendeskSecret('zendesk', {
|
|
subdomain: zendeskConfig.require('subdomain'),
|
|
username: zendeskConfig.require('username'),
|
|
password: zendeskConfig.requireSecret('password'),
|
|
});
|
|
|
|
return {
|
|
enabled: true,
|
|
secret,
|
|
};
|
|
}
|
|
|
|
export type Zendesk = ReturnType<typeof configureZendesk>;
|