alicloud_oss_bucket_public_access_block
更新时间:
Provides a OSS Bucket Public Access Block resource. Blocking public access at the bucket-level.
For information about OSS Bucket Public Access Block and how to use it, see What is Bucket Public Access Block.
-> NOTE: Available since v1.224.0.
Example Usage
Basic Usage
variable "name" {
default = "terraform-example"
}
provider "alicloud" {
region = "cn-hangzhou"
}
resource "random_integer" "default" {
min = 10000
max = 99999
}
resource "alicloud_oss_bucket" "CreateBucket" {
storage_class = "Standard"
bucket = "${var.name}-${random_integer.default.result}"
}
resource "alicloud_oss_bucket_public_access_block" "default" {
bucket = alicloud_oss_bucket.CreateBucket.bucket
block_public_access = true
}
Argument Reference
The following arguments are supported:
block_public_access
- (Required) Whether AlibabaCloud OSS should block public bucket policies and ACL for this bucket.bucket
- (Required, ForceNew) The name of the bucket.
Attributes Reference
The following attributes are exported:
id
- The ID of the resource supplied above.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 5 mins) Used when create the Bucket Public Access Block.delete
- (Defaults to 5 mins) Used when delete the Bucket Public Access Block.update
- (Defaults to 5 mins) Used when update the Bucket Public Access Block.
Import
OSS Bucket Public Access Block can be imported using the id, e.g.
$ terraform import alicloud_oss_bucket_public_access_block.example <id>
文档内容是否对您有帮助?