-
Notifications
You must be signed in to change notification settings - Fork 0
/
s3_buckets.tf
40 lines (40 loc) · 1.18 KB
/
s3_buckets.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
resource "aws_s3_bucket" "awss3bucketseidev" {
bucket = "tf-s3-bucket-cloudtrail-sei.estc.dev"
force_destroy = true
tags = {
division = "engineering"
org = "security"
team = "security-external-integrations"
managed_by = "terraform"
}
policy = <<POLICY
{
"Version": "2012-10-17"
"Statement": [
{
"Sid": "ElasticSEIAWSCloudTrailAclCheck",
"Effect": "Allow",
"Principal": {
"Service": "cloudtrail.amazonaws.com"
},
"Action": "s3:GetBucketAcl",
"Resource": "arn:aws:s3:::tf-se-bucket-cpoqs"
},
{
"Sid": "ElasticSEIAWSCloudTrailWrite",
"Effect": "Allow",
"Principal": {
"Service": "cloudtrail.amazonaws.com"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::tf-s3-bucket-cloudtrail-sei.estc.dev/cloudtrailkey/AWSLogs/${data.aws_caller_identity.current.account_id}/*"
"Condition": {
"StringEquals": {
"s3:x-amz-acl": "bucket-owner-full-control"
}
}
}
]
}
POLICY
}