Skip to content

Commit

Permalink
others: ci skip: sample startup script for asg
Browse files Browse the repository at this point in the history
  • Loading branch information
flowerinthenight committed Oct 1, 2024
1 parent 2f57400 commit 3182caa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions aws-asg-startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
mkdir /opt/zgroup/ && cd /opt/zgroup/
wget https://github.com/flowerinthenight/zgroup/releases/download/v0.3.2/zgroup-v0.3.2-x86_64-linux.tar.gz
tar -xzvf zgroup-v0.3.2-x86_64-linux.tar.gz
# METADATA_TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
# INTERNAL_IP=$(curl -H "X-aws-ec2-metadata-token: $METADATA_TOKEN" http://169.254.169.254/latest/meta-data/local-ipv4)
# ZGROUP_JOIN_PREFIX=0b9303ad-1beb-483f-abb5-bc58e0214531 ./zgroup group1 ${INTERNAL_IP}:8080 2>&1 | logger &
METADATA_TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
INTERNAL_IP=$(curl -H "X-aws-ec2-metadata-token: $METADATA_TOKEN" http://169.254.169.254/latest/meta-data/local-ipv4)
ZGROUP_JOIN_PREFIX=0b9303ad-1beb-483f-abb5-bc58e0214531 ./zgroup group1 ${INTERNAL_IP}:8080 2>&1 | logger &
2 changes: 1 addition & 1 deletion src/scratch.zig
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,5 @@ test "envmap" {
// gcloud compute instance-groups managed create example-rmig --template sample-template-custom --size 3 --region asia-northeast1
// sudo journalctl -u google-startup-scripts.service

// aws ec2 create-launch-template --launch-template-name zgroup-lt --version-description version1 --launch-template-data '{"UserData":"","ImageId":"ami-0f75d1a8c9141bd00","InstanceType":"t2.micro"}'
// aws ec2 create-launch-template --launch-template-name zgroup-lt --version-description version1 --launch-template-data '{"UserData":"'"$(cat aws-asg-startup.sh | base64 -w 0)"'","ImageId":"ami-0f75d1a8c9141bd00","InstanceType":"t2.micro"}'
// aws autoscaling create-auto-scaling-group --auto-scaling-group-name zgroup-asg --launch-template LaunchTemplateName=zgroup-lt,Version='1' --min-size 1 --max-size 1 --availability-zones ap-northeast-1a

0 comments on commit 3182caa

Please sign in to comment.