Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
Update to latest version of GuCDK branch
Browse files Browse the repository at this point in the history
  • Loading branch information
akash1810 committed Sep 13, 2024
1 parent 77c5224 commit 21cea49
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 49 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ exports[`The BasicAsgRollingUpdate stack matches the snapshot 1`] = `
},
},
"Resources": {
"AsgReplacingUpdatePolicy78CF34D5": {
"AsgRollingUpdatePolicy2A1DDC6F": {
"Properties": {
"PolicyDocument": {
"Statement": [
Expand All @@ -90,7 +90,7 @@ exports[`The BasicAsgRollingUpdate stack matches the snapshot 1`] = `
],
"Version": "2012-10-17",
},
"PolicyName": "AsgReplacingUpdatePolicy78CF34D5",
"PolicyName": "AsgRollingUpdatePolicy2A1DDC6F",
"Roles": [
{
"Ref": "InstanceRoleBasicC6212E32",
Expand Down Expand Up @@ -185,12 +185,12 @@ exports[`The BasicAsgRollingUpdate stack matches the snapshot 1`] = `
"MaxBatchSize": 6,
"MinInstancesInService": 3,
"MinSuccessfulInstancesPercent": 100,
"SuspendProcesses": [],
"PauseTime": "PT5M",
"SuspendProcesses": [
"AlarmNotification",
],
"WaitOnResourceSignals": true,
},
"AutoScalingScheduledAction": {
"IgnoreUnmodifiedGroupSizeProperties": true,
},
},
},
"CertificateBasicB449389E": {
Expand Down Expand Up @@ -828,6 +828,7 @@ exports[`The BasicAsgRollingUpdate stack matches the snapshot 1`] = `
"InstanceType": "t4g.micro",
"MetadataOptions": {
"HttpTokens": "required",
"InstanceMetadataTags": "enabled",
},
"SecurityGroupIds": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ exports[`The NoDesiredAsgRollingUpdate stack matches the snapshot 1`] = `
},
},
"Resources": {
"AsgReplacingUpdatePolicy78CF34D5": {
"AsgRollingUpdatePolicy2A1DDC6F": {
"Properties": {
"PolicyDocument": {
"Statement": [
Expand All @@ -90,7 +90,7 @@ exports[`The NoDesiredAsgRollingUpdate stack matches the snapshot 1`] = `
],
"Version": "2012-10-17",
},
"PolicyName": "AsgReplacingUpdatePolicy78CF34D5",
"PolicyName": "AsgRollingUpdatePolicy2A1DDC6F",
"Roles": [
{
"Ref": "InstanceRoleNodesired2CBB5C37",
Expand Down Expand Up @@ -184,12 +184,12 @@ exports[`The NoDesiredAsgRollingUpdate stack matches the snapshot 1`] = `
"MaxBatchSize": 6,
"MinInstancesInService": 3,
"MinSuccessfulInstancesPercent": 100,
"SuspendProcesses": [],
"PauseTime": "PT5M",
"SuspendProcesses": [
"AlarmNotification",
],
"WaitOnResourceSignals": true,
},
"AutoScalingScheduledAction": {
"IgnoreUnmodifiedGroupSizeProperties": true,
},
},
},
"CertificateNodesired85B8DCFE": {
Expand Down Expand Up @@ -827,6 +827,7 @@ exports[`The NoDesiredAsgRollingUpdate stack matches the snapshot 1`] = `
"InstanceType": "t4g.micro",
"MetadataOptions": {
"HttpTokens": "required",
"InstanceMetadataTags": "enabled",
},
"SecurityGroupIds": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ exports[`The ScalingAsgRollingUpdate stack matches the snapshot 1`] = `
"ScaleInArn": {
"Value": {
"Fn::GetAtt": [
"ScaleIn",
"AutoScalingGroupScalingScaleInA1C7C09B",
"Arn",
],
},
},
"ScaleOutArn": {
"Value": {
"Fn::GetAtt": [
"ScaleOut",
"AutoScalingGroupScalingScaleOut0D780FEC",
"Arn",
],
},
Expand All @@ -75,6 +75,11 @@ exports[`The ScalingAsgRollingUpdate stack matches the snapshot 1`] = `
"Description": "SSM parameter containing the Name (not ARN) on the kinesis stream",
"Type": "AWS::SSM::Parameter::Value<String>",
},
"MinInstancesInServiceForscaling": {
"Default": 3,
"MaxValue": 8,
"Type": "Number",
},
"VpcId": {
"Default": "/account/vpc/primary/id",
"Description": "Virtual Private Cloud to run EC2 instances within. Should NOT be the account default VPC.",
Expand All @@ -92,7 +97,7 @@ exports[`The ScalingAsgRollingUpdate stack matches the snapshot 1`] = `
},
},
"Resources": {
"AsgReplacingUpdatePolicy78CF34D5": {
"AsgRollingUpdatePolicy2A1DDC6F": {
"Properties": {
"PolicyDocument": {
"Statement": [
Expand All @@ -111,7 +116,7 @@ exports[`The ScalingAsgRollingUpdate stack matches the snapshot 1`] = `
],
"Version": "2012-10-17",
},
"PolicyName": "AsgReplacingUpdatePolicy78CF34D5",
"PolicyName": "AsgRollingUpdatePolicy2A1DDC6F",
"Roles": [
{
"Ref": "InstanceRoleScaling7E871D7B",
Expand Down Expand Up @@ -203,15 +208,39 @@ exports[`The ScalingAsgRollingUpdate stack matches the snapshot 1`] = `
"UpdatePolicy": {
"AutoScalingRollingUpdate": {
"MaxBatchSize": 9,
"MinInstancesInService": 3,
"MinInstancesInService": {
"Ref": "MinInstancesInServiceForscaling",
},
"MinSuccessfulInstancesPercent": 100,
"SuspendProcesses": [],
"PauseTime": "PT5M",
"SuspendProcesses": [
"AlarmNotification",
],
"WaitOnResourceSignals": true,
},
"AutoScalingScheduledAction": {
"IgnoreUnmodifiedGroupSizeProperties": true,
},
},
"AutoScalingGroupScalingScaleInA1C7C09B": {
"Properties": {
"AdjustmentType": "ChangeInCapacity",
"AutoScalingGroupName": {
"Ref": "AutoScalingGroupScalingASG8AF02C37",
},
"PolicyType": "SimpleScaling",
"ScalingAdjustment": -1,
},
"Type": "AWS::AutoScaling::ScalingPolicy",
},
"AutoScalingGroupScalingScaleOut0D780FEC": {
"Properties": {
"AdjustmentType": "ChangeInCapacity",
"AutoScalingGroupName": {
"Ref": "AutoScalingGroupScalingASG8AF02C37",
},
"PolicyType": "SimpleScaling",
"ScalingAdjustment": 1,
},
"Type": "AWS::AutoScaling::ScalingPolicy",
},
"CertificateScaling767DD870": {
"DeletionPolicy": "Retain",
Expand Down Expand Up @@ -675,28 +704,6 @@ exports[`The ScalingAsgRollingUpdate stack matches the snapshot 1`] = `
},
"Type": "AWS::IAM::Policy",
},
"ScaleIn": {
"Properties": {
"AdjustmentType": "ChangeInCapacity",
"AutoScalingGroupName": {
"Ref": "AutoScalingGroupScalingASG8AF02C37",
},
"PolicyType": "SimpleScaling",
"ScalingAdjustment": -1,
},
"Type": "AWS::AutoScaling::ScalingPolicy",
},
"ScaleOut": {
"Properties": {
"AdjustmentType": "ChangeInCapacity",
"AutoScalingGroupName": {
"Ref": "AutoScalingGroupScalingASG8AF02C37",
},
"PolicyType": "SimpleScaling",
"ScalingAdjustment": 1,
},
"Type": "AWS::AutoScaling::ScalingPolicy",
},
"SsmSshPolicy4CFC977E": {
"Properties": {
"PolicyDocument": {
Expand Down Expand Up @@ -870,6 +877,7 @@ exports[`The ScalingAsgRollingUpdate stack matches the snapshot 1`] = `
"InstanceType": "t4g.micro",
"MetadataOptions": {
"HttpTokens": "required",
"InstanceMetadataTags": "enabled",
},
"SecurityGroupIds": [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/cdk/lib/scaling-asg-rolling-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ export class ScalingAsgRollingUpdate extends GuStack {
'testing-asg-rolling-update.service',
);

const scaleOutPolicy = new CfnScalingPolicy(this, 'ScaleOut', {
const scaleOutPolicy = new CfnScalingPolicy(autoScalingGroup, 'ScaleOut', {
autoScalingGroupName: autoScalingGroup.autoScalingGroupName,
policyType: 'SimpleScaling',
adjustmentType: 'ChangeInCapacity',
scalingAdjustment: 1,
});

const scaleInPolicy = new CfnScalingPolicy(this, 'ScaleIn', {
const scaleInPolicy = new CfnScalingPolicy(autoScalingGroup, 'ScaleIn', {
autoScalingGroupName: autoScalingGroup.autoScalingGroupName,
policyType: 'SimpleScaling',
adjustmentType: 'ChangeInCapacity',
Expand Down
4 changes: 2 additions & 2 deletions packages/cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
},
"devDependencies": {
"@guardian/cdk": "github:guardian/cdk#aa/ec2-AutoScalingReplacingUpdate",
"aws-cdk": "2.153.0",
"aws-cdk-lib": "2.153.0",
"aws-cdk": "2.157.0",
"aws-cdk-lib": "2.157.0",
"constructs": "10.3.0",
"source-map-support": "0.5.21"
}
Expand Down

0 comments on commit 21cea49

Please sign in to comment.