constructor()

in cdk/lib/cv-redact-tool.ts [20:61]


	constructor(scope: App, id: string, props: GuStackProps) {
		super(scope, id, props);

		const domainName = 'cv-redact.gutools.co.uk';

		const ec2App = new GuEc2App(this, {
			applicationPort: 9000,
			app: 'cv-redact-tool',
			access: {
				scope: AccessScope.PUBLIC,
			},
			instanceType: InstanceType.of(InstanceClass.T4G, InstanceSize.MEDIUM),
			certificateProps: {
				domainName,
			},
			monitoringConfiguration: {
				noMonitoring: true,
			},
			userData: {
				distributable: {
					fileName: 'cv-redact-tool.deb',
					executionStatement: `dpkg -i /cv-redact-tool/cv-redact-tool.deb`,
				},
			},
			scaling: {
				minimumInstances: 1,
				maximumInstances: 2,
			},
			applicationLogging: { enabled: true },
			imageRecipe: {
				Recipe: 'arm64-java21',
				Encrypted: true,
			},
		});

		new GuCname(this, 'cv-redact.gutools.co.uk - cert', {
			app: CvRedactTool.app.app,
			domainName,
			ttl: Duration.hours(1),
			resourceRecord: ec2App.loadBalancer.loadBalancerDnsName,
		});
	}