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

Bump module versions and update GitHub workflows #125

Merged
merged 6 commits into from
Jan 5, 2022
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
2 changes: 1 addition & 1 deletion .github/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ template: |

replacers:
# Remove irrelevant information from Renovate bot
- search: '/(?<=---\s+)+^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm'
- search: '/(?<=---\s)\s*^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm'
replace: ''
# Remove Renovate bot banner image
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2019-2021 Cloud Posse, LLC
Copyright 2019-2022 Cloud Posse, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.

## Copyright

Copyright © 2017-2021 [Cloud Posse, LLC](https://cpco.io/copyright)
Copyright © 2017-2022 [Cloud Posse, LLC](https://cpco.io/copyright)



Expand Down
6 changes: 3 additions & 3 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ output "bucket_domain_name" {

output "bucket_id" {
value = module.s3_bucket.bucket_id
description = "Bucket Name (aka ID)"
description = "Bucket ID"
}

output "bucket_arn" {
Expand All @@ -15,12 +15,12 @@ output "bucket_arn" {

output "replication_bucket_id" {
value = local.replication_enabled ? join("", module.s3_bucket_replication_target.*.bucket_id) : null
description = "Bucket Name (aka ID)"
description = "Replication bucket ID"
}

output "replication_bucket_arn" {
value = local.replication_enabled ? join("", module.s3_bucket_replication_target.*.bucket_arn) : null
description = "Bucket ARN"
description = "Replication bucket bucket ARN"
}

output "replication_role_arn" {
Expand Down
9 changes: 6 additions & 3 deletions examples/complete/privileged-principals.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
locals {
account_id = data.aws_caller_identity.current.account_id

principal_names = [
"arn:aws:iam::${local.account_id}:role/${join("", module.deployment_principal_label.*.id)}",
"arn:aws:iam::${local.account_id}:role/${join("", module.additional_deployment_principal_label.*.id)}"
]

privileged_principal_arns = var.privileged_principal_enabled ? {
(local.principal_names[0]) = [""]
(local.principal_names[1]) = ["prefix1/", "prefix2/"]
Expand Down Expand Up @@ -43,7 +45,8 @@ resource "aws_iam_policy" "deployment_iam_policy" {

module "deployment_principal_label" {
source = "cloudposse/label/null"
version = "0.24.1"
version = "0.25.0"

enabled = var.privileged_principal_enabled

attributes = ["deployment"]
Expand All @@ -60,10 +63,10 @@ resource "aws_iam_role" "deployment_iam_role" {
tags = module.deployment_principal_label.tags
}


module "additional_deployment_principal_label" {
source = "cloudposse/label/null"
version = "0.24.1"
version = "0.25.0"

enabled = var.privileged_principal_enabled

attributes = ["deployment", "additional"]
Expand Down
2 changes: 2 additions & 0 deletions examples/complete/replication.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
locals {
replication_enabled = length(var.s3_replication_rules) > 0

extra_rule = local.replication_enabled ? {
id = "replication-test-explicit-bucket"
status = "Enabled"
prefix = "/extra"
priority = 5
destination_bucket = module.s3_bucket_replication_target_extra[0].bucket_arn
} : null

s3_replication_rules = local.replication_enabled ? concat(var.s3_replication_rules, [local.extra_rule]) : null
}

Expand Down
25 changes: 17 additions & 8 deletions examples/complete/replication.us-east-2.tfvars
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# Do not set "enabled", will be set by test framework
# enabled = true
region = "us-east-2"
namespace = "eg"
stage = "test"
name = "s3-replication-test"
acl = "private"
force_destroy = true
versioning_enabled = true

region = "us-east-2"

namespace = "eg"

stage = "test"

name = "s3-replication-test"

acl = "private"

force_destroy = true

versioning_enabled = true

allow_encrypted_uploads_only = true

allowed_bucket_actions = [
"s3:PutObject",
"s3:PutObjectAcl",
Expand All @@ -26,4 +35,4 @@ s3_replication_rules = [
status = "Enabled"
prefix = "/main"
}
]
]
2 changes: 1 addition & 1 deletion examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ variable "grants" {

variable "lifecycle_rules" {
type = list(object({
prefix = string
enabled = bool
prefix = string
tags = map(string)

enable_glacier_transition = bool
Expand Down
2 changes: 1 addition & 1 deletion test/src/examples_complete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,4 +372,4 @@ func TestExamplesCompleteDisabled(t *testing.T) {

// Verify we're getting back the outputs we expect
assert.Empty(t, s3ReplicationBucketId, "When disabled, module should have no outputs.")
}
}
86 changes: 83 additions & 3 deletions test/src/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,88 @@
module github.com/cloudposse/terraform-aws-s3-bucket

go 1.14
go 1.17

require (
github.com/gruntwork-io/terratest v0.28.10
github.com/stretchr/testify v1.5.1
github.com/gruntwork-io/terratest v0.38.8
github.com/stretchr/testify v1.7.0
)

require (
cloud.google.com/go v0.83.0 // indirect
cloud.google.com/go/storage v1.10.0 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/aws/aws-sdk-go v1.40.56 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect
github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0 // indirect
github.com/go-logr/logr v0.2.0 // indirect
github.com/go-sql-driver/mysql v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/googleapis/gnostic v0.4.1 // indirect
github.com/gruntwork-io/go-commons v0.8.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.5.9 // indirect
github.com/hashicorp/go-multierror v1.1.0 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.3.0 // indirect
github.com/hashicorp/hcl/v2 v2.9.1 // indirect
github.com/hashicorp/terraform-json v0.12.0 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/klauspost/compress v1.13.0 // indirect
github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pquerna/otp v1.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tmccombs/hcl2json v0.3.3 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/urfave/cli v1.22.2 // indirect
github.com/zclconf/go-cty v1.8.1 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
golang.org/x/sys v0.0.0-20210603125802-9665404d3644 // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
golang.org/x/tools v0.1.2 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/api v0.47.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/grpc v1.38.0 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.20.6 // indirect
k8s.io/apimachinery v0.20.6 // indirect
k8s.io/client-go v0.20.6 // indirect
k8s.io/klog/v2 v2.4.0 // indirect
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.0.3 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
Loading