Skip to content

Commit 037c175

Browse files
authored
Support delivery.logs.amazonaws.com service for cloudwatch-log-policy module (#3)
1 parent c166585 commit 037c175

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

modules/cloudwatch-log-policy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ No modules.
3636
| Name | Description | Type | Default | Required |
3737
|------|-------------|------|---------|:--------:|
3838
| <a name="input_name"></a> [name](#input\_name) | (Required) The name of the CloudWatch Logs resource policy. | `string` | n/a | yes |
39-
| <a name="input_service"></a> [service](#input\_service) | (Required) Specify the identity of the AWS service principal to allow delivering logs to this account. Valid values are `es.amazonaws.com`, `route53.amazonaws.com`. | `string` | n/a | yes |
39+
| <a name="input_service"></a> [service](#input\_service) | (Required) Specify the identity of the AWS service principal to allow delivering logs to this account. Valid values are `delivery.logs.amazonaws.com`, `es.amazonaws.com`, `route53.amazonaws.com`. | `string` | n/a | yes |
4040
| <a name="input_statements"></a> [statements](#input\_statements) | (Required) A list of statements for CloudWatch Logs resource policy. Each item of `statements` as defined below.<br> (Required) `log_groups` - A list of Log group patterns that the resource policy applies to. Whildcard is supported. Configure `*` to allow all log groups.<br> (Optional) `account_whiteilst` - A whitelist of AWS Account IDs making the call to CloudWatch Logs.<br> (Optional) `resource_whiteilst` - A whitelist of the ARN of AWS resources making the call to CloudWatch Logs. | `list(map(set(string)))` | `[]` | no |
4141

4242
## Outputs

modules/cloudwatch-log-policy/policies.tf renamed to modules/cloudwatch-log-policy/policy.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ locals {
66
region = data.aws_region.this.name
77

88
service_actions = {
9+
"delivery.logs.amazonaws.com" = [
10+
"logs:CreateLogStream",
11+
"logs:PutLogEvents",
12+
]
913
"es.amazonaws.com" = [
1014
"logs:CreateLogStream",
1115
"logs:PutLogEvents",

modules/cloudwatch-log-policy/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ variable "name" {
44
}
55

66
variable "service" {
7-
description = "(Required) Specify the identity of the AWS service principal to allow delivering logs to this account. Valid values are `es.amazonaws.com`, `route53.amazonaws.com`."
7+
description = "(Required) Specify the identity of the AWS service principal to allow delivering logs to this account. Valid values are `delivery.logs.amazonaws.com`, `es.amazonaws.com`, `route53.amazonaws.com`."
88
type = string
99
nullable = false
1010

1111
validation {
12-
condition = contains(["es.amazonaws.com", "route53.amazonaws.com"], var.service)
13-
error_message = "Valid values for `service` are `es.amazonaws.com`, `route53.amazonaws.com`."
12+
condition = contains(["delivery.logs.amazonaws.com", "es.amazonaws.com", "route53.amazonaws.com"], var.service)
13+
error_message = "Valid values for `service` are `delivery.logs.amazonaws.com`, `es.amazonaws.com`, `route53.amazonaws.com`."
1414
}
1515
}
1616

0 commit comments

Comments
 (0)