Skip to content

Latest commit

 

History

History
92 lines (64 loc) · 3.35 KB

index.md

File metadata and controls

92 lines (64 loc) · 3.35 KB
page_title description
Provider: Ably
Ably Terraform Provider is used to manage Ably account resources.

Ably Provider

Ably Terraform Provider enables you to manage your Ably account programmatically. It is built on top of the Ably Control API.

Using this provider you can automate the provisioning, management, and testing of your Ably realtime infrastructure. You can dynamically create Ably apps, configure them, and delete them if necessary. You can implement multi-tenancy solutions for your customers, and create configuration-driven environments that can easily be replicated under programmatic control. Once these environments are created you can also test them using Ably Control API.

With the Ably Terraform Provider you can create and manage:

Repetitive operations such as creating, updating or deleting Ably apps, enumerating queues, creation of rules, and other tasks that would be time-consuming to carry out manually, can be automated using this provider.

Development status

Ably Terraform Provider is currently in Preview.

Authentication

To start using the Ably Terraform Provider you need to authenticate with Ably. You can do this by doing the following:

  1. Create a Control API token by logging into your Ably account and going to https://ably.com/users/access_tokens (Account -> My Access Tokens). This token should have permissions for the operations that you plan to do with Terraform provider. More details are available in Ably documentation.
  2. Set the environment variable ABLY_ACCOUNT_TOKEN to the token you have created.
  3. Add the ably to your list of required providers.
terraform {

  required_providers {
    ably = {
      source = "ably/ably"
    }
  }
}
  1. (Optional) Alternatively you can also specify Control API token in the provider configuration directly. This is not recommended and risks secret leakage should this file ever be committed to a public version control system.
terraform {

  required_providers {
    ably = {
      source = "ably/ably"
    }
  }
}

provider "ably" {
  token = "<Control API token>"
}

Importing existing resources

In order to import a resource, you need to add the resource to your Terraform configuration file, and then follow https://www.terraform.io/cli/import.

For example, in order to import an app with id {APP_ID} (you can retrieve app id from Ably dashboard or via Control API), add something similar to the following:

resource "ably_app" "app0" {
  name     = "ably-tf-provider-app-0000"
  status   = "enabled"
  tls_only = true
}

Then run the following command:

terraform import ably_app.app0 {APP_ID}

This will add the app to your Terraform state file. You can then run terraform plan to see what changes will be made to the app.

Schema

Optional

  • token (String, Sensitive)
  • url (String)