Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bucket logging module version #82

Merged
merged 2 commits into from
Jun 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Available targets:
| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no |
| enabled | Select Enabled if you want CloudFront to begin processing requests as soon as the distribution is created, or select Disabled if you do not want CloudFront to begin processing requests after the distribution is created. | `bool` | `true` | no |
| encryption\_enabled | When set to 'true' the resource will have aes256 encryption enabled by default | `bool` | `false` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no |
| error\_document | An absolute path to the document to return in case of a 4XX error | `string` | `""` | no |
| extra\_logs\_attributes | Additional attributes to put onto the log bucket label | `list(string)` | <pre>[<br> "logs"<br>]</pre> | no |
| extra\_origin\_attributes | Additional attributes to put onto the origin label | `list(string)` | <pre>[<br> "origin"<br>]</pre> | no |
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no |
| enabled | Select Enabled if you want CloudFront to begin processing requests as soon as the distribution is created, or select Disabled if you do not want CloudFront to begin processing requests after the distribution is created. | `bool` | `true` | no |
| encryption\_enabled | When set to 'true' the resource will have aes256 encryption enabled by default | `bool` | `false` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no |
| error\_document | An absolute path to the document to return in case of a 4XX error | `string` | `""` | no |
| extra\_logs\_attributes | Additional attributes to put onto the log bucket label | `list(string)` | <pre>[<br> "logs"<br>]</pre> | no |
| extra\_origin\_attributes | Additional attributes to put onto the origin label | `list(string)` | <pre>[<br> "origin"<br>]</pre> | no |
Expand Down
33 changes: 18 additions & 15 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ locals {
}

module "origin_label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
namespace = var.namespace
stage = var.stage
name = var.name
delimiter = var.delimiter
attributes = compact(concat(var.attributes, var.extra_origin_attributes))
tags = var.tags
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
namespace = var.namespace
environment = var.environment
stage = var.stage
name = var.name
delimiter = var.delimiter
attributes = compact(concat(var.attributes, var.extra_origin_attributes))
tags = var.tags
}

resource "aws_cloudfront_origin_access_identity" "default" {
Expand Down Expand Up @@ -145,9 +146,10 @@ resource "aws_s3_bucket" "origin" {
}

module "logs" {
source = "git::https://github.com/cloudposse/terraform-aws-s3-log-storage.git?ref=tags/0.7.0"
source = "git::https://github.com/cloudposse/terraform-aws-s3-log-storage.git?ref=tags/0.9.0"
enabled = var.logging_enabled
namespace = var.namespace
environment = var.environment
stage = var.stage
name = var.name
delimiter = var.delimiter
Expand All @@ -161,13 +163,14 @@ module "logs" {
}

module "distribution_label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
namespace = var.namespace
stage = var.stage
name = var.name
delimiter = var.delimiter
attributes = var.attributes
tags = var.tags
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
namespace = var.namespace
environment = var.environment
stage = var.stage
name = var.name
delimiter = var.delimiter
attributes = var.attributes
tags = var.tags
}

data "aws_s3_bucket" "selected" {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ variable "namespace" {
default = ""
}

variable "environment" {
type = string
default = ""
description = "Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT'"
}

variable "stage" {
type = string
description = "Stage (e.g. `prod`, `dev`, `staging`)"
Expand Down