Skip to content

Commit

Permalink
Merge commit '517ee7bdc88da7988aaab8687f3165dffa8174dd' into release-…
Browse files Browse the repository at this point in the history
…v0.10.x
  • Loading branch information
github-actions[bot] committed Oct 23, 2021
2 parents 8ec59b9 + 517ee7b commit be7851d
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.10.1 (October 23, 2021)

This release ensures that static generated routes with dynamic parts (e.g. `/test/[...slug]`) are invalidated correctly when running terraform apply.
We also added a new option to define tags exclusively on S3 buckets created by this module.

- Ensure correct invalidation for slug paths ([#140](https://github.com/milliHQ/terraform-aws-next-js/issues/140), [#229](https://github.com/milliHQ/terraform-aws-next-js/pull/229), [#228](https://github.com/milliHQ/terraform-aws-next-js/issues/228))
- Adds new input variable `tags_s3_bucket` ([#216](https://github.com/milliHQ/terraform-aws-next-js/issues/216), [#230](https://github.com/milliHQ/terraform-aws-next-js/pull/230))

## 0.10.0 (October 16, 2021)

Beginning with this release we streamline the versioning of the Terraform module with its npm-packages.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ You can create a `.terraformignore` in the root of your project and add the foll
| lambda\_timeout | Max amount of time a Lambda Function has to return a response in seconds. Should not be more than 30 (Limited by API Gateway). | `number` | `10` | no |
| next\_tf\_dir | Relative path to the .next-tf dir. | `string` | `"./.next-tf"` | no |
| tags | Tag metadata to label AWS resources that support tags. | `map(string)` | `{}` | no |
| tags\_s3\_bucket | Tag metadata to label AWS S3 buckets. Overrides tags with the same name in input variable tags. | `map(string)` | `{}` | no |
| use\_awscli\_for\_static\_upload | Use AWS CLI when uploading static resources to S3 instead of default Bash script. Some cases may fail with 403 Forbidden when using the Bash script. | `bool` | `false` | no |
| vpc\_security\_group\_ids | The list of Security Group IDs to be used by the Lambda functions. lambda\_attach\_to\_vpc should be set to true for these to be applied. | `list(string)` | `[]` | no |
| vpc\_subnet\_ids | The list of VPC subnet IDs to attach the Lambda functions. lambda\_attach\_to\_vpc should be set to true for these to be applied. | `list(string)` | `[]` | no |
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module "statics_deploy" {

deployment_name = var.deployment_name
tags = var.tags
tags_s3_bucket = var.tags_s3_bucket

debug_use_local_packages = var.debug_use_local_packages
tf_next_module_root = path.module
Expand Down Expand Up @@ -185,6 +186,7 @@ module "proxy_config" {

deployment_name = var.deployment_name
tags = var.tags
tags_s3_bucket = var.tags_s3_bucket
}

#####################
Expand Down
2 changes: 1 addition & 1 deletion modules/cloudfront-proxy-config/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resource "aws_s3_bucket" "proxy_config_store" {
bucket_prefix = "${var.deployment_name}-tfn-config"
acl = "private"
force_destroy = true
tags = var.tags
tags = merge(var.tags, var.tags_s3_bucket)
}

data "aws_iam_policy_document" "cf_access" {
Expand Down
5 changes: 5 additions & 0 deletions modules/cloudfront-proxy-config/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ variable "tags" {
type = map(string)
default = {}
}

variable "tags_s3_bucket" {
type = map(string)
default = {}
}
2 changes: 1 addition & 1 deletion modules/proxy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

variable "proxy_module_version" {
type = string
default = "0.10.0"
default = "0.10.1"
}

variable "lambda_default_runtime" {
Expand Down
6 changes: 4 additions & 2 deletions modules/statics-deploy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ resource "aws_s3_bucket" "static_upload" {
bucket_prefix = "${var.deployment_name}-tfn-deploy"
acl = "private"
force_destroy = true
tags = var.tags

# We are using versioning here to ensure that no file gets overridden at upload
versioning {
enabled = true
}

tags = merge(var.tags, var.tags_s3_bucket)
}

resource "aws_s3_bucket_notification" "on_create" {
Expand All @@ -36,7 +37,6 @@ resource "aws_s3_bucket" "static_deploy" {
bucket_prefix = "${var.deployment_name}-tfn-static"
acl = "private"
force_destroy = true
tags = var.tags

lifecycle_rule {
id = "Expire static assets"
Expand All @@ -50,6 +50,8 @@ resource "aws_s3_bucket" "static_deploy" {
days = var.expire_static_assets > 0 ? var.expire_static_assets : 0
}
}

tags = merge(var.tags, var.tags_s3_bucket)
}

# CloudFront permissions for the bucket
Expand Down
7 changes: 6 additions & 1 deletion modules/statics-deploy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ variable "static_files_archive" {

variable "deploy_trigger_module_version" {
type = string
default = "0.10.0"
default = "0.10.1"
}

variable "expire_static_assets" {
Expand Down Expand Up @@ -56,6 +56,11 @@ variable "tags" {
default = {}
}

variable "tags_s3_bucket" {
type = map(string)
default = {}
}

#######
# Debug
#######
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ variable "tags" {
default = {}
}

variable "tags_s3_bucket" {
description = "Tag metadata to label AWS S3 buckets. Overrides tags with the same name in input variable tags."
type = map(string)
default = {}
}

################
# Debug Settings
################
Expand Down

0 comments on commit be7851d

Please sign in to comment.