Reputation:
After installing the CloudWatchLogs Agent the command
/var/awslogs/bin/aws logs push --config-file /var/awslogs/etc/awslogs.conf --additional-configs-dir /var/awslogs/etc/config
is running on the machine.
To use separate credentials for the CloudWatchLogs Agent a profile was created in /root/.aws
.
Trying to use the profile with
/var/awslogs/bin/aws logs push --config-file /var/awslogs/etc/awslogs.conf --additional-configs-dir /var/awslogs/etc/config --profile awslogs
throws an error
aws: error: argument operation: Invalid choice, valid choices are ...
Upvotes: 1
Views: 786
Reputation: 53553
You would use it in the beginning:
/var/awslogs/bin/aws --profile awslogs logs push ...
Upvotes: 0
Reputation: 1
export AWS_PROFILE=user1
can be used for Linux and you can omit --profile
in aws cli command.
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html
Upvotes: 0