Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Using the AWS Console
    To attach the IAM Role, go to the EC2 Dashboard, select Instance from the menu and check the checkbox of the EC2 Instance. Click on the Actions dropdown and choose Security>Modify IAM Role>Choose IAM Role and update IAM Role.
    To attach this role, search for it, select the created IAM role, and then click Apply to attach it.

  • Using the AWS CLI
    For AWS CLI Version 1.11.46, use the below command to attach the IAM Role:

Code Block
$ aws ec2 associate-iam-instance-profile --instance-id YourInstanceId --iam-instance-profile Name=CloudWatchAgentServerRole

...

In the above config file, "file_path" is the path to the log file from which the user wants to collect data from e.g., controller.log, agent.log. For the naming of Log Group and Log Streams, log_group_name and log_stream_name can be used respectively in the CloudWatch.

...