Skip to content

Commit 7ef3167

Browse files
Merge commit '972a5568d474fd3c8531490872251ad5909c028d' into release
2 parents c54bd1f + 972a556 commit 7ef3167

File tree

17 files changed

+69
-34
lines changed

17 files changed

+69
-34
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## [Unreleased]
44

5+
## [0.12.0] - 2022-04-07
6+
7+
- Ensure compatibility with AWS Provider Version 4 ([#286](https://github.com/milliHQ/terraform-aws-next-js/issues/286), [#291](https://github.com/milliHQ/terraform-aws-next-js/pull/291))
8+
- Add switch for attaching additional policy documents ([#276](https://github.com/milliHQ/terraform-aws-next-js/pull/276))
9+
510
## [0.11.5] - 2022-04-02
611

712
- Adds support for route-manifest v4 ([#292](https://github.com/milliHQ/terraform-aws-next-js/pull/292))

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ terraform {
113113
required_providers {
114114
aws = {
115115
source = "hashicorp/aws"
116-
version = "~> 3.0"
116+
version = "~> 4.0"
117117
}
118118
}
119119
}
@@ -199,13 +199,13 @@ You can create a `.terraformignore` in the root of your project and add the foll
199199
| Name | Version |
200200
|------|---------|
201201
| terraform | >= 0.15 |
202-
| aws | >= 3.64.0 |
202+
| aws | >= 4.8 |
203203

204204
## Providers
205205

206206
| Name | Version |
207207
|------|---------|
208-
| aws | >= 3.64.0 |
208+
| aws | >= 4.8 |
209209

210210
## Inputs
211211

@@ -227,6 +227,7 @@ You can create a `.terraformignore` in the root of your project and add the foll
227227
| deployment\_name | Identifier for the deployment group (only lowercase alphanumeric characters and hyphens are allowed). | `string` | `"tf-next"` | no |
228228
| expire\_static\_assets | Number of days after which static assets from previous deployments should be removed from S3. Set to -1 to disable expiration. | `number` | `30` | no |
229229
| image\_optimization\_lambda\_memory\_size | Amount of memory in MB the worker Lambda Function for image optimization can use. Valid value between 128 MB to 10,240 MB, in 1 MB increments. | `number` | `2048` | no |
230+
| lambda\_attach\_policy\_json | Whether to deploy additional lambda JSON policies. If false, lambda\_policy\_json will not be attached to the lambda function. (Necessary since policy strings are only known after apply when using Terraforms data.aws\_iam\_policy\_document) | `bool` | `false` | no |
230231
| lambda\_attach\_to\_vpc | Set to true if the Lambda functions should be attached to a VPC. Use this setting if VPC resources should be accessed by the Lambda functions. When setting this to true, use vpc\_security\_group\_ids and vpc\_subnet\_ids to specify the VPC networking. Note that attaching to a VPC would introduce a delay on to cold starts | `bool` | `false` | no |
231232
| lambda\_environment\_variables | Map that defines environment variables for the Lambda Functions in Next.js. | `map(string)` | `{}` | no |
232233
| lambda\_memory\_size | Amount of memory in MB a Lambda Function can use at runtime. Valid value between 128 MB to 10,240 MB, in 1 MB increments. | `number` | `1024` | no |

examples/complete/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = "~> 3.0"
5+
version = "~> 4.0"
66
}
77
}
88
}

examples/next-image/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = "~> 3.0"
5+
version = "~> 4.0"
66
}
77
}
88
}

examples/static/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = "~> 3.0"
5+
version = "~> 4.0"
66
}
77
}
88
}

examples/with-custom-domain/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = "~> 3.0"
5+
version = "~> 4.0"
66
}
77
}
88
}

examples/with-existing-cloudfront/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = "~> 3.0"
5+
version = "~> 4.0"
66
}
77
}
88
}

iam.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ resource "aws_iam_role_policy_attachment" "lambda_vpc" {
8383
####################################
8484

8585
resource "aws_iam_policy" "additional_json" {
86-
count = var.lambda_policy_json != null ? 1 : 0
86+
count = var.lambda_attach_policy_json ? 1 : 0
8787

8888
description = "Managed by Terraform Next.js"
8989
policy = var.lambda_policy_json
@@ -92,7 +92,7 @@ resource "aws_iam_policy" "additional_json" {
9292
}
9393

9494
resource "aws_iam_role_policy_attachment" "additional_json" {
95-
for_each = var.lambda_policy_json != null ? local.lambdas : {}
95+
for_each = var.lambda_attach_policy_json ? local.lambdas : {}
9696

9797
role = aws_iam_role.lambda[each.key].name
9898
policy_arn = aws_iam_policy.additional_json[0].arn

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ module "next_image" {
148148
count = var.create_image_optimization ? 1 : 0
149149

150150
source = "milliHQ/next-js-image-optimization/aws"
151-
version = "~> 12.0.10"
151+
version = ">= 12.1.0"
152152

153153
cloudfront_create_distribution = false
154154

modules/cloudfront-proxy-config/main.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ locals {
1010

1111
resource "aws_s3_bucket" "proxy_config_store" {
1212
bucket_prefix = "${var.deployment_name}-tfn-config"
13-
acl = "private"
1413
force_destroy = true
1514
tags = merge(var.tags, var.tags_s3_bucket)
1615
}
1716

17+
resource "aws_s3_bucket_acl" "proxy_config_store" {
18+
bucket = aws_s3_bucket.proxy_config_store.id
19+
acl = "private"
20+
}
21+
1822
data "aws_iam_policy_document" "cf_access" {
1923
statement {
2024
actions = ["s3:GetObject"]
@@ -36,7 +40,7 @@ resource "aws_s3_bucket_policy" "proxy_config_store_origin_access" {
3640
# Upload Proxy Config
3741
#####################
3842

39-
resource "aws_s3_bucket_object" "config_json" {
43+
resource "aws_s3_object" "config_json" {
4044
bucket = aws_s3_bucket.proxy_config_store.id
4145
key = local.proxy_config_key
4246
content = var.proxy_config_json

0 commit comments

Comments
 (0)