From 17ce156d842496af92deb0b8682776dda1a99378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20Pether=20S=C3=B6rling?= Date: Thu, 18 May 2023 13:31:05 +0200 Subject: [PATCH 1/4] Update template.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VpcCidrPrefix. You want to ensure that each subnet is within the range of the VPC CIDR block and that subnets do not overlap with each other. Signed-off-by: James Pether Sörling --- cloudformation/template.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cloudformation/template.yml b/cloudformation/template.yml index a5334c5..e6603e1 100644 --- a/cloudformation/template.yml +++ b/cloudformation/template.yml @@ -13,6 +13,10 @@ Parameters: Description: Domain name (optional), used to setup route53 dns Type: String Default: hack23.com + VpcCidrPrefix: + Description: The first part of the CIDR block for the VPC and subnets + Type: String + Default: "10.1" Conditions: deployGlobalTable: !Equals - '' @@ -21,7 +25,7 @@ Resources: VPC: Type: "AWS::EC2::VPC" Properties: - CidrBlock: "10.1.0.0/16" + CidrBlock: !Sub "${VpcCidrPrefix}.0.0/16" EnableDnsHostnames: true EnableDnsSupport: true Tags: @@ -48,7 +52,7 @@ Resources: PrivateSubnet1: Type: "AWS::EC2::Subnet" Properties: - CidrBlock: "10.1.0.0/24" + CidrBlock: !Sub "${VpcCidrPrefix}.0.0/24" MapPublicIpOnLaunch: false VpcId: Ref: "VPC" @@ -63,7 +67,7 @@ Resources: PrivateSubnet2: Type: "AWS::EC2::Subnet" Properties: - CidrBlock: "10.1.1.0/24" + !Sub "${VpcCidrPrefix}.1.0/24" MapPublicIpOnLaunch: false VpcId: Ref: "VPC" @@ -78,7 +82,7 @@ Resources: PrivateSubnet3: Type: "AWS::EC2::Subnet" Properties: - CidrBlock: "10.1.2.0/24" + CidrBlock: !Sub "${VpcCidrPrefix}.2.0/24" MapPublicIpOnLaunch: false VpcId: Ref: "VPC" From 78130152909b052e9f1a77912064df06f581942c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20Pether=20S=C3=B6rling?= Date: Thu, 18 May 2023 13:42:08 +0200 Subject: [PATCH 2/4] Update template.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: James Pether Sörling --- cloudformation/template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudformation/template.yml b/cloudformation/template.yml index e6603e1..71b888b 100644 --- a/cloudformation/template.yml +++ b/cloudformation/template.yml @@ -67,7 +67,7 @@ Resources: PrivateSubnet2: Type: "AWS::EC2::Subnet" Properties: - !Sub "${VpcCidrPrefix}.1.0/24" + CidrBlock: !Sub "${VpcCidrPrefix}.1.0/24" MapPublicIpOnLaunch: false VpcId: Ref: "VPC" From 522523b2d94d44ee99d764c57bf8bc59e3591ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20Pether=20S=C3=B6rling?= Date: Thu, 18 May 2023 13:43:57 +0200 Subject: [PATCH 3/4] Update main.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: James Pether Sörling --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 035ca10..86bfe2f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -101,7 +101,7 @@ jobs: template: cloudformation/template.yml capabilities: CAPABILITY_NAMED_IAM no-fail-on-empty-changeset: "1" - parameter-overrides: "DomainNamePrefix=api,GlobalTableArn=${{ env.GlobalTableZoneFrankfurt }}" + parameter-overrides: "VpcCidrPrefix=10.5,DomainNamePrefix=api,GlobalTableArn=${{ env.GlobalTableZoneFrankfurt }}" - name: Get Output Frankfurt run: | HealthCheckId=`aws cloudformation describe-stacks --stack-name lambda-vpc --query "Stacks[0].Outputs[?OutputKey == 'HealthCheckId'].OutputValue" | grep -v '\[' | grep -v '\]' | xargs` From 5f4050260f360e242583bad232cb59b0b32acb2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20Pether=20S=C3=B6rling?= Date: Thu, 18 May 2023 13:51:06 +0200 Subject: [PATCH 4/4] Update app.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: James Pether Sörling --- cloudformation/app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudformation/app.yml b/cloudformation/app.yml index fcebc1f..aba3253 100644 --- a/cloudformation/app.yml +++ b/cloudformation/app.yml @@ -15,7 +15,7 @@ Resources: Policy: Software: RpoInSecs: 300 - RtoInSecs: 1800 + RtoInSecs: 5400 Hardware: RpoInSecs: 0 RtoInSecs: 0 @@ -24,7 +24,7 @@ Resources: RtoInSecs: 0 Region: RpoInSecs: 300 - RtoInSecs: 900 + RtoInSecs: 3600 PolicyDescription: "Global Mission Critical" PolicyName: GlobalMissionCritical Tier: MissionCritical