Skip to content

Commit

Permalink
Merge pull request #41 from mineiros-io/mariux/update-3.x-aws-provider
Browse files Browse the repository at this point in the history
Update 3.x aws provider
  • Loading branch information
mariux authored Aug 3, 2020
2 parents ab8e766 + 7787326 commit 9e14600
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 38 deletions.
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [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.
Expand Down Expand Up @@ -72,10 +79,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
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.2.2...HEAD
[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
Expand Down
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
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 9e14600

Please sign in to comment.