Skip to content

Commit

Permalink
Merge pull request #1434 from coingraham/s3-bucket-policy-html-markdo…
Browse files Browse the repository at this point in the history
…wn-update

S3 bucket policy html markdown update
  • Loading branch information
Ninir authored Aug 16, 2017
2 parents 5402b3c + 560d25a commit dde16a0
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions website/docs/r/s3_bucket_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,33 @@ Attaches a policy to an S3 bucket resource.

## Example Usage

### Using versioning
### Basic Usage

```hcl
resource "aws_s3_bucket" "b" {
# Arguments
}
data "aws_iam_policy_document" "b" {
# Policy statements
bucket = "my_tf_test_bucket"
}
resource "aws_s3_bucket_policy" "b" {
bucket = "${aws_s3_bucket.b.id}"
policy = "${data.aws_iam_policy_document.b.json}"
policy =<<POLICY
{
"Version": "2012-10-17",
"Id": "MYBUCKETPOLICY",
"Statement": [
{
"Sid": "IPAllow",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": "arn:aws:s3:::my_tf_test_bucket/*",
"Condition": {
"IpAddress": {"aws:SourceIp": "8.8.8.8/32"}
}
}
]
}
POLICY
}
```

Expand Down

0 comments on commit dde16a0

Please sign in to comment.