Skip to content

Commit

Permalink
add policy implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
coderall authored and xiaozhu36 committed Apr 24, 2019
1 parent 063fb1e commit 24e14e2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ You can use this in your terraform template with the following steps.
| logging_isenable | The flag of using logging enable container. Defaults true | string | "true" | no |
| referer_config | The configuration of referer | list | [] | no |
| lifecycle_rule | A configuration of object lifecycle management | list | [] | no |
| policy | JSON formatted bucket policy text to attach to the bucket | string | "" | no |
## Outputs
Expand Down
11 changes: 10 additions & 1 deletion examples/create_oss_bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,14 @@ module "oss-bucket" {
date = "2018-01-12"
}]
},
]
],
policy = <<POLICY
{"Statement":
[{"Action":
["oss:PutObject", "oss:GetObject", "oss:DeleteBucket"],
"Effect":"Allow",
"Resource":
["acs:oss:*:*:*"]}],
"Version":"1"}
POLICY
}
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ resource "alicloud_oss_bucket" "create_new_bucket" {
logging_isenable = "${var.logging_isenable}"
referer_config = "${var.referer_config}"
lifecycle_rule = "${var.lifecycle_rule}"
policy = "${var.policy}"
}
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ variable "lifecycle_rule" {
type = "list"
default = []
}

variable "policy" {
type = "string"
default = ""
}

0 comments on commit 24e14e2

Please sign in to comment.