Use the OSS Terraform module to manage OSS buckets and objects as code. With the Alibaba Cloud Terraform provider, you can automate OSS resource provisioning alongside other cloud infrastructure — no manual console operations required.
HashiCorp Terraform is an open-source infrastructure-as-code tool. Alibaba Cloud is the third largest cloud service provider. The Alibaba Cloud provider supports at least 90 resources and data sources across more than 20 services. The easy-to-use command line interface (CLI) of Terraform allows you to deploy configuration files on Alibaba Cloud or any other supported cloud and control the versions of the configuration files. The CLI provides code for infrastructure resources such as VMs, storage accounts, and network interfaces defined in the configuration files that describe the cloud resource topology. Terraform is a highly scalable tool that supports new infrastructures from providers. You can use Terraform to manage resources, including OSS objects, ECS instances, VPCs, ApsaraDB RDS instances, and SLB instances. An increasing number of developers contribute to the Alibaba Cloud Terraform ecosystem. For the full provider reference, see terraform-alicloud-provider.
Features of OSS Terraform module
The OSS Terraform module supports bucket and object management:
-
Bucket management:
Create a bucket.
Configure an ACL for a bucket.
Configure Cross-Origin Resource Sharing (CORS) for a bucket.
Configure logging for a bucket.
Configure static website hosting for a bucket.
Configure hotlink protection for a bucket.
Configure lifecycle rules for a bucket.
-
Object management:
Upload an object.
Configure server-side encryption for an object.
Configure an ACL for an object.
Configure object metadata.
References
For installation and usage instructions, see Create a bucket with Terraform.
To download the OSS Terraform module, visit terraform-alicloud-modules.
For the full OSS Terraform module reference, visit alicloud_oss_bucket.