With the Akamai Terraform Provider, you are able to manage your Akamai-as-code. The Akamai Terraform Provider offers you the ability to execute key use-cases to manage your Akamai solutions. The Akamai Terraform Provider is officially approved by HashiCorp, who maintains Terraform.
You can find the full documentation including code examples and Getting Started tutorials on the Terraform Documentation website: https://www.terraform.io/docs/providers/akamai/index.html
What is supported today in the Akamai Terraform Provider?
Information as of July 2020
Manage your DNS zones and recordsets.
Manage your load balancing configurations.
Manage your delivery configurations.
Manage your Edge Hostnames and CP Codes.
Import existing DNS zones and Akamai configurations with the use of the Akamai Terraform CLI package.
Setting Up the Akamai Terraform Provider
In order to get started with the Akamai Terraform Provider, the following is required:
Either install the Akamai Development Environment or install Terraform.
Install the Akamai Development Environment: Both Terraform and the Akamai Terraform CLI package come pre-installed in the Akamai Development Environment. Get more details in our installation Instructions.
Install Terraform: Installing Terraform as a stand-alone installation. You can get more details in our instructions.
Create an Akamai API Client with the right permissions and valid credentials to authenticate your Akamai Terraform files.
Either import existing configurations with the Akamai Terraform CLI or start from scratch with code examples.
terraform initcommand to load the Akamai Terraform Provider.
terraform applycommand to run your Terraform configuration.
Authentication of Terraform configurations relies on the Akamai EdgeGrid. The Akamai Terraform Provider code acts as a wrapper for our APIs and re-uses the same authentication mechanism.
Note: We recommend storing your API credentials in a local .edgerc file.
When creating an Akamai API Client for use with the Akamai Terraform Provider, you’ll need to ensure that your API Client has read-write access to the following APIs depending on your use-case, including: Property Manager API (PAPI)
- DNS API
- Traffic Management API
Note: Without these permissions, your Terraform configurations won’t execute.
Import the Terraform CLI Package
The Terraform CLI package is also included in the Akamai Development Environment and can help you get started with the Akamai Terraform Provider faster.
This CLI package allows you to specify an existing Akamai delivery configuration or DNS zone with a recordset and export this into your proper Akamai Terraform configuration.
You can find detailed instructions in our Terraform CLI GitHub repository.
Create Your Terraform Configuration From Code Examples
You can start creating your Akamai Terraform files using our code examples from the Akamai Terraform Provider GitHub repository.
Run your Terraform file
After saving your configuration and navigate to the right directory in your command line, simply run the terraform init command to load the Akamai Terraform Provider, run the terraform plan to verify your changes and run the terraform apply command to execute your Terraform configuration.
Terraform Use Case
Manage DNS-as-code with Terraform
The Akamai Terraform Provider allows you to manage your DNS and load balancing configurations if you have access to Akamai Global Traffic Management or Akamai Edge DNS (formerly known as Akamai Fast DNS). You are able to fully manage your DNS zones, DNS records as well as any load balancing configurations you have configured in GTM.
The Akamai Terraform CLI package allows you to easily migrate any existing Edge DNS zone with a recordset and/or GTM configuration into a Terraform configuration. You can also manually create your Akamai Terraform configuration with either DNS or GTM resources.
You will have the ability to fully manage your DNS and load balancing through Terraform without the need for making manual changes inside the Akamai Control Center.
The steps required to get started with this use-case are as follows:
Install Terraform, either manually or through the Akamai Development Environment.
Create an Akamai API Client with the DNS API and Traffic Management API (you’ll need read-write permissions).
Import an existing DNS or GTM configuration with the Akamai Terraform CLI package or create a configuration from scratch.
terraform initto load the Akamai Terraform Provider.
terraform applyto send your DNS zones, records, and load balancing settings to Akamai.
Continue managing your Akamai-as-code by making manual changes to your Terraform configurations.
Alternatively, you can also store your Terraform configurations in a code repository tool such as GitHub.
This use-case is fully showcased in the webinar recording, attached below.
Watch the Full Recording
You can watch the full Webinar recording from July 2020 below to learn about Terraform and see our demos.
You Might Also Like
The tutorial above is fully explained on 15-minute YouTube playlist.