Skip to content

Commit

Permalink
feat: Migrate from t2 to t3 instance family (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwittig authored Apr 24, 2024
1 parent 3c0e48f commit e8131b2
Show file tree
Hide file tree
Showing 40 changed files with 63 additions and 63 deletions.
4 changes: 2 additions & 2 deletions chapter02/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Resources:
Properties:
AllocatedStorage: 5
BackupRetentionPeriod: 0
DBInstanceClass: 'db.t2.micro'
DBInstanceClass: 'db.t3.micro'
DBName: wordpress
Engine: MySQL
MasterUsername: wordpress
Expand Down Expand Up @@ -371,7 +371,7 @@ Resources:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
Monitoring:
Enabled: false
InstanceType: 't2.micro'
InstanceType: 't3.micro'
NetworkInterfaces:
- AssociatePublicIpAddress: true
DeviceIndex: 0
Expand Down
2 changes: 1 addition & 1 deletion chapter04/nodecc/lib/createVM.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = (amiId, subnetId, cb) => {
ImageId: amiId,
MinCount: 1,
MaxCount: 1,
InstanceType: 't2.micro',
InstanceType: 't3.micro',
SubnetId: subnetId
}, (err) => {
if (err) {
Expand Down
2 changes: 1 addition & 1 deletion chapter04/virtualmachine.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $ErrorActionPreference = "Stop"
$AMIID=aws ec2 describe-images --filters "Name=name,Values=amzn2-ami-hvm-2.0.202*-x86_64-gp2" --query "Images[0].ImageId" --output text
$VPCID=aws ec2 describe-vpcs --filter "Name=isDefault, Values=true" --query "Vpcs[0].VpcId" --output text
$SUBNETID=aws ec2 describe-subnets --filters "Name=vpc-id, Values=$VPCID" --query "Subnets[0].SubnetId" --output text
$INSTANCEID=aws ec2 run-instances --image-id $AMIID --instance-type t2.micro --subnet-id $SUBNETID --iam-instance-profile "Name=ec2-ssm-core" --query "Instances[0].InstanceId" --output text
$INSTANCEID=aws ec2 run-instances --image-id $AMIID --instance-type t3.micro --subnet-id $SUBNETID --iam-instance-profile "Name=ec2-ssm-core" --query "Instances[0].InstanceId" --output text
Write-Host "waiting for $INSTANCEID ..."
aws ec2 wait instance-running --instance-ids $INSTANCEID
Write-Host "$INSTANCEID is up and running"
Expand Down
2 changes: 1 addition & 1 deletion chapter04/virtualmachine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
AMIID="$(aws ec2 describe-images --filters "Name=name,Values=amzn2-ami-hvm-2.0.202*-x86_64-gp2" --query "Images[0].ImageId" --output text)"
VPCID="$(aws ec2 describe-vpcs --filter "Name=isDefault, Values=true" --query "Vpcs[0].VpcId" --output text)"
SUBNETID="$(aws ec2 describe-subnets --filters "Name=vpc-id, Values=$VPCID" --query "Subnets[0].SubnetId" --output text)"
INSTANCEID="$(aws ec2 run-instances --image-id "$AMIID" --instance-type t2.micro --subnet-id "$SUBNETID" --iam-instance-profile "Name=ec2-ssm-core" --query "Instances[0].InstanceId" --output text)"
INSTANCEID="$(aws ec2 run-instances --image-id "$AMIID" --instance-type t3.micro --subnet-id "$SUBNETID" --iam-instance-profile "Name=ec2-ssm-core" --query "Instances[0].InstanceId" --output text)"
echo "waiting for $INSTANCEID ..."
aws ec2 wait instance-running --instance-ids "$INSTANCEID"
echo "$INSTANCEID is up and running"
Expand Down
4 changes: 2 additions & 2 deletions chapter04/virtualmachine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Parameters:
InstanceType:
Description: 'Select one of the possible instance types'
Type: String
Default: 't2.micro'
AllowedValues: ['t2.micro', 't2.small', 't2.medium']
Default: 't3.micro'
AllowedValues: ['t3.micro', 't3.small', 't3.medium']
Mappings:
RegionMap:
'eu-north-1':
Expand Down
2 changes: 1 addition & 1 deletion chapter05/ec2-iam-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Resources:
Properties:
IamInstanceProfile: !Ref InstanceProfile
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
SecurityGroupIds:
- !Ref SecurityGroup
SubnetId: !Ref Subnet
Expand Down
2 changes: 1 addition & 1 deletion chapter05/ec2-os-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile
SecurityGroupIds:
- !Ref SecurityGroup
Expand Down
2 changes: 1 addition & 1 deletion chapter05/ec2-yum-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Resources:
Properties:
IamInstanceProfile: !Ref InstanceProfile
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
SecurityGroupIds:
- !Ref SecurityGroup
SubnetId: !Ref Subnet
Expand Down
2 changes: 1 addition & 1 deletion chapter05/firewall1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile # instead of ec2-ssm-core we use a instance profile created in the same template for testability
SecurityGroupIds:
- !Ref SecurityGroup
Expand Down
2 changes: 1 addition & 1 deletion chapter05/firewall2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile # instead of ec2-ssm-core we use a instance profile created in the same template for testability
SecurityGroupIds:
- !Ref SecurityGroup
Expand Down
2 changes: 1 addition & 1 deletion chapter05/firewall3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile # instead of ec2-ssm-core we use a instance profile created in the same template for testability
SecurityGroupIds:
- !Ref SecurityGroup
Expand Down
2 changes: 1 addition & 1 deletion chapter05/firewall4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile # instead of ec2-ssm-core we use a instance profile created in the same template for testability
SecurityGroupIds:
- !Ref SecurityGroup
Expand Down
4 changes: 2 additions & 2 deletions chapter05/firewall5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile # instead of ec2-ssm-core we use a instance profile created in the same template for testability
SecurityGroupIds:
- !Ref SecurityGroupProxy
Expand Down Expand Up @@ -187,7 +187,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile # instead of ec2-ssm-core we use a instance profile created in the same template for testability
SecurityGroupIds:
- !Ref SecurityGroupBackend
Expand Down
4 changes: 2 additions & 2 deletions chapter05/vpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ Resources:
Type: AWS::EC2::Instance
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile # instead of ec2-ssm-core we use a instance profile created in the same template for testability
SecurityGroupIds:
- !Ref SecurityGroup
Expand Down Expand Up @@ -485,7 +485,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile # instead of ec2-ssm-core we use a instance profile created in the same template for testability
SecurityGroupIds:
- !Ref SecurityGroup
Expand Down
2 changes: 1 addition & 1 deletion chapter08/ebs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Resources:
Properties:
IamInstanceProfile: !Ref InstanceProfile # instead of ec2-ssm-core we use a instance profile created in the same template for testability
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
SecurityGroupIds:
- !Ref SecurityGroup
SubnetId: !Ref Subnet
Expand Down
4 changes: 2 additions & 2 deletions chapter09/efs-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref IamInstanceProfile
NetworkInterfaces:
- AssociatePublicIpAddress: true
Expand Down Expand Up @@ -268,7 +268,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref IamInstanceProfile
NetworkInterfaces:
- AssociatePublicIpAddress: true
Expand Down
4 changes: 2 additions & 2 deletions chapter09/efs-provisioned.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref IamInstanceProfile
NetworkInterfaces:
- AssociatePublicIpAddress: true
Expand Down Expand Up @@ -269,7 +269,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref IamInstanceProfile
NetworkInterfaces:
- AssociatePublicIpAddress: true
Expand Down
4 changes: 2 additions & 2 deletions chapter09/efs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref IamInstanceProfile
NetworkInterfaces:
- AssociatePublicIpAddress: true
Expand Down Expand Up @@ -268,7 +268,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref IamInstanceProfile
NetworkInterfaces:
- AssociatePublicIpAddress: true
Expand Down
4 changes: 2 additions & 2 deletions chapter10/template-multiaz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Resources:
AllocatedStorage: 5
BackupRetentionPeriod: 3
PreferredBackupWindow: '05:00-06:00'
DBInstanceClass: 'db.t2.micro'
DBInstanceClass: 'db.t3.micro'
DBName: wordpress
Engine: MySQL
MasterUsername: wordpress
Expand Down Expand Up @@ -373,7 +373,7 @@ Resources:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
Monitoring:
Enabled: false
InstanceType: 't2.micro'
InstanceType: 't3.micro'
NetworkInterfaces:
- AssociatePublicIpAddress: true
DeviceIndex: 0
Expand Down
4 changes: 2 additions & 2 deletions chapter10/template-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Resources:
AllocatedStorage: 5
BackupRetentionPeriod: 3
PreferredBackupWindow: '05:00-06:00'
DBInstanceClass: 'db.t2.micro'
DBInstanceClass: 'db.t3.micro'
DBName: wordpress
Engine: MySQL
MasterUsername: wordpress
Expand Down Expand Up @@ -372,7 +372,7 @@ Resources:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
Monitoring:
Enabled: false
InstanceType: 't2.micro'
InstanceType: 't3.micro'
NetworkInterfaces:
- AssociatePublicIpAddress: true
DeviceIndex: 0
Expand Down
4 changes: 2 additions & 2 deletions chapter10/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Resources:
Properties:
AllocatedStorage: 5
BackupRetentionPeriod: 0
DBInstanceClass: 'db.t2.micro'
DBInstanceClass: 'db.t3.micro'
DBName: wordpress
Engine: MySQL
MasterUsername: wordpress
Expand Down Expand Up @@ -371,7 +371,7 @@ Resources:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
Monitoring:
Enabled: false
InstanceType: 't2.micro'
InstanceType: 't3.micro'
NetworkInterfaces:
- AssociatePublicIpAddress: true
DeviceIndex: 0
Expand Down
8 changes: 4 additions & 4 deletions chapter11/discourse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Resources:
Cache:
Type: 'AWS::ElastiCache::CacheCluster'
Properties:
CacheNodeType: 'cache.t2.micro'
CacheNodeType: 'cache.t3.micro'
CacheSubnetGroupName: !Ref CacheSubnetGroup
Engine: redis
EngineVersion: '6.2'
Expand Down Expand Up @@ -184,7 +184,7 @@ Resources:
Properties:
AllocatedStorage: 5
BackupRetentionPeriod: 0
DBInstanceClass: 'db.t2.micro'
DBInstanceClass: 'db.t3.micro'
DBName: discourse
Engine: postgres
EngineVersion: '12.15'
Expand Down Expand Up @@ -267,7 +267,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile
NetworkInterfaces:
- AssociatePublicIpAddress: true
Expand All @@ -285,7 +285,7 @@ Resources:
'Fn::Base64': !Sub |
#!/bin/bash -x
bash -ex << "TRY"
# t2.micro may not have enough memory, so we add a 1024MB swapfile
# t3.micro may not have enough memory, so we add a 1024MB swapfile
dd if=/dev/zero of=/swapfile1 bs=1024 count=1048576
chmod 0600 /swapfile1
mkswap /swapfile1
Expand Down
2 changes: 1 addition & 1 deletion chapter11/memorydb-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile
NetworkInterfaces:
- AssociatePublicIpAddress: true
Expand Down
4 changes: 2 additions & 2 deletions chapter11/redis-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Resources:
Cache:
Type: 'AWS::ElastiCache::CacheCluster'
Properties:
CacheNodeType: 'cache.t2.micro'
CacheNodeType: 'cache.t3.micro'
CacheSubnetGroupName: !Ref CacheSubnetGroup
Engine: redis
NumCacheNodes: 1
Expand Down Expand Up @@ -109,7 +109,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref InstanceProfile
NetworkInterfaces:
- AssociatePublicIpAddress: true
Expand Down
2 changes: 1 addition & 1 deletion chapter13/multiaz-efs-eip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Resources:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
Monitoring:
Enabled: false
InstanceType: 't2.micro'
InstanceType: 't3.micro'
NetworkInterfaces:
- AssociatePublicIpAddress: true
DeviceIndex: 0
Expand Down
2 changes: 1 addition & 1 deletion chapter13/multiaz-efs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Resources:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
Monitoring:
Enabled: false
InstanceType: 't2.micro'
InstanceType: 't3.micro'
NetworkInterfaces:
- AssociatePublicIpAddress: true
DeviceIndex: 0
Expand Down
2 changes: 1 addition & 1 deletion chapter13/multiaz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Resources:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
Monitoring:
Enabled: false
InstanceType: 't2.micro'
InstanceType: 't3.micro'
NetworkInterfaces:
- AssociatePublicIpAddress: true
DeviceIndex: 0
Expand Down
2 changes: 1 addition & 1 deletion chapter13/recovery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Resources:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
InstanceType: 't2.micro'
InstanceType: 't3.micro'
IamInstanceProfile: !Ref IamInstanceProfile
NetworkInterfaces:
- AssociatePublicIpAddress: true
Expand Down
2 changes: 1 addition & 1 deletion chapter14/loadbalancer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Resources:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
Monitoring:
Enabled: false
InstanceType: 't2.micro'
InstanceType: 't3.micro'
NetworkInterfaces:
- AssociatePublicIpAddress: true
DeviceIndex: 0
Expand Down
4 changes: 2 additions & 2 deletions chapter15/cloudformation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Resources:
ImageId: !FindInMap [RegionMap, !Ref 'AWS::Region', AMI]
Monitoring:
Enabled: false
InstanceType: 't2.micro'
InstanceType: 't3.micro'
NetworkInterfaces:
- AssociatePublicIpAddress: true
DeviceIndex: 0
Expand Down Expand Up @@ -287,7 +287,7 @@ Resources:
Properties:
AllocatedStorage: 5
BackupRetentionPeriod: 0
DBInstanceClass: 'db.t2.micro'
DBInstanceClass: 'db.t3.micro'
DBName: etherpad
Engine: MySQL
MasterUsername: etherpad
Expand Down
Loading

0 comments on commit e8131b2

Please sign in to comment.