Associate a Role to a running AWS instance

前端 未结 4 846
陌清茗
陌清茗 2021-02-13 04:40

In order to run AWS monitoring scripts (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts-perl.html) on one of my ec2 existing instance, I need a IAM

4条回答
  •  时光取名叫无心
    2021-02-13 04:50

    If not, what can I do? Launch a new instance with a role and transfert the volumes to it?

    This is one option but it might take you a long time if you have a lot instances.

    The other option is to simply use IAM by creating a new user then add the Amazon CloudWatch PutMetricData operation permission to that user. Then, create AWS credentials for that user and finally use them as per the docs that you specified:

    Optional: If you aren't using an IAM role, update the awscreds.template file that you downloaded earlier. The content of this file should use the following format:

    AWSAccessKeyId=YourAccessKeyID

    AWSSecretKey=YourSecretAccessKey

    Also set the environment variable AWS_CREDENTIAL_FILE to point that awscreds.template in the environment of the user that is running the mon-scripts-perl

提交回复
热议问题