Skip to content

Commit

Permalink
modify user data for new aws ami
Browse files Browse the repository at this point in the history
  • Loading branch information
cuotos committed Dec 19, 2024
1 parent 8f8ae6e commit 73862e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ No modules.
| [aws_ec2_instance_state.instance](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_instance_state) | resource |
| [aws_iam_instance_profile.profile](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_instance_profile) | resource |
| [aws_iam_role.role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role_policy_attachment.policies](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_instance.instance](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance) | resource |
| [aws_security_group.security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
| [random_string.module_suffix](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
Expand Down
6 changes: 3 additions & 3 deletions user_data.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

amazon-linux-extras install -y docker epel
yum install -y \
docker \
git \
htop \
nc \
Expand All @@ -12,11 +12,11 @@ chkconfig docker on
usermod -a -G docker ec2-user

# install docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

# Login to ECR
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin $${AWS_ACCOUNT_ID}.dkr.ecr.eu-west-1.amazonaws.com

${additional_user_data}
${additional_user_data}

0 comments on commit 73862e6

Please sign in to comment.