-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDatadogAWSIntegrationRole.template.yaml
159 lines (159 loc) · 4.5 KB
/
DatadogAWSIntegrationRole.template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'IAM Role and IAM Policy for Datadog AWS Integration'
Outputs:
DatadogAccountID:
Value:
Ref: DatadogAccountID
#DatadogExternalID:
# Value:
# Ref: DatadogExternalID
PolicyArn:
Value:
Ref: DatadogAWSIntegrationPolicy
RoleName:
Value:
Ref: DatadogAWSIntegrationRole
Parameters:
DatadogAccountID:
Default: '464622532012'
Description: "Datadog's account ID (Ref: https://docs.datadoghq.com/integrations/amazon_web_services/)"
Type: String
DatadogExternalID:
Default: YourExternalID
Description: External ID generate by Datadog (https://app.datadoghq.com/account/settings#integrations/amazon_web_services)
Type: String
NoEcho: 'true'
PermissionLevel:
Default: full
AllowedValues:
- full
- minimum
Description: Select permission to grant to IAM Role
Type: String
PermissionsFull:
# Delete double quotes(") after copy & paste from doc (#installation)
Default: >-
apigateway:GET,
autoscaling:Describe*,
budgets:ViewBudget,
cloudfront:GetDistributionConfig,
cloudfront:ListDistributions,
cloudtrail:DescribeTrails,
cloudtrail:GetTrailStatus,
cloudtrail:LookupEvents,
cloudwatch:Describe*,
cloudwatch:Get*,
cloudwatch:List*,
codedeploy:List*,
codedeploy:BatchGet*,
directconnect:Describe*,
dynamodb:List*,
dynamodb:Describe*,
ec2:Describe*,
ecs:Describe*,
ecs:List*,
elasticache:Describe*,
elasticache:List*,
elasticfilesystem:DescribeFileSystems,
elasticfilesystem:DescribeTags,
elasticfilesystem:DescribeAccessPoints,
elasticloadbalancing:Describe*,
elasticmapreduce:List*,
elasticmapreduce:Describe*,
es:ListTags,
es:ListDomainNames,
es:DescribeElasticsearchDomains,
fsx:DescribeFileSystems,
fsx:ListTagsForResource,
health:DescribeEvents,
health:DescribeEventDetails,
health:DescribeAffectedEntities,
kinesis:List*,
kinesis:Describe*,
lambda:GetPolicy,
lambda:List*,
logs:DeleteSubscriptionFilter,
logs:DescribeLogGroups,
logs:DescribeLogStreams,
logs:DescribeSubscriptionFilters,
logs:FilterLogEvents,
logs:PutSubscriptionFilter,
logs:TestMetricFilter,
organizations:DescribeOrganization,
rds:Describe*,
rds:List*,
redshift:DescribeClusters,
redshift:DescribeLoggingStatus,
route53:List*,
s3:GetBucketLogging,
s3:GetBucketLocation,
s3:GetBucketNotification,
s3:GetBucketTagging,
s3:ListAllMyBuckets,
s3:PutBucketNotification,
ses:Get*,
sns:List*,
sns:Publish,
sqs:ListQueues,
states:ListStateMachines,
states:DescribeStateMachine,
support:*,
tag:GetResources,
tag:GetTagKeys,
tag:GetTagValues,
xray:BatchGetTraces,
xray:GetTraceSummaries
Type: CommaDelimitedList
PermissionsMinimum:
# Delete double quotes(") after copy & paste from doc (#permissions)
Default: >-
cloudwatch:Get*,
cloudwatch:List*,
ec2:Describe*,
support:*,
tag:GetResources,
tag:GetTagKeys,
tag:GetTagValues
Type: CommaDelimitedList
Conditions:
Permissions:
Fn::Equals:
- Ref: PermissionLevel
- full
Resources:
DatadogAWSIntegrationPolicy:
Properties:
PolicyDocument:
Statement:
- Action:
Fn::If:
- Permissions
- Ref: PermissionsFull
- Ref: PermissionsMinimum
Effect: Allow
Resource: "*"
Version: '2012-10-17'
Roles:
- Ref: DatadogAWSIntegrationRole
# When you want to give a specific name
#ManagedPolicyName: "DatadogAWSIntegrationRolePolicy"
Type: AWS::IAM::ManagedPolicy
DatadogAWSIntegrationRole:
Properties:
AssumeRolePolicyDocument:
Statement:
- Action:
- sts:AssumeRole
Condition:
StringEquals:
sts:ExternalId:
Ref: DatadogExternalID
Effect: Allow
Principal:
AWS:
Fn::Sub: arn:aws:iam::${DatadogAccountID}:root
Version: '2012-10-17'
# When you want to give a specific name
#RoleName: 'DatadogAWSIntegrationRole'
Type: AWS::IAM::Role