Skip to content

using standalone_ubuntu_oss_install.sh on ec2 fail the EC@ instance check #206

@orensharoni

Description

@orensharoni

The bug
when running the standalone_ubuntu_oss_install.sh on an ec2 instance the check fail and requires a
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY despite running on an ec2 with the proper Role

To Reproduce
Steps to reproduce the behavior:

  1. clone to an ec2 instance
  2. run standalone_ubuntu_oss_install.sh
  3. See error

Expected behavior
the script needs to pass the ec2 test.

Your environment

  • Version of the repo - master
  • S3 backend implementation you are using -AWS
  • Deploying stand-alone using the script
  • NGINX OSS
  • Authentication method-IAM

Additional context
I think it is since the check curl --output /dev/null --silent --head --fail --connect-timeout 2 "http://169.254.169.254"
refers to IMDSv1 and it needs to change to IMDSv2, i used the following:
TOKEN=curl --silent --fail --connect-timeout 2 -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" \ && curl --output /dev/null --silent --head --fail --connect-timeout 2 -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions