Skip to content

Commit 3a5fb55

Browse files
actions-userLinter Bot
authored andcommitted
Apply automatic changes
1 parent 35b37b1 commit 3a5fb55

File tree

6 files changed

+16
-22
lines changed

6 files changed

+16
-22
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ For any issues relating to this module, [raise an issue against this repo.](http
230230
| <a name="input_aws_account_id"></a> [aws\_account\_id](#input\_aws\_account\_id) | The AWS account ID into which resources will be launched. | `string` | n/a | yes |
231231
| <a name="input_cloudfront_aliases"></a> [cloudfront\_aliases](#input\_cloudfront\_aliases) | The domain and sub-domain aliases to use for the cloudfront distribution. | `list(any)` | `[]` | no |
232232
| <a name="input_cloudfront_class"></a> [cloudfront\_class](#input\_cloudfront\_class) | The [price class](https://aws.amazon.com/cloudfront/pricing/) for the distribution. One of: PriceClass\_All, PriceClass\_200, PriceClass\_100 | `string` | `"PriceClass_All"` | no |
233+
| <a name="input_cloudfront_function_301_redirects"></a> [cloudfront\_function\_301\_redirects](#input\_cloudfront\_function\_301\_redirects) | A list of key value pairs of Regex match and destination for 301 redirects at CloudFront. | `map` | <pre>{<br> "^(.*)index\\.php$": "$1"<br>}</pre> | no |
233234
| <a name="input_ecs_cpu"></a> [ecs\_cpu](#input\_ecs\_cpu) | The CPU limit password to the Wordpress container definition. | `number` | `256` | no |
234235
| <a name="input_ecs_memory"></a> [ecs\_memory](#input\_ecs\_memory) | The memory limit password to the Wordpress container definition. | `number` | `512` | no |
235236
| <a name="input_graviton_codebuild_enabled"></a> [graviton\_codebuild\_enabled](#input\_graviton\_codebuild\_enabled) | Flag that controls whether CodeBuild should use Graviton-based build agents in [supported regions](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html). | `bool` | `false` | no |

modules/cloudfront/README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This module sets up the CloudFront distribution that fronts the static wordpress
99
|------|-------------|------|---------|:--------:|
1010
| <a name="input_cloudfront_aliases"></a> [cloudfront\_aliases](#input\_cloudfront\_aliases) | The domain and sub-domain aliases to use for the cloudfront distribution. | `list(any)` | `[]` | no |
1111
| <a name="input_cloudfront_class"></a> [cloudfront\_class](#input\_cloudfront\_class) | The [price class](https://aws.amazon.com/cloudfront/pricing/) for the distribution. One of: PriceClass\_All, PriceClass\_200, PriceClass\_100 | `string` | `"PriceClass_All"` | no |
12+
| <a name="input_cloudfront_function_301_redirects"></a> [cloudfront\_function\_301\_redirects](#input\_cloudfront\_function\_301\_redirects) | A list of key value pairs of Regex match and destination for 301 redirects at CloudFront. | `map` | <pre>{<br> "^(.*)index\\.php$": "$1"<br>}</pre> | no |
1213
| <a name="input_cloudfront_ssl"></a> [cloudfront\_ssl](#input\_cloudfront\_ssl) | The ARN of the ACM certificate used for the CloudFront domain. | `string` | n/a | yes |
1314
| <a name="input_site_domain"></a> [site\_domain](#input\_site\_domain) | The site domain name to configure (without any subdomains such as 'www') | `string` | n/a | yes |
1415
| <a name="input_site_name"></a> [site\_name](#input\_site\_name) | The unique name for this instance of the module. Required to deploy multiple wordpress instances to the same AWS account (if desired). | `string` | n/a | yes |
@@ -33,19 +34,11 @@ No requirements.
3334
| Name | Type |
3435
|------|------|
3536
| [aws_cloudfront_distribution.wordpress_distribution](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_distribution) | resource |
37+
| [aws_cloudfront_function.object_rewrite](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_function) | resource |
3638
| [aws_cloudfront_origin_access_identity.wordpress_distribution](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_origin_access_identity) | resource |
37-
| [aws_cloudwatch_log_group.object_redirect](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
38-
| [aws_cloudwatch_log_group.object_redirect_ue1](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
39-
| [aws_cloudwatch_log_group.object_redirect_ue1_local](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
40-
| [aws_iam_role.lambda-edge](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
41-
| [aws_iam_role_policy.lambda-edge-cloudwatch-logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
42-
| [aws_iam_role_policy_attachment.basic](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
43-
| [aws_lambda_function.object_redirect](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource |
39+
| [aws_cloudwatch_log_group.object_rewrite](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
4440
| [aws_s3_bucket.wordpress_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
4541
| [aws_s3_bucket_policy.wordpress_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
4642
| [aws_s3_bucket_public_access_block.wordpress_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource |
4743
| [aws_s3_bucket_server_side_encryption_configuration.wordpress_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration) | resource |
48-
| [archive_file.index_html](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source |
49-
| [aws_iam_policy_document.lambda-edge-cloudwatch-logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
50-
| [aws_iam_policy_document.lambda-edge-service-role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
5144
<!-- END_TF_DOCS -->

modules/cloudfront/function_rewrite/index.js.tftpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function handler(event) {
22
var request = event.request;
3-
var uri = request.uri;
4-
3+
var uri = request.uri;
4+
55
try {
66
%{ for match, target in REDIRECTS }
77
if (/${match}/.test(uri)) {
@@ -12,7 +12,7 @@ function handler(event) {
1212
// Check whether the URI is missing a file name.
1313
if (uri.endsWith('/')) {
1414
request.uri += 'index.html';
15-
return request;
15+
return request;
1616
}
1717
}
1818
catch (e) {

modules/cloudfront/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ resource "aws_cloudwatch_log_group" "object_rewrite" {
44
retention_in_days = 7
55
# CloudFront Functions always creates log streams in us-east-1, no matter which edge location ran the function.
66
# The purpose of this resource is to set the retention days.
7-
provider = aws.ue1
7+
provider = aws.ue1
88
}
99

1010
resource "aws_cloudfront_function" "object_rewrite" {
1111
depends_on = [
1212
aws_cloudwatch_log_group.object_rewrite
1313
]
14-
14+
1515
name = "${var.site_name}_rewrite"
1616
runtime = "cloudfront-js-1.0"
1717
publish = true
18-
code = templatefile(
18+
code = templatefile(
1919
"${path.module}/function_rewrite/index.js.tftpl",
2020
{
2121
REDIRECTS = var.cloudfront_function_301_redirects

modules/cloudfront/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ variable "waf_acl_arn" {
3838
}
3939

4040
variable "cloudfront_function_301_redirects" {
41-
type = map
42-
default = {
43-
"^(.*)index\\.php$": "$1"
41+
type = map(any)
42+
default = {
43+
"^(.*)index\\.php$" : "$1"
4444
}
4545
description = "A list of key value pairs of Regex match and destination for 301 redirects at CloudFront."
4646
}

variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ variable "cloudfront_class" {
105105
}
106106

107107
variable "cloudfront_function_301_redirects" {
108-
type = map
109-
default = {
110-
"^(.*)index\\.php$": "$1"
108+
type = map(any)
109+
default = {
110+
"^(.*)index\\.php$" : "$1"
111111
}
112112
description = "A list of key value pairs of Regex match and destination for 301 redirects at CloudFront."
113113
}

0 commit comments

Comments
 (0)