AWS Distro for OpenTelemetry
Create IAM Policy
Create IAM Policy
The AWS Distro for OpenTelemetry Collector requires permissions to publish app metrics and container metrics to AWS CloudWatch and sending app traces to AWS X-Ray. Metrics are sent to CloudWatch using EMF Logs, so CloudWatch Logs permissions are required to send metrics. In this section, we will create an IAM policy with proper permission.
- Go to AWS Management Console
Go to AWS Management Console and open the IAM Policy page.
- Create Policy
Click the Create Policy
button on top-left corner.
- Copy JSON Policy
Click the JSON
tab on top of the page. Copy and paste the following policy text.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:PutLogEvents", "logs:CreateLogGroup", "logs:CreateLogStream", "logs:DescribeLogStreams", "logs:DescribeLogGroups", "logs:PutRetentionPolicy", "xray:PutTraceSegments", "xray:PutTelemetryRecords", "xray:GetSamplingRules", "xray:GetSamplingTargets", "xray:GetSamplingStatisticSummaries", "cloudwatch:PutMetricData", "ec2:DescribeVolumes", "ec2:DescribeTags", "ssm:GetParameters" ], "Resource": "*" } ]}
- Click the Review Policy
- Add Policy Name and Finish
On the Review policy page, type AWSDistroOpenTelemetryPolicy for the Name, and then click Create policy button and finish the process.