Skip to content

Commit

Permalink
PLAT-6563: Fix S3 provisioning (#75)
Browse files Browse the repository at this point in the history
* Add file so I can make a PR w/o changes

* Add aws_s3_bucket_ownership_controls block

* Remove temp file

* Get latest tag via reverse version sort

* Terraform-docs change
  • Loading branch information
Secretions authored Apr 18, 2023
1 parent aed66c8 commit 622dfe4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ jobs:
name: "Set module source to latest published release"
working_directory: tests
command: |
latest_release_commit="$(git rev-list --tags --max-count=1)"
latest_release_tag="$(git describe --tags ${latest_release_commit})"
latest_release_tag="$(git tag --sort=-v:refname | head -1)"
export MOD_SOURCE="github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git?ref=${latest_release_tag}"
echo "Latest published release tag is: ${latest_release_tag}"
echo "Setting module source to: ${MOD_SOURCE}"
Expand Down
1 change: 1 addition & 0 deletions submodules/storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ No modules.
| [aws_s3_bucket.registry](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
| [aws_s3_bucket_acl.monitoring](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl) | resource |
| [aws_s3_bucket_logging.buckets_logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_logging) | resource |
| [aws_s3_bucket_ownership_controls.monitoring](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_ownership_controls) | resource |
| [aws_s3_bucket_policy.buckets_policies](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
| [aws_s3_bucket_public_access_block.block_public_accss](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource |
| [aws_s3_bucket_request_payment_configuration.buckets_payer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_request_payment_configuration) | resource |
Expand Down
9 changes: 9 additions & 0 deletions submodules/storage/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,16 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "monitoring" {
}
}

resource "aws_s3_bucket_ownership_controls" "monitoring" {
bucket = aws_s3_bucket.monitoring.id
rule {
object_ownership = "BucketOwnerPreferred"
}
}

resource "aws_s3_bucket_acl" "monitoring" {
depends_on = [aws_s3_bucket_ownership_controls.monitoring]

bucket = aws_s3_bucket.monitoring.id

access_control_policy {
Expand Down

0 comments on commit 622dfe4

Please sign in to comment.