diff --git a/dotcom-rendering/cdk/lib/__snapshots__/dotcom-rendering.test.ts.snap b/dotcom-rendering/cdk/lib/__snapshots__/dotcom-rendering.test.ts.snap index b64e837efce..c354c83a20c 100644 --- a/dotcom-rendering/cdk/lib/__snapshots__/dotcom-rendering.test.ts.snap +++ b/dotcom-rendering/cdk/lib/__snapshots__/dotcom-rendering.test.ts.snap @@ -2,18 +2,6 @@ exports[`The DotcomRendering stack matches the snapshot 1`] = ` { - "AWSTemplateFormatVersion": "2010-09-09", - "Description": "Frontend rendering service", - "Mappings": { - "Constants": { - "App": { - "Value": "rendering", - }, - "Stack": { - "Value": "frontend", - }, - }, - }, "Metadata": { "gu:cdk:constructs": [ "GuVpcParameter", @@ -54,35 +42,11 @@ exports[`The DotcomRendering stack matches the snapshot 1`] = ` }, }, "Parameters": { - "AMI": { - "Description": "AMI to use for instances", - "Type": "AWS::EC2::Image::Id", - }, "AMIRendering": { "Default": "/TEST/frontend/rendering/ami.imageId", "Description": "Amazon Machine Image ID for the app rendering. Use this in conjunction with AMIgo to keep AMIs up to date.", "Type": "AWS::SSM::Parameter::Value", }, - "App": { - "Default": "rendering", - "Description": "Application name", - "Type": "String", - }, - "Backend5XXAlarmPeriod": { - "Default": "60", - "Description": "(Optional) Duration in seconds before 5XX alarm is triggered", - "Type": "String", - }, - "Backend5XXAlarmThreshold": { - "Default": "100", - "Description": "(Optional) Max number of errors before the 5XX alarm is triggered", - "Type": "String", - }, - "Backend5XXConsecutivePeriod": { - "Default": "5", - "Description": "(Optional) Number of consecutive periods the threshold needs to be reached before 5XX alarm is triggered", - "Type": "String", - }, "DistributionBucketName": { "Default": "/account/services/artifact.bucket", "Description": "SSM parameter containing the S3 bucket name holding distribution artifacts", @@ -93,28 +57,15 @@ exports[`The DotcomRendering stack matches the snapshot 1`] = ` "Description": "S3 Bucket Name for ELB logs", "Type": "AWS::SSM::Parameter::Value", }, - "ELKStream": { - "Description": "name of the kinesis stream to use to send logs to the central ELK stack", - "Type": "String", - }, "ELKStreamId": { "Default": "/TEST/frontend/rendering/logging.stream.name", "Type": "AWS::SSM::Parameter::Value", }, - "InstanceType": { - "Description": "EC2 Instance Type to use for dotcom-rendering", - "Type": "String", - }, "LoggingStreamName": { "Default": "/account/services/logging.stream.name", "Description": "SSM parameter containing the Name (not ARN) on the kinesis stream", "Type": "AWS::SSM::Parameter::Value", }, - "NotificationAlarmAction": { - "Default": "", - "Description": "(Optional) ARN of action to execute when notification alarms change state", - "Type": "CommaDelimitedList", - }, "PrivateSubnets": { "Default": "/account/vpc/primary/subnets/private", "Description": "A list of private subnets", @@ -125,24 +76,6 @@ exports[`The DotcomRendering stack matches the snapshot 1`] = ` "Description": "A list of public subnets", "Type": "AWS::SSM::Parameter::Value>", }, - "Stack": { - "Default": "frontend", - "Description": "Stack name", - "Type": "String", - }, - "Stage": { - "AllowedValues": [ - "PROD", - "CODE", - ], - "Default": "CODE", - "Description": "Stage name", - "Type": "String", - }, - "Subnets": { - "Description": "The subnets where rendering instances will run", - "Type": "List", - }, "VpcId": { "Default": "/account/vpc/primary/id", "Description": "Virtual Private Cloud to run EC2 instances within. Should NOT be the account default VPC.", @@ -562,17 +495,6 @@ exports[`The DotcomRendering stack matches the snapshot 1`] = ` }, "Type": "AWS::IAM::Policy", }, - "InstanceProfile": { - "Properties": { - "Path": "/", - "Roles": [ - { - "Ref": "InstanceRole", - }, - ], - }, - "Type": "AWS::IAM::InstanceProfile", - }, "InstanceRole": { "Properties": { "AssumeRolePolicyDocument": { diff --git a/dotcom-rendering/cdk/lib/dotcom-rendering.ts b/dotcom-rendering/cdk/lib/dotcom-rendering.ts index 972db8133dd..631ff56c4f5 100644 --- a/dotcom-rendering/cdk/lib/dotcom-rendering.ts +++ b/dotcom-rendering/cdk/lib/dotcom-rendering.ts @@ -1,4 +1,3 @@ -import { join } from 'node:path'; import { GuAutoScalingGroup } from '@guardian/cdk/lib/constructs/autoscaling'; import { GuAmiParameter, @@ -25,7 +24,6 @@ import { import { CfnAlarm } from 'aws-cdk-lib/aws-cloudwatch'; import { InstanceType, Peer } from 'aws-cdk-lib/aws-ec2'; import { LoadBalancingProtocol } from 'aws-cdk-lib/aws-elasticloadbalancing'; -import { CfnInclude } from 'aws-cdk-lib/cloudformation-include'; import type { DCRProps } from './types'; import { getUserData } from './userData'; @@ -265,12 +263,6 @@ export class DotcomRendering extends GuStack { alarmActions: [scaleUpPolicy.attrArn], }); - const yamlTemplateFilePath = join( - __dirname, - '../..', - 'cloudformation.yml', - ); - const criticalAlertsTopicArn = `arn:aws:sns:${region}:${this.account}:Frontend-${stage}-CriticalAlerts`; const backend5XXAlarmThreshold = 100; const backend5XXAlarmPeriod = 60; @@ -296,17 +288,6 @@ export class DotcomRendering extends GuStack { okActions: [criticalAlertsTopicArn], }); - new CfnInclude(this, 'YamlTemplate', { - templateFile: yamlTemplateFilePath, - parameters: { - AutoscalingGroup: asg.autoScalingGroupName, - InternalLoadBalancer: loadBalancer.loadBalancerName, - InstanceRole: instanceRole.roleName, - ScaleUpPolicy: scaleUpPolicy.ref, - ScaleDownPolicy: scaleDownPolicy.ref, - }, - }); - new CfnOutput(this, 'LoadBalancerUrl', { value: loadBalancer.loadBalancerDnsName, }); diff --git a/dotcom-rendering/cloudformation.yml b/dotcom-rendering/cloudformation.yml deleted file mode 100644 index 11cb1b979ae..00000000000 --- a/dotcom-rendering/cloudformation.yml +++ /dev/null @@ -1,84 +0,0 @@ -# yaml-language-server: $schema=./cloudformation.yml -# ^ this setting effectively prevents the redhat.vscode-yaml extension from -# trying (and failing) to validate this against the Cloudformation YAML schema -# @see: https://github.com/redhat-developer/vscode-yaml/issues/245#issuecomment-885803310 -AWSTemplateFormatVersion: '2010-09-09' -Description: Frontend rendering service -Parameters: - Subnets: - Description: The subnets where rendering instances will run - Type: List - App: - Description: Application name - Type: String - Default: rendering - Stage: - Description: Stage name - Type: String - AllowedValues: - - PROD - - CODE - Default: CODE - Stack: - Description: Stack name - Type: String - Default: frontend - NotificationAlarmAction: - Type: CommaDelimitedList - Description: (Optional) ARN of action to execute when notification alarms change state - Default: '' - Backend5XXAlarmThreshold: - Type: String - Description: (Optional) Max number of errors before the 5XX alarm is triggered - Default: '100' - Backend5XXAlarmPeriod: - Type: String - Description: (Optional) Duration in seconds before 5XX alarm is triggered - Default: '60' - Backend5XXConsecutivePeriod: - Type: String - Description: (Optional) Number of consecutive periods the threshold needs to be reached before 5XX alarm is triggered - Default: '5' - InstanceType: - Type: String - Description: EC2 Instance Type to use for dotcom-rendering - AutoscalingGroup: - Description: Name of the Autoscaling group - Type: String - InternalLoadBalancer: - Description: Id of internal load balancer - Type: String - InstanceRole: - Description: Name of instance role - Type: String - ScaleDownPolicy: - Description: Ref of scale down policy - Type: AWS::AutoScaling::ScalingPolicy - ScaleUpPolicy: - Description: Ref of scale up policy - Type: AWS::AutoScaling::ScalingPolicy - # ! These params are not used but should be kept until the migration is finished - ELKStream: - Description: name of the kinesis stream to use to send logs to the central ELK stack - Type: String - AMI: - Description: AMI to use for instances - Type: AWS::EC2::Image::Id - -Mappings: - Constants: - Stack: - Value: frontend - App: - Value: rendering - -Resources: - InstanceProfile: - Type: AWS::IAM::InstanceProfile - Properties: - Path: / - Roles: - - Ref: InstanceRole - - -