-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathiam.tf
30 lines (27 loc) · 956 Bytes
/
iam.tf
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
# https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html
resource "aws_iam_role" "this" {
name_prefix = var.name
assume_role_policy = data.aws_iam_policy_document.assume_role.json
tags = var.tags
}
data "aws_iam_policy_document" "assume_role" {
statement {
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["streams.metrics.cloudwatch.amazonaws.com"]
}
}
}
# https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html
resource "aws_iam_role_policy" "this" {
name_prefix = var.name
role = aws_iam_role.this.id
policy = data.aws_iam_policy_document.this.json
}
data "aws_iam_policy_document" "this" {
statement {
actions = ["firehose:PutRecord", "firehose:PutRecordBatch"]
resources = [module.kfh.kinesis_firehose_delivery_stream_arn]
}
}