Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install cloudwatch agent on ec2 instances #3647

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ cmd/convox/pkg
provider/aws/lambda/autoscale/handler
provider/aws/lambda/autoscale/lambda.zip
.vscode/
.DS_Store
4 changes: 4 additions & 0 deletions provider/aws/formation/rack.json
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,7 @@
] ] },
{ "Ref": "AWS::NoValue" }
] },
" - until yum install -y amazon-cloudwatch-agent; do echo \"Waiting for network\"; done;\n",
" - export http_proxy=", { "Ref": "HttpProxy" }, "\n",
" - echo http_proxy=", { "Ref": "HttpProxy" }, " >> /etc/environment\n",
" - export https_proxy=", { "Ref": "HttpProxy" }, "\n",
Expand Down Expand Up @@ -1796,6 +1797,7 @@
{ "Ref": "AWS::NoValue" }
] },
" - until yum install -y aws-cli nfs-utils; do echo \"Waiting for network\"; done;\n",
" - until yum install -y amazon-cloudwatch-agent; do echo \"Waiting for network\"; done;\n",
" - export IMDS_TOKEN=$(curl -X PUT 'http://169.254.169.254/latest/api/token' -H 'X-aws-ec2-metadata-token-ttl-seconds:21600')\n",
" - mkdir /volumes\n",
{ "Fn::If": [ "RegionHasEFS",
Expand Down Expand Up @@ -1841,6 +1843,7 @@
" - ", { "Ref": "InstanceRunCommand" }, "\n"
] ] }
] },
" - sudo yum install -y amazon-cloudwatch-agent",
" - export IMDS_TOKEN=$(curl -X PUT 'http://169.254.169.254/latest/api/token' -H 'X-aws-ec2-metadata-token-ttl-seconds:21600')\n",
" - export INSTANCE_ID=$(curl -s --noproxy 169.254.169.254 -H \"X-aws-ec2-metadata-token:$IMDS_TOKEN\" http://169.254.169.254/latest/meta-data/instance-id)\n",
" - export ASG_NAME=$(env $(cat /etc/environment) /usr/bin/aws autoscaling describe-auto-scaling-instances --instance-ids=$INSTANCE_ID --region ", {"Ref":"AWS::Region"}, " --output text --query 'AutoScalingInstances[0].AutoScalingGroupName')\n",
Expand Down Expand Up @@ -2288,6 +2291,7 @@
{ "Ref": "AWS::NoValue" }
] },
" - until yum install -y aws-cli nfs-utils; do echo \"Waiting for network\"; done;\n",
" - until yum install -y amazon-cloudwatch-agent; do echo \"Waiting for network\"; done;\n",
" - export IMDS_TOKEN=$(curl -X PUT 'http://169.254.169.254/latest/api/token' -H 'X-aws-ec2-metadata-token-ttl-seconds:21600')\n",
" - mkdir /volumes\n",
{ "Fn::If": [ "RegionHasEFS",
Expand Down