Skip to content

Instantly share code, notes, and snippets.

@lancehunt
Created March 1, 2017 01:51
Show Gist options
  • Save lancehunt/ca06593d276849883db41cda2e915bf2 to your computer and use it in GitHub Desktop.
Save lancehunt/ca06593d276849883db41cda2e915bf2 to your computer and use it in GitHub Desktop.
AWS CLI to setup role and policies for DataDog Integration
#!/bin/bash
#aws iam create-policy --policy-name DatadogIntegrationPolicy --policy-document file://datadogPolicy.json
aws iam create-role --role-name DatadogIntegrationRole --assume-role-policy-document file://datadogRoleTrustPolicy.json
aws iam attach-role-policy --role-name DatadogIntegrationRole --policy-arn arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess
aws iam attach-role-policy --role-name DatadogIntegrationRole --policy-arn arn:aws:iam::aws:policy/CloudWatchReadOnlyAccess
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:Describe*",
"budgets:ViewBudget",
"cloudtrail:DescribeTrails",
"cloudtrail:GetTrailStatus",
"cloudwatch:Describe*",
"cloudwatch:Get*",
"cloudwatch:List*",
"dynamodb:list*",
"dynamodb:describe*",
"ec2:Describe*",
"ec2:Get*",
"ecs:Describe*",
"ecs:List*",
"elasticache:Describe*",
"elasticache:List*",
"elasticloadbalancing:Describe*",
"elasticmapreduce:List*",
"elasticmapreduce:Describe*",
"es:ListTags",
"es:ListDomainNames",
"es:DescribeElasticsearchDomains",
"kinesis:List*",
"kinesis:Describe*",
"logs:Get*",
"logs:Describe*",
"logs:FilterLogEvents",
"logs:TestMetricFilter",
"rds:Describe*",
"rds:List*",
"route53:List*",
"s3:GetBucketTagging",
"s3:ListAllMyBuckets",
"ses:Get*",
"sns:List*",
"sns:Publish",
"sqs:ListQueues",
"support:*"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::464622532012:root" },
"Action": "sts:AssumeRole",
"Condition": { "Bool": { "aws:MultiFactorAuthPresent": "false" } }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment