UPD: added AllowSSLRequestsOnly bucket policy statement
This commit is contained in:
parent
d2ddc8dcf1
commit
9ecb677dde
@ -86,13 +86,25 @@ resource "aws_s3_bucket_policy" "bucket-policy" {
|
|||||||
"Effect": "Allow",
|
"Effect": "Allow",
|
||||||
"Resource": [
|
"Resource": [
|
||||||
"arn:aws:s3:::${var.bucket-name}/*",
|
"arn:aws:s3:::${var.bucket-name}/*",
|
||||||
"arn:aws:s3:::${var.bucket-name}-tfstate"
|
"arn:aws:s3:::${var.bucket-name}"
|
||||||
],
|
],
|
||||||
"Principal": {
|
"Principal": {
|
||||||
"AWS": [
|
"AWS": [
|
||||||
"arn:aws:iam::${data.aws_caller_identity.this.account_id}:root"
|
"arn:aws:iam::${data.aws_caller_identity.this.account_id}:root"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Sid": "AllowSSLRequestsOnly",
|
||||||
|
"Action": "s3:*",
|
||||||
|
"Effect": "Deny",
|
||||||
|
"Resource": "arn:aws:s3:::${var.bucket-name}/*",
|
||||||
|
"Condition": {
|
||||||
|
"Bool": {
|
||||||
|
"aws:SecureTransport": "false"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Principal": "*"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -116,4 +128,4 @@ resource "aws_dynamodb_table" "tfstate-lock-table" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data aws_caller_identity this {}
|
data "aws_caller_identity" "this" {}
|
||||||
|
Loading…
Reference in New Issue
Block a user