0

I am new to AWS. I wish to know -

  • how to configure AWS-CLI (setup access and secret keys) automatically by bootstrap the EC2 instance, such that when somebody logs into the running instance he gets the AWS CLI already configured automatically and can straight away start running commands using the cli
  • Also, if I create a custom AMI and configure AWS CLI on it, would all the instances that are derived from this custom AMI be getting the cli already configured ?

Any help will be appreciated.

5
  • Rather than hard coding credentials, why not use IAM roles? Commented May 19, 2023 at 2:43
  • Which AMI are you using to launch your Amazon EC2 instance? If you are using Amazon Linux, then the AWS CLI is already installed. Also, when you say "can straight away start running commands using the cli", which credentials would you want them to use? Would it be different for every user? Are they logging into the instance with their own username, or as ec2-user? Commented May 19, 2023 at 3:20
  • @John thanks for your reply. I am using Ubuntu. The users will login to EC2 instances with their own ids, but the aws cli should be preconfigured using a specific service- id in the EC2 instances. All users who log in should be able to run aws cli commands which should be preconfigured using the service id. Also, if I create a custom AMI and configure AWS CLI on it, would all the instances that are derived from this custom AMI be getting the cli preconfigured ?
    – marie20
    Commented May 19, 2023 at 9:28
  • What do you mean by service-id? What is it and how is it associated with a user? Commented May 19, 2023 at 10:21
  • well, by service-id i meant a generic process-id which is just another userid, and will be used to run the jobs in production. In prod we call service-ids as usernames.
    – marie20
    Commented May 22, 2023 at 0:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.