Skip to content

Commit 33b1e24

Browse files
committed
force all restrictions for public access
1 parent 3748d9e commit 33b1e24

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
# Project Name
2-
Template useful to create a AWS terraform projects
1+
## Requirements
32

3+
No requirements.
44

5-
## Howo to use this template
5+
## Providers
66

7-
1. Create your git repository starting form this template.
8-
2. Configure your aws cli and set the [credentials settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). Also refer the conflunece page to work with [AWS SSO](https://pagopa.atlassian.net/wiki/spaces/DEVOPS/pages/466846955/AWS+-+Users+groups+and+roles#SSO-with-GSuite).
9-
3. The __src/init__ directory contains the terraform code to setup the S3 backend and Dynamodb lock table
10-
4. The __src/azuredevops__ direcory containes the terraform code to setup the azure devops project aming to run the IAC pipeline with the code defined in this repository.
11-
5. The __src/main__ directory cointains the terraform code aming to setup the infrastructure.
7+
No providers.
128

9+
## Modules
1310

14-
## Referencees
11+
No modules.
1512

16-
* [Confluence page](https://pagopa.atlassian.net/wiki/spaces/DEVOPS/pages/467894592/AWS+Setup+new+project)
13+
## Resources
14+
15+
No resources.
16+
17+
## Inputs
18+
19+
No inputs.
20+
21+
## Outputs
22+
23+
No outputs.

src/init/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ resource "aws_s3_bucket_acl" "terraform_states" {
4040
acl = "private"
4141
}
4242

43+
resource "aws_s3_bucket_public_access_block" "terraform_states" {
44+
bucket = aws_s3_bucket.terraform_states.id
45+
block_public_acls = true
46+
block_public_policy = true
47+
ignore_public_acls = true
48+
restrict_public_buckets = true
49+
}
50+
4351
resource "aws_s3_bucket_versioning" "terraform_states" {
4452
bucket = aws_s3_bucket.terraform_states.id
4553
versioning_configuration {

0 commit comments

Comments
 (0)