Skip to content

Commit

Permalink
Upgrade bootstrap infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie committed Oct 21, 2023
1 parent c99faa8 commit 44e0248
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
29 changes: 17 additions & 12 deletions infrastructure/somleng/backup_database/.terraform.lock.hcl

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

2 changes: 1 addition & 1 deletion infrastructure/somleng/backup_database/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "aws_ssm_parameter" "arm64_ami" {
name = "/aws/service/ami-amazon-linux-latest/al2022-ami-kernel-default-arm64"
name = "/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-arm64"
}

data "aws_s3_bucket" "backups" {
Expand Down
6 changes: 2 additions & 4 deletions infrastructure/somleng/backup_database/user-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

set -e

yum -y update

# install the version of postgres which matches the restore version
yum -y install postgresql13
dnf update
dnf -y install postgresql15

TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`
AWS_REGION="$(wget --header "X-aws-ec2-metadata-token: $TOKEN" -q -O - http://169.254.169.254/latest/meta-data/placement/region)"
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/somleng/bootstrap_database/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://aws.amazon.com/ec2/instance-types/t4/
data "aws_ssm_parameter" "arm64_ami" {
name = "/aws/service/ami-amazon-linux-latest/al2022-ami-kernel-default-arm64"
name = "/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-arm64"
}

data "aws_ssm_parameter" "db_master_password" {
Expand Down
6 changes: 2 additions & 4 deletions infrastructure/somleng/bootstrap_database/user-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

set -e

yum -y update

# install the version of postgres which matches the restore version
yum -y install postgresql13
dnf update
dnf -y install postgresql15

TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`

Expand Down

0 comments on commit 44e0248

Please sign in to comment.