UNPKG

@cdklabs/cdk-amazonmq

Version:
127 lines (126 loc) 5.43 kB
import { IResolvable, IResource, Resource } from "aws-cdk-lib"; import { CfnBroker } from "aws-cdk-lib/aws-amazonmq"; import { Metric, MetricOptions } from "aws-cdk-lib/aws-cloudwatch"; import { ISecurityGroup, InstanceType, IVpc, SubnetSelection, Connections, Port } from "aws-cdk-lib/aws-ec2"; import { IRole } from "aws-cdk-lib/aws-iam"; import { IKey } from "aws-cdk-lib/aws-kms"; import { RetentionDays } from "aws-cdk-lib/aws-logs"; import { Construct } from "constructs"; import { BrokerCloudwatchLogsExports } from "./broker-cloudwatch-logs-exports"; import { BrokerDeploymentMode } from "./broker-deployment-mode"; import { IBrokerConfiguration } from "./configuration"; import { MaintenanceWindowStartTime } from "./maintenance-window-start-time"; import { StorageType } from "./storage-type"; export interface IBrokerDeployment extends IResource { readonly arn: string; readonly id: string; readonly name: string; readonly connections: Connections | undefined; /*** * @internal */ readonly _authenticationStrategy?: string; /*** * @internal */ readonly _engineVersion: string; metric(metricName: string, options?: MetricOptions): Metric; } export interface BrokerDeploymentProps { readonly key?: IKey; readonly brokerName?: string; /** * Specifies whether the broker is open to public Internet or deployed with * endpoints in own VPC. */ readonly publiclyAccessible: boolean; /** * vpcSubnets and vpc are optional. But when present - publiclyAccessible attribute must equal false. * * @default - undefined. If vpc is present - this attribute must be present. */ readonly vpcSubnets?: SubnetSelection; /** * The VPC in which create the communication endpoints for a private broker. * * @default - undefined. A default VPC will be used */ readonly vpc?: IVpc; /** * The Security Groups to apply for a non publicly accessible broker. * * NOTE: This needs to be set only if `publiclyAccessible` is true. * * @default - undefined. If no VPC is selected then a default VPC's default SG will be used. * Otherwise - a security group will be created. */ readonly securityGroups?: ISecurityGroup[]; /** * An instance type to use for the broker. Only a subset of available instance types is allowed. * * @see https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/broker-instance-types.html */ readonly instanceType: InstanceType; /** * Determines whether the broker will undergo a patch version upgrade during the maintenance window. * * NOTE: Contrary to the name this setting does not upgrade the minor versions, but patch versions (i.e. in the X.Y.Z notation - only the Z numbers are upgraded) * * @default - for versions with the patch version number the default is not to upgrade the patch versions; for versions withouth the patch version number patch versions are updated and this setting takes no effect. */ readonly autoMinorVersionUpgrade?: boolean; readonly maintenanceWindowStartTime?: MaintenanceWindowStartTime; /** * Sets the retention days for the broker's CloudWatch LogGroups * * @default - undefined; CloudWatch Log Groups retention is set to never expire */ readonly cloudwatchLogsRetention?: RetentionDays; readonly cloudwatchLogsRetentionRole?: IRole; } export declare enum BrokerEngine { RABBITMQ = "RABBITMQ", ACTIVEMQ = "ACTIVEMQ" } export interface BrokerDeploymentBaseProps extends BrokerDeploymentProps { readonly authenticationStrategy?: string; readonly version: string; readonly deploymentMode: BrokerDeploymentMode; readonly defaultPort?: Port; readonly engine: BrokerEngine; readonly storageType?: StorageType; readonly configuration?: IBrokerConfiguration; readonly cloudwatchLogsExports?: BrokerCloudwatchLogsExports; readonly users: CfnBroker.UserProperty[]; readonly ldapServerMetadata?: IResolvable | CfnBroker.LdapServerMetadataProperty; } export declare abstract class BrokerDeploymentBase extends Resource implements IBrokerDeployment { readonly arn: string; readonly id: string; readonly name: string; /** @internal */ readonly _authenticationStrategy?: string; /** @internal */ readonly _engineVersion: string; /** @internal */ protected readonly _conns: Connections | undefined; /** @internal */ protected readonly _resource: CfnBroker; /** @internal */ protected _configurationIdProperty: CfnBroker.ConfigurationIdProperty | undefined; /** @internal */ protected _configuration: IBrokerConfiguration | undefined; private readonly cloudwatchLogsExports?; private readonly cloudwatchLogsRetention?; private readonly cloudwatchLogsRetentionRole?; /** Manages connections for the cluster */ get connections(): Connections | undefined; constructor(scope: Construct, id: string, props: BrokerDeploymentBaseProps); protected assignConfigurationIdProperty(configuration: CfnBroker.ConfigurationIdProperty): void; metric(metricName: string, options?: MetricOptions): Metric; protected configureLogRetention(): void; /*** * @internal */ protected _attachConfiguration(configuration: IBrokerConfiguration): void; }