digitalocean_spaces_bucket_object

The Spaces object data source allows access to the metadata and _optionally_ (see below) content of an object stored inside a Spaces bucket.

Example Usage

The following example retrieves a text object (which must have a Content-Type value starting with text/) and uses it as the user_data for a Droplet:

data "digitalocean_spaces_bucket_object" "bootstrap_script" {
  bucket = "ourcorp-deploy-config"
  region = "nyc3"
  key    = "droplet-bootstrap-script.sh"
}

resource "digitalocean_droplet" "web" {
  image     = "ubuntu-18-04-x64"
  name      = "web-1"
  region    = "nyc2"
  size      = "s-1vcpu-1gb"
  user_data = data.digitalocean_spaces_bucket_object.bootstrap_script.body
}

Argument Reference

The following arguments are supported:

Attributes Reference

In addition to all arguments above, the following attributes are exported: