The resource schema for AWSLogs ResourcePolicy
To create Amazon CloudWatch log resource policy
data "aws_iam_policy_document" "elasticsearch-log-publishing-policy" {
statement {
actions = [
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
]
resources = ["arn:aws:logs:*"]
principals {
identifiers = ["es.amazonaws.com"]
type = "Service"
}
}
}
resource "awscc_logs_resource_policy" "this" {
policy_document = data.aws_iam_policy_document.elasticsearch-log-publishing-policy.json
policy_name = "elasticsearch-log-publishing-policy"
}
policy_document
(String) The policy documentpolicy_name
(String) A name for resource policyid
(String) Uniquely identifies the resource.Import is supported using the following syntax:
$ terraform import awscc_logs_resource_policy.example <resource ID>