File tree Expand file tree Collapse file tree 3 files changed +29
-8
lines changed
infrastructure/template/aws Expand file tree Collapse file tree 3 files changed +29
-8
lines changed Original file line number Diff line number Diff line change 33{% for __aws_storage_location_item in ( infra__aws_storage_locations | map (attribute ='bucket' ) | list | unique ) %}
44resource "aws_s3_bucket" "{{ __aws_storage_location_item }}" {
55 bucket = "{{ __aws_storage_location_item }}"
6- acl = "private"
76
87{% if infra__teardown_deletes_data %}
98 force_destroy = true
@@ -17,14 +16,20 @@ resource "aws_s3_bucket" "{{ __aws_storage_location_item }}" {
1716
1817 tags = merge(var.env_tags,{Name = "{{ __aws_storage_location_item }}"})
1918}
19+
20+ # Separate bucket acl resource definition
21+ resource "aws_s3_bucket_acl" "{{ __aws_storage_location_item }}" {
22+ bucket = aws_s3_bucket.{{ __aws_storage_location_item }}.id
23+ acl = "private"
24+ }
2025{% endfor %}
2126
2227# ------- AWS Buckets directory structures -------
2328{% for __aws_storage_object_item in infra__aws_storage_locations %}
2429{# Terraform resources cannot have '/' so replace with '_' #}
2530{% set __aws_storage_object_resource = __aws_storage_object_item .path |replace ("/" , "_" ) %}
2631
27- resource "aws_s3_bucket_object " "{{ __aws_storage_object_resource }}" {
32+ resource "aws_s3_object " "{{ __aws_storage_object_resource }}" {
2833 bucket = aws_s3_bucket.{{ __aws_storage_object_item.bucket }}.id
2934 key = "{{ __aws_storage_object_item.path }}/"
3035 # Below may not be required once we have the '/'
Original file line number Diff line number Diff line change 1+ terraform {
2+ required_providers {
3+ aws = {
4+ source = "hashicorp/aws"
5+ version = "~> 4.0"
6+ }
7+ }
8+ }
9+
110provider "aws" {
2- # access_key = var.access_key
3- # secret_key = var.secret_key
11+
412 profile = var.aws_profile
513 region = var.region
6- }
14+ }
Original file line number Diff line number Diff line change 1+ terraform {
2+ required_providers {
3+ aws = {
4+ source = "hashicorp/aws"
5+ version = "~> 4.0"
6+ }
7+ }
8+ }
9+
110provider "aws" {
2- # access_key = var.access_key
3- # secret_key = var.secret_key
11+
412 profile = var.aws_profile
513 region = var.region
6- }
14+ }
You can’t perform that action at this time.
0 commit comments