BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Ably Terraform Provider Aims to Power Realtime Architectures Using Infrastructure as Code

Ably Terraform Provider Aims to Power Realtime Architectures Using Infrastructure as Code

Bookmarks

Developed by Ably in partnership with HashiCorp, the Ably Terraform Provider enables using Terraform, a popular open-source infrastructure as code (IaC) tool, to provision and manage Ably solutions programmatically.

With its Terraform Provider, Ably brings the flexibility of IaC to its own realtime platform, thus making it possible to configure and provision it in a coherent and synchronized way with the rest of your IaC-managed infrastructure.

Ably Terraform Provider is built on top of the Ably Control API. It enables managing an Ably account and automating recurrent operations like enumerating messaging queues, creating integration rules with external services, and defining namespaces using Terraform configuration files.

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.

The Ably Terraform Provider includes a number of integration rules for distinct services, like AWS Lambda, Kafka, Azure Functions, Google Functions, Cloudflare Workers, and more. The following snippet shows how you can configure an AWS Lambda resource using Terraform's configuration language.

resource "ably_rule_lambda" "rule0" {
  app_id = ably_app.app0.id
  status = "enabled"
  source = {
    channel_filter = "^my-channel.*",
    type           = "channel.message"
  }
  target = {
    region        = "us-west-1",
    function_name = "rule0",
    enveloped     = false,
    format        = "json"
    authentication = {
      mode              = "credentials",
      access_key_id     = "hhhh"
      secret_access_key = "ffff"
    }
  }
}

Once you have described the desired state of your infrastructure, you can let Terraform plan the required changes and apply them automatically.

The Ably platform aims to provide a solution for realtime experiences including pub/sub messaging and data delivery, with support for a number of guarantees, including exactly-once semantics, ordered delivery, message delta compression and so on. It supports multiple realtime protocols, such as WebSockets, MQTT, and Server-Sent Events. Additionally, it also supports the delivery of native push notifications for iOS and Android apps.

HashiCorp Terraform is an infrastructure as code tool that lets you define Cloud and on-premises resources configuration files using a declarative, human-readable language. Terraform can be used with a variety of platforms or services through providers that serve as wrappers around their APIs. Besides Ably, available providers include Amazon Web Services (AWS), Azure, Google Cloud Platform (GCP), Kubernetes, Helm, GitHub, Splunk, DataDog, and many more.

About the Author

Rate this Article

Adoption
Style

BT