Skip to content

Commit

Permalink
Merge pull request #1861 from govuk-one-login/AUT-3414
Browse files Browse the repository at this point in the history
AUT-3414 - Deploy ServiceDownPage in integration and production environments
  • Loading branch information
monhaque authored Jul 22, 2024
2 parents 93e6eb7 + 9a48ee9 commit 08b7c4c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-frontend-sp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy frontend (with SAM Deploy Pipeline)
on:
push:
branches:
- AUT-3364
- AUT-3414
workflow_dispatch:

jobs:
Expand Down
26 changes: 23 additions & 3 deletions cloudformation/template.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
AWSTemplateFormatVersion: '2010-09-09'
Description: Authentication Frontend application

Description: >
Authentication Frontend application
Transform:
- AWS::LanguageExtensions
- AWS::Serverless-2016-10-31
Expand Down Expand Up @@ -48,6 +51,15 @@ Parameters:
Default: 058264536367.dkr.ecr.eu-west-2.amazonaws.com/service-down-page-image-repository-containerrepository-5mf9vzblyt5l

Conditions:
DeployServiceDownPage:
Fn::Or:
- Fn::Equals:
- !Ref Environment
- "integration"
- Fn::Equals:
- !Ref Environment
- "production"

UseCodeSigning:
Fn::Not:
- Fn::Equals:
Expand Down Expand Up @@ -392,7 +404,7 @@ Resources:
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: !Sub "${AWS::StackName}-ecs-task-definition"
Family: !Sub "${Environment}-frontend-ecs-task-definition"
ContainerDefinitions:
- Name: "frontend-application"
Image: !Sub "${FrontendRegistry}:GIT-SHA-PLACEHOLDER"
Expand Down Expand Up @@ -813,6 +825,7 @@ Resources:
Priority: 10

ApplicationLoadBalancerListenerServiceDownRule:
Condition: DeployServiceDownPage
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
Actions:
Expand Down Expand Up @@ -903,6 +916,7 @@ Resources:
ToPort: 8080

ApplicationLoadBalancerSecurityGroupEgressServiceDownPage:
Condition: DeployServiceDownPage
Type: AWS::EC2::SecurityGroupEgress
Properties:
GroupId: !GetAtt ApplicationLoadBalancerSecurityGroup.GroupId
Expand All @@ -917,6 +931,7 @@ Resources:
#

ServiceDownECSService:
Condition: DeployServiceDownPage
Type: AWS::ECS::Service
DependsOn: ApplicationLoadBalancerListenerHTTPS
Properties:
Expand Down Expand Up @@ -955,6 +970,7 @@ Resources:
Value: govuk-one-login/authentication-frontend/cloudformation/template.yaml

ServiceDownSecurityGroup:
Condition: DeployServiceDownPage
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Security Group to access the Service down page
Expand Down Expand Up @@ -991,9 +1007,10 @@ Resources:
Value: govuk-one-login/authentication-frontend/cloudformation/template.yaml

ServiceDownTaskDefinition:
Condition: DeployServiceDownPage
Type: AWS::ECS::TaskDefinition
Properties:
Family: !Sub "${AWS::StackName}-frontend-service-down-page-ecs-task-definition"
Family: !Sub "${Environment}-frontend-service-down-page-ecs-task-definition"
ContainerDefinitions:
- Name: "service-down-page"
Image: !Sub "${ServiceDownPageRegistry}:GIT-SHA-PLACEHOLDER"
Expand Down Expand Up @@ -1026,6 +1043,7 @@ Resources:
Value: govuk-one-login/authentication-frontend/cloudformation/template.yaml

ServiceDownTaskExecutionRole:
Condition: DeployServiceDownPage
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Expand Down Expand Up @@ -1062,6 +1080,7 @@ Resources:
Value: govuk-one-login/authentication-frontend/cloudformation/template.yaml

ServiceDownLoadBalancerTargetGroup:
Condition: DeployServiceDownPage
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
Name: !Sub "${Environment}-fe-service-down"
Expand Down Expand Up @@ -1091,6 +1110,7 @@ Resources:
Value: govuk-one-login/authentication-frontend/cloudformation/template.yaml

ServiceDownTaskLogGroup:
Condition: DeployServiceDownPage
Type: AWS::Logs::LogGroup
Properties:
KmsKeyId: !GetAtt KmsKey.Arn
Expand Down

0 comments on commit 08b7c4c

Please sign in to comment.