Skip to content

Commit

Permalink
Merge branch 'master' into update-ci-comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux authored Aug 3, 2020
2 parents f75d88f + 9e14600 commit 4fd03d2
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 39 deletions.
6 changes: 2 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
repos:
- repo: https://github.com/mineiros-io/pre-commit-hooks
rev: v0.1.4
rev: v0.2.2
hooks:
- id: terraform-fmt
- id: terraform-validate
exclude: ^examples|.terraform/
- id: tflint
- id: gofmt
- id: goimports
- id: golint
- id: golangci-lint
- id: phony-targets
- id: markdown-link-check
95 changes: 95 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.3.0] - 2020-08-03
### Changed
- Add support for 3.x terraform AWS provider

### Removed
- Remove deprecated `region` argument (BREAKING CHANGE)

## [0.2.2] - 2020-07-23
### Added
- Add Changelog.md.
### Changed
- Migrate CI from SemaphoreCI to GitHub Actions.
- Migrate to [golangci-lint](https://github.com/golangci/golangci-lint) instead
of native go tools for pre-commit hooks.

## [0.2.1] - 2020-06-13
### Added
- Work around a terraform issue in `module_depends_on` argument.

## [0.2.0] - 2020-06-08
### Added
- Implement `module_enabled` and `module_depends_on` this replaces the `create` flag.
- This replaces the backward-incompatible v0.1.5 which we removed right after
noticing the issue.
### Changed
- Upgrade documentation.
- Update build-system.

## [0.1.4] - 2020-04-14
### Added
- Add access point support.
### Changed
- Refactored examples.

## [0.1.3] - 2020-03-23
### Added
- Allow log delivery from ELBs in different regions.

## [0.1.2] - 2020-03-19
### Added
- Add ELB log delivery option to the module.

## [0.1.1] - 2020-03-04
### Added
- Add the option to grant read-only access to existing Cloudfront Origin Access
Identities via `origin_access_identities`.

## [0.1.0] - 2020-02-29
### Added
- Add support for Origin Access Identity Access from Cloudfront.

## [0.0.3] - 2020-01-24
### Changed
- Update minimum Terraform version to 0.12.20,
so we can take advantage of `try` and `can`.
- Update README.md with and align it with our new format.

## [0.0.2] - 2020-01-20
### Added
- SemaphoreCI Integration that will run build, pre-commit checks and unit tests.
- Add an example and a simple test case.
- Further elaboration in README.md.

## [0.0.1] - 2020-01-02
### Added
- Bucket public access blocking all set to true by default.
- Server-Side-Encryption (SSE) at rest enabled by default (AES256).
- Bucket ACL defaults to canned private ACL.
- Server-Side-Encryption (SSE) enabled by default
- Added support for Versioning, Bucket Logging, Lifecycle Rules, Request Payer,
Cross-Origin Resource Sharing (CORS), Acceleration Status, Bucket Policy and Tags.

<!-- markdown-link-check-disable -->
[Unreleased]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.3.0...HEAD
[0.3.0]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.2.2...v0.3.0
[0.2.2]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.2.1...v0.2.2
<!-- markdown-link-check-enable -->
[0.2.1]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.1.4...v0.2.0
[0.1.4]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.1.3...v0.1.4
[0.1.3]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.0.3...v0.1.0
[0.0.3]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.0.2...v0.0.3
[0.0.2]: https://github.com/mineiros-io/terraform-aws-s3-bucket/compare/v0.0.1...v0.0.2
[0.0.1]: https://github.com/mineiros-io/terraform-aws-s3-bucket/releases/tag/v0.0.1
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Most basic usage creating a random named secure AWS bucket.
```hcl
module "bucket" {
source = "mineiros-io/s3-bucket/aws"
version = "~> 0.2.1"
version = "~> 0.3.0"
}
```

Expand Down Expand Up @@ -154,11 +154,6 @@ See [variables.tf] and [examples/] for details and use-cases.
Sets the accelerate configuration of an existing bucket. Can be `Enabled` or `Suspended`.
Default is `null`.

- **`region`**: *(Optional `string`)*

If specified, the AWS region this bucket should reside in.
Default is the region used by the callee.

- **`request_payer`**: *(Optional `string`)*

Specifies who should bear the cost of Amazon S3 data transfer. Can be either `BucketOwner` or `Requester`.
Expand Down Expand Up @@ -289,7 +284,7 @@ See [variables.tf] and [examples/] for details and use-cases.

Specify a list of Cloudfront OAIs to grant read-only access to.
If in addition a new origin access identity is created via the `create_origin_access_identity`
attribute, all identities will be granted access.
attribute, all identities will be granted access.
**Attention:** Objects shared that way need
to be owned by the account the bucket belongs to and can not be owned by other accounts
(e.g. when uploaded through cross-account-access).
Expand Down
4 changes: 2 additions & 2 deletions examples/secure-s3-bucket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The code in [main.tf] defines...
```hcl
module "example-app-bucket" {
source = "mineiros-io/s3-bucket/aws"
version = "~> 0.2.1"
version = "~> 0.3.0"
bucket_prefix = "app"
Expand All @@ -40,7 +40,7 @@ module "example-app-bucket" {
module "example-log-bucket" {
source = "mineiros-io/s3-bucket/aws"
version = "~> 0.2.1"
version = "~> 0.3.0"
bucket_prefix = "log"
Expand Down
6 changes: 3 additions & 3 deletions examples/secure-s3-bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

provider "aws" {
region = "us-east-1"
version = "~> 2.0"
version = "~> 3.0"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand All @@ -14,7 +14,7 @@ provider "aws" {

module "example-app-bucket" {
source = "mineiros-io/s3-bucket/aws"
version = "~> 0.2.1"
version = "~> 0.3.0"

bucket_prefix = "app"

Expand All @@ -38,7 +38,7 @@ module "example-app-bucket" {

module "example-log-bucket" {
source = "mineiros-io/s3-bucket/aws"
version = "~> 0.2.1"
version = "~> 0.3.0"

bucket_prefix = "log"

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4 h1:Hynbrlo6LbYI3H1IqXpkVDOcX
golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200107162124-548cf772de50 h1:YvQ10rzcqWXLlJZ3XCUoO25savxmscf4+SC+ZqiCHhA=
golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down Expand Up @@ -471,6 +472,7 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
Expand Down
1 change: 0 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ resource "aws_s3_bucket" "bucket" {
tags = var.tags
force_destroy = var.force_destroy
acceleration_status = var.acceleration_status
region = var.region
request_payer = var.request_payer

dynamic "cors_rule" {
Expand Down
7 changes: 3 additions & 4 deletions test/secure-s3-bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = var.aws_region
version = "~> 3.0"
region = var.aws_region
}

# ---------------------------------------------------------------------------------------------------------------------
Expand All @@ -14,7 +15,6 @@ provider "aws" {
module "example-app-bucket" {
source = "../.."

region = var.aws_region
versioning = true

logging = {
Expand Down Expand Up @@ -51,8 +51,7 @@ module "example-app-bucket" {
module "example-log-bucket" {
source = "../.."

region = var.aws_region
acl = "log-delivery-write"
acl = "log-delivery-write"

# this is just for running the example even if logs already exist
# this should not be set in production as all objects will be unrecoverably destroyed
Expand Down
11 changes: 0 additions & 11 deletions test/secure-s3-bucket/versions.tf

This file was deleted.

6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
# These variables have defaults, but may be overridden.
# ---------------------------------------------------------------------------------------------------------------------

variable "region" {
description = "If specified, the AWS region this bucket should reside in. (default: region of the callee)."
type = string
default = null
}

variable "bucket" {
description = "The name of the bucket. (forces new resource, default: unique random name)"
type = string
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ terraform {
required_version = "~> 0.12.20"

required_providers {
aws = "~> 2.51"
aws = ">= 2.51, < 4.0"
}
}

0 comments on commit 4fd03d2

Please sign in to comment.