Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/lib/cdk-constructs/src/autoscaling/launch-configuration.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import hashSum from 'hash-sum';
import * as cdk from '@aws-cdk/core';
import * as ssm from '@aws-cdk/aws-ssm';
import * as autoscaling from '@aws-cdk/aws-autoscaling';

export type LaunchConfigurationProps = autoscaling.CfnLaunchConfigurationProps;

/**
* Added to update the hash for Rsyslog UserData properties
*/
interface LaunchConfigurationCustomProps extends LaunchConfigurationProps {
centralBucketName?: string;
logGroupName?: string;
}

/**
* Wrapper around CfnLaunchConfiguration. The construct adds a hash to the launch configuration name that is based on
* the launch configuration properties. The hash makes sure the budget gets replaced correctly by CloudFormation.
*/
export class LaunchConfiguration extends autoscaling.CfnLaunchConfiguration {
constructor(scope: cdk.Construct, id: string, props: LaunchConfigurationProps) {
constructor(scope: cdk.Construct, id: string, props: LaunchConfigurationCustomProps) {
super(scope, id, props);

const hash = hashSum({ ...props, path: this.node.path });
Expand Down
2 changes: 2 additions & 0 deletions src/lib/cdk-constructs/src/vpc/asg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export class RsysLogAutoScalingGroup extends cdk.Construct {
},
},
],
centralBucketName: props.centralBucketName,
logGroupName: props.logGroupName,
});

const autoScalingGroupSize = props.desiredInstanceHosts;
Expand Down