You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for CloudFront Standard Logging using CloudWatch Log Delivery resources.
This replaces the legacy logging_config and allows logging to S3, CloudWatch Logs,
or Firehose as destinations.
Standard logging is automatically enabled when std_logging_destination or
std_logging_destination_arn is provided (no separate enable flag needed).
New variables:
- std_logging_region: region for logging resources (default: us-east-1)
- std_logging_source_name: optional custom name for delivery source
- std_logging_destination_arn: use existing destination (skip creation)
- std_logging_destination: destination configuration (name, output_format, destination_arn)
- std_logging_delivery: delivery configuration (field_delimiter, record_fields, s3_delivery_configuration)
New outputs:
- cloudfront_std_logging_source_arn
- cloudfront_std_logging_source_name
- cloudfront_std_logging_destination_arn
- cloudfront_std_logging_delivery_id
- cloudfront_std_logging_delivery_arn
|[aws_cloudfront_cache_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/cloudfront_cache_policy)| data source |
182
185
|[aws_cloudfront_origin_request_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/cloudfront_origin_request_policy)| data source |
183
186
|[aws_cloudfront_response_headers_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/cloudfront_response_headers_policy)| data source |
@@ -210,6 +213,11 @@ No modules.
210
213
| <aname="input_restrictions"></a> [restrictions](#input\_restrictions)| The restrictions configuration for this distribution | <pre>object({<br/> geo_restriction = object({<br/> locations = optional(list(string))<br/> restriction_type = optional(string, "none")<br/> })<br/> })</pre> | <pre>{<br/> "geo_restriction": {<br/> "restriction_type": "none"<br/> }<br/>}</pre> | no |
211
214
| <aname="input_retain_on_delete"></a> [retain\_on\_delete](#input\_retain\_on\_delete)| Disables the distribution instead of deleting it when destroying the resource through Terraform. If this is set, the distribution needs to be deleted manually afterwards |`bool`|`null`| no |
212
215
| <aname="input_staging"></a> [staging](#input\_staging)| Whether the distribution is a staging distribution |`bool`|`null`| no |
216
+
| <aname="input_std_logging_delivery"></a> [std\_logging\_delivery](#input\_std\_logging\_delivery)| Configuration for the standard logging delivery | <pre>object({<br/> field_delimiter = optional(string)<br/> record_fields = optional(list(string))<br/> s3_delivery_configuration = optional(object({<br/> enable_hive_compatible_path = optional(bool)<br/> suffix_path = optional(string)<br/> }))<br/> tags = optional(map(string), {})<br/> })</pre> |`null`| no |
217
+
| <aname="input_std_logging_destination"></a> [std\_logging\_destination](#input\_std\_logging\_destination)| Configuration for creating a new standard logging destination. Ignored if std\_logging\_destination\_arn is set | <pre>object({<br/> name = string<br/> output_format = optional(string, "json")<br/> destination_arn = string<br/> tags = optional(map(string), {})<br/> })</pre> |`null`| no |
218
+
| <aname="input_std_logging_destination_arn"></a> [std\_logging\_destination\_arn](#input\_std\_logging\_destination\_arn)| ARN of an existing CloudWatch Log Delivery Destination to use. If set, std\_logging\_destination is ignored |`string`|`null`| no |
219
+
| <aname="input_std_logging_region"></a> [std\_logging\_region](#input\_std\_logging\_region)| Region for standard logging resources. Required for CloudFront (must be us-east-1 for the source) |`string`|`"us-east-1"`| no |
220
+
| <aname="input_std_logging_source_name"></a> [std\_logging\_source\_name](#input\_std\_logging\_source\_name)| Name for the CloudWatch Log Delivery Source. Defaults to 'cloudfront-<distribution\_id>' |`string`|`null`| no |
213
221
| <aname="input_tags"></a> [tags](#input\_tags)| A map of tags to add to all resources |`map(string)`|`{}`| no |
214
222
| <aname="input_viewer_certificate"></a> [viewer\_certificate](#input\_viewer\_certificate)| The SSL configuration for this distribution | <pre>object({<br/> acm_certificate_arn = optional(string)<br/> cloudfront_default_certificate = optional(bool)<br/> iam_certificate_id = optional(string)<br/> minimum_protocol_version = optional(string, "TLSv1.2_2025")<br/> ssl_support_method = optional(string)<br/> })</pre> |`{}`| no |
| <aname="output_cloudfront_monitoring_subscription_id"></a> [cloudfront\_monitoring\_subscription\_id](#output\_cloudfront\_monitoring\_subscription\_id)| The ID of the CloudFront monitoring subscription, which corresponds to the `distribution_id`. |
235
243
| <aname="output_cloudfront_origin_access_controls"></a> [cloudfront\_origin\_access\_controls](#output\_cloudfront\_origin\_access\_controls)| The origin access controls created |
236
244
| <aname="output_cloudfront_response_headers_policies"></a> [cloudfront\_response\_headers\_policies](#output\_cloudfront\_response\_headers\_policies)| The response headers policies created |
245
+
| <aname="output_cloudfront_std_logging_delivery_arn"></a> [cloudfront\_std\_logging\_delivery\_arn](#output\_cloudfront\_std\_logging\_delivery\_arn)| The ARN of the CloudWatch Log Delivery for standard logging |
246
+
| <aname="output_cloudfront_std_logging_delivery_id"></a> [cloudfront\_std\_logging\_delivery\_id](#output\_cloudfront\_std\_logging\_delivery\_id)| The ID of the CloudWatch Log Delivery for standard logging |
247
+
| <aname="output_cloudfront_std_logging_destination_arn"></a> [cloudfront\_std\_logging\_destination\_arn](#output\_cloudfront\_std\_logging\_destination\_arn)| The ARN of the CloudWatch Log Delivery Destination for standard logging |
248
+
| <aname="output_cloudfront_std_logging_source_arn"></a> [cloudfront\_std\_logging\_source\_arn](#output\_cloudfront\_std\_logging\_source\_arn)| The ARN of the CloudWatch Log Delivery Source for standard logging |
249
+
| <aname="output_cloudfront_std_logging_source_name"></a> [cloudfront\_std\_logging\_source\_name](#output\_cloudfront\_std\_logging\_source\_name)| The name of the CloudWatch Log Delivery Source for standard logging |
237
250
| <aname="output_cloudfront_vpc_origins"></a> [cloudfront\_vpc\_origins](#output\_cloudfront\_vpc\_origins)| The IDS of the VPC origin created |
|[aws_availability_zones.available](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones)| data source |
53
-
|[aws_canonical_user_id.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/canonical_user_id)| data source |
54
-
|[aws_cloudfront_log_delivery_canonical_user_id.cloudfront](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/cloudfront_log_delivery_canonical_user_id)| data source |
53
+
|[aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity)| data source |
54
+
|[aws_iam_policy_document.log_bucket_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
55
55
|[aws_iam_policy_document.s3_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
56
56
|[aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone)| data source |
0 commit comments