Skip to content
This repository has been archived by the owner on Dec 9, 2020. It is now read-only.

Files

Latest commit

 

History

History
50 lines (41 loc) · 1.08 KB

s3_bucket_policy.html.markdown

File metadata and controls

50 lines (41 loc) · 1.08 KB
layout page_title sidebar_current description
telefonicaopencloud
TelefonicaOpenCloud: telefonicaopencloud_s3_bucket_policy
docs-telefonicaopencloud-resource-s3-bucket-policy
Attaches a policy to an S3 bucket resource.

telefonicaopencloud_s3_bucket_policy

Attaches a policy to an S3 bucket resource.

Example Usage

Basic Usage

resource "telefonicaopencloud_s3_bucket" "b" {
  bucket = "my_tf_test_bucket"
}

resource "telefonicaopencloud_s3_bucket_policy" "b" {
  bucket = "${telefonicaopencloud_s3_bucket.b.id}"
  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
}

Argument Reference

The following arguments are supported:

  • bucket - (Required) The name of the bucket to which to apply the policy.
  • policy - (Required) The text of the policy.