Skip to content

Commit

Permalink
Add outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
niroz89 committed Mar 9, 2024
1 parent 7b08f5e commit 60b8d1e
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
5 changes: 4 additions & 1 deletion modules/cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@ No modules.

## Outputs

No outputs.
| Name | Description |
|------|-------------|
| <a name="output_etag"></a> [etag](#output\_etag) | The current version of the cache policy. |
| <a name="output_id"></a> [id](#output\_id) | The identifier for the cache policy. |
<!-- END_TF_DOCS -->
9 changes: 9 additions & 0 deletions modules/cache/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
output "id" {
description = "The identifier for the cache policy."
value = aws_cloudfront_cache_policy.this.id
}

output "etag" {
description = "The current version of the cache policy."
value = aws_cloudfront_cache_policy.this.etag
}
5 changes: 4 additions & 1 deletion modules/origin-request/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ No modules.

## Outputs

No outputs.
| Name | Description |
|------|-------------|
| <a name="output_etag"></a> [etag](#output\_etag) | The current version of the origin request policy. |
| <a name="output_id"></a> [id](#output\_id) | The identifier for the origin request policy. |
<!-- END_TF_DOCS -->
9 changes: 9 additions & 0 deletions modules/origin-request/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
output "id" {
description = "The identifier for the origin request policy."
value = aws_cloudfront_origin_request_policy.this.id
}

output "etag" {
description = "The current version of the origin request policy."
value = aws_cloudfront_origin_request_policy.this.etag
}
7 changes: 5 additions & 2 deletions modules/response-headers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_content_security_policy_header"></a> [content\_security\_policy\_header](#input\_content\_security\_policy\_header) | A configuration for `Content-Security-Policy` header in HTTP responses sent from CloudFront. The HTTP `Content-Security-Policy` response header allows web site administrators to control resources the user agent is allowed to load for a given page. With a few exceptions, policies mostly involve specifying server origins and script endpoints. This helps guard against cross-site scripting attacks. `content_security_policy_header` as defined below.<br> `enabled` - Whether to enable `Content-Security-Policy` response header. Defaults to `false`.<br> `override` - Whether CloudFront overrides the `Content-Security-Policy` response header with the header received from the origin. Defaults to `true`.<br> `value` - The value for the `Content-Security-Policy` HTTP response header. The `Content-Security-Policy` header value is limited to 1783 characters. | <pre>object({<br> enabled = optional(bool, false)<br> override = optional(bool, true)<br> value = optional(string, "")<br> })</pre> | `{}` | no |
| <a name="input_content_type_options_header"></a> [content\_type\_options\_header](#input\_content\_type\_options\_header) | A configuration for `X-Content-Type-Options` header in HTTP responses sent from CloudFront. The `X-Content-Type-Options` response HTTP header is a marker used by the server to indicate that the MIME types advertised in the `Content-Type` headers should be followed and not be changed. The header allows you to avoid MIME type sniffing by saying that the MIME types are deliberately configured. `content_type_options_header` as defined below.<br> `enabled` - Whether to enable `X-Content-Type-Options` response header. When this setting is `true`, CloudFront adds the `X-Content-Type-Options: nosniff` header to response. (Blocks a request if the request destination is of type style and the MIME type is not text/css, or of type script and the MIME type is not a JavaScript MIME type.) Defaults to `false`.<br> `override` - Whether CloudFront overrides the `X-Content-Type-Options` response header with the header received from the origin. Defaults to `true`. | <pre>object({<br> enabled = optional(bool, false)<br> override = optional(bool, true)<br> })</pre> | `{}` | no |
| <a name="input_cors"></a> [cors](#input\_cors) | A configuration for a set of HTTP response headers for CORS(Cross-Origin Resource Sharing). `cors` as defined below.<br> `enabled` - Whether to enable CORS configuration for the response headers policy .<br> `orgin_override` - Whether CloudFront override the response from the origin which contains one of the CORS headers specified in this policy. Defaults to `true`.<br> `access_control_allow_credentials` - Whether CloudFront adds the `Access-Control-Allow-Credentials` header in responses to CORS requests. When enabled, CloudFront adds the `Access-Control-Allow-Credentials: true` header in responses to CORS requests. Otherwise, CloudFront doesn't add this header to responses. Defaults to `false`.<br> `access_control_allow_headers` - A set of HTTP header names for CloudFront to include as values for the `Access-Control-Allow-Headers` HTTP response header in responses to CORS preflight requests. Defaults to `["*"]` (All headers).<br> `access_control_allow_methods` - A set of HTTP methods for CloudFront to include as values for the `Access-Control-Allow-Methods` header in responses to CORS preflight requests. Valid values are `GET`, `DELETE`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT`, or `ALL`). Defaults to `ALL` (All methods).<br> `access_control_allow_origins` - A set of the origins that CloudFront can use as values in the `Access-Control-Allow-Origin` response header. Use `*` value to allow CORS requests from all origins. Defaults to `["*"]` (All origins).<br> `access_control_expose_headers` - A set of HTTP header names for CloudFront to include as values for the `Access-Control-Expose-Headers` header in responses to CORS requests. Defaults to `[]` (None).<br> `access_control_max_age` - The number of seconds for CloudFront to use as the value for the `Access-Control-Max-Age` header in responses to CORS preflight requests. | <pre>object({<br> enabled = optional(bool, false)<br> override = optional(bool, true)<br><br> access_control_allow_credentials = optional(bool, false)<br> access_control_allow_headers = optional(set(string), ["*"])<br> access_control_allow_methods = optional(set(string), ["ALL"])<br> access_control_allow_origins = optional(set(string), ["*"])<br> access_control_expose_headers = optional(set(string), [])<br> access_control_max_age = optional(number, 600)<br> })</pre> | `{}` | no |
| <a name="input_cors"></a> [cors](#input\_cors) | A configuration for a set of HTTP response headers for CORS(Cross-Origin Resource Sharing). `cors` as defined below.<br> `enabled` - Whether to enable CORS configuration for the response headers policy .<br> `override` - Whether CloudFront override the response from the origin which contains one of the CORS headers specified in this policy. Defaults to `true`.<br> `access_control_allow_credentials` - Whether CloudFront adds the `Access-Control-Allow-Credentials` header in responses to CORS requests. When enabled, CloudFront adds the `Access-Control-Allow-Credentials: true` header in responses to CORS requests. Otherwise, CloudFront doesn't add this header to responses. Defaults to `false`.<br> `access_control_allow_headers` - A set of HTTP header names for CloudFront to include as values for the `Access-Control-Allow-Headers` HTTP response header in responses to CORS preflight requests. Defaults to `["*"]` (All headers).<br> `access_control_allow_methods` - A set of HTTP methods for CloudFront to include as values for the `Access-Control-Allow-Methods` header in responses to CORS preflight requests. Valid values are `GET`, `DELETE`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PUT`, or `ALL`). Defaults to `ALL` (All methods).<br> `access_control_allow_origins` - A set of the origins that CloudFront can use as values in the `Access-Control-Allow-Origin` response header. Use `*` value to allow CORS requests from all origins. Defaults to `["*"]` (All origins).<br> `access_control_expose_headers` - A set of HTTP header names for CloudFront to include as values for the `Access-Control-Expose-Headers` header in responses to CORS requests. Defaults to `[]` (None).<br> `access_control_max_age` - The number of seconds for CloudFront to use as the value for the `Access-Control-Max-Age` header in responses to CORS preflight requests. | <pre>object({<br> enabled = optional(bool, false)<br> override = optional(bool, true)<br><br> access_control_allow_credentials = optional(bool, false)<br> access_control_allow_headers = optional(set(string), ["*"])<br> access_control_allow_methods = optional(set(string), ["ALL"])<br> access_control_allow_origins = optional(set(string), ["*"])<br> access_control_expose_headers = optional(set(string), [])<br> access_control_max_age = optional(number, 600)<br> })</pre> | `{}` | no |
| <a name="input_custom_headers"></a> [custom\_headers](#input\_custom\_headers) | A configuration for specifying the custom HTTP headers in HTTP responses sent from CloudFront. Each item of `custom_headers` as defined below.<br> `name` - The HTTP response header name.<br> `value` - The value for the HTTP response header. If a header value is not provided, CloudFront adds the empty header (with no value) to the response.<br> `override` - Whether CloudFront overrides a response header with the same name received from the origin with the header specifies here. | <pre>list(object({<br> name = string<br> value = string<br> override = optional(bool, false)<br> }))</pre> | `[]` | no |
| <a name="input_description"></a> [description](#input\_description) | A comment to describe the response headers policy. | `string` | `"Managed by Terraform."` | no |
| <a name="input_frame_options_header"></a> [frame\_options\_header](#input\_frame\_options\_header) | A configuration for `X-Frame-Options` header in HTTP responses sent from CloudFront. The `X-Frame-Options` HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a `<frame>`, `<iframe>`, `<embed>` or `<object>`. Sites can use this to avoid click-jacking attacks, by ensuring that their content is not embedded into other sites. `frame_options_header` as defined below.<br> `enabled` - Whether to enable `X-Frame-Options` response header. Defaults to `false`.<br> `override` - Whether CloudFront overrides the `X-Frame-Options` response header with the header received from the origin. Defaults to `true`.<br> `value` - The value for the `X-Frame-Options` HTTP response header. Valid values are `DENY` or `SAMEORIGIN`.<br> - `DENY`: The page cannot be displayed in a frame, regardless of the site attempting to do<br> so.<br> - `SAMEORIGIN`: The page can only be displayed if all ancestor frames are same origin to the page itself. | <pre>object({<br> enabled = optional(bool, false)<br> override = optional(bool, true)<br> value = optional(string, "")<br> })</pre> | `{}` | no |
Expand All @@ -41,5 +41,8 @@ No modules.

## Outputs

No outputs.
| Name | Description |
|------|-------------|
| <a name="output_etag"></a> [etag](#output\_etag) | The current version of the response headers policy. |
| <a name="output_id"></a> [id](#output\_id) | The identifier for the response headers policy. |
<!-- END_TF_DOCS -->
9 changes: 9 additions & 0 deletions modules/response-headers/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
output "id" {
description = "The identifier for the response headers policy."
value = aws_cloudfront_response_headers_policy.this.id
}

output "etag" {
description = "The current version of the response headers policy."
value = aws_cloudfront_response_headers_policy.this.etag
}

0 comments on commit 60b8d1e

Please sign in to comment.