-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from ministryofjustice/block-pub-on
Block public access resource added
- Loading branch information
Showing
5 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,21 @@ module "example_team_s3" { | |
infrastructure-support = "[email protected]" | ||
/* | ||
* Public Buckets: It is strongly advised to keep buckets 'private' and only make public where necessary. | ||
By default buckets are private, however to create a 'public' bucket add the following two variables when calling the module: | ||
acl = "public-read" | ||
enable_allow_block_pub_access = false | ||
For more information granting public access to S3 buckets, please see AWS documentation: | ||
https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html | ||
* Converting existing private bucket to public: If amending an existing private bucket that was created using version 4.3 or above then you will need to raise two PRs: | ||
(1) First PR to add the var: enable_allow_block_pub_access = false | ||
(2) Second PR to add the var: acl = "public-read" | ||
* Versioning: By default this is set to false. When set to true multiple versions of an object can be stored | ||
For more details on versioning please visit: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html | ||
|
@@ -199,3 +214,6 @@ aws s3 sync --delete \ | |
``` | ||
|
||
For an example of a pod with a custom CLI that wraps s3 sync you can see the [cccd-migrator](https://github.com/ministryofjustice/cccd-migrator) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
|
||
terraform { | ||
backend "s3" { | ||
backend "s3" { | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,30 @@ | |
*/ | ||
module "example_team_s3_bucket" { | ||
|
||
source = "github.com/ministryofjustice/cloud-platform-terraform-s3-bucket?ref=4.2" | ||
source = "github.com/ministryofjustice/cloud-platform-terraform-s3-bucket?ref=4.3" | ||
team_name = "cloudplatform" | ||
business-unit = "mojdigital" | ||
application = "cloud-platform-terraform-s3-bucket" | ||
is-production = "false" | ||
environment-name = "development" | ||
infrastructure-support = "[email protected]" | ||
|
||
/* | ||
* Public Buckets: It is strongly advised to keep buckets 'private' and only make public where necessary. | ||
By default buckets are private, however to create a 'public' bucket add the following two variables when calling the module: | ||
acl = "public-read" | ||
enable_allow_block_pub_access = false | ||
For more information granting public access to S3 buckets, please see AWS documentation: | ||
https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html | ||
* Converting existing private bucket to public: If amending an existing private bucket that was created using version 4.3 or above then you will need to raise two PRs: | ||
(1) First PR to add the var: enable_allow_block_pub_access = false | ||
(2) Second PR to add the var: acl = "public-read" | ||
* Versioning: By default this is set to false. When set to true multiple versions of an object can be stored | ||
For more details on versioning please visit: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html | ||
|
@@ -163,6 +179,7 @@ EOF | |
} | ||
} | ||
|
||
|
||
resource "kubernetes_secret" "example_team_s3_bucket" { | ||
metadata { | ||
name = "example-team-s3-bucket-output" | ||
|
@@ -175,5 +192,4 @@ resource "kubernetes_secret" "example_team_s3_bucket" { | |
bucket_arn = module.example_team_s3_bucket.bucket_arn | ||
bucket_name = module.example_team_s3_bucket.bucket_name | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters