Skip to content

Commit

Permalink
Create s3bucketpolicy.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
100daysofdevops committed Feb 22, 2019
1 parent 0fca7b6 commit 87e302b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions s3bucketpolicy.tf
@@ -0,0 +1,28 @@
provider "aws" {
region = "us-west-2"
}
resource "aws_s3_bucket_policy" "s3policy" {
bucket = "mytests3bucket"

policy = <<POLICY
{
"Version": "2012-10-17",
"Id": "MYBUCKETPOLICY",
"Statement": [
{
"Sid": "IPAllow",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::mytests3bucket*",
"Condition": {
"IpAddress": {"aws:SourceIp": "192.168.0.2/24"}
}
}
]
}
POLICY
}

0 comments on commit 87e302b

Please sign in to comment.