Akamai with TF¶
Imported from Confluence
Content may be outdated. Verify before following any procedures. View original | Last updated: November 2024
We are managing our DNS records in Akamai by using Terraform state in GCP bucket to avoid any manual changes from Akamai UI console. From AGP side we only managing fyber.com and sponsorpay.com domains from this repo appgrowthplatform (Gitlab)
For now we don't have any Gitlab pipeline to run the terraform automatically, So we need to manually apply terraform from our local machine and raise MR accordingly.
Here is our terraform module to manage records separately
How to authenticate Akamai from your machine?¶
- Firstly you need to have access in our Akamai project
- Install Akamai on local machine brew install akamai
- Create an API token in akamai console and save it in your local machine directory ~/.edgerc informat
****in
How to run TF changes from gitlab pipeline?¶
Wehave 2 folder inside terraform/prod directory fyber_com and sponsorpay_com . If we want add any type records in any DNS zone , we have to add the records in correct section in main.tf file ( for example in fyber_com) we have separate section like a_records,ns_records,mx_records,txt_records,cname_records .
After your changes in respective directory, you can verify plan from your local machine or you can check it in pipeline as well.
From you machine just run terraform init and terraform plan in respective directory where you did changed.
For apply purpose we have to follow the below steps:
- Create MR ,
- Verify terraform format and terraform plan from pipeline
- Get approval from team members
- Trigger Terraform Apply from pipeline manually
Please don't apply from your local machine, always use Gitlab pipeline.¶
Example¶
nslookup test-api.sponsorpay.com
Server: 100.96.1.49
Address: 100.96.1.49#53
Non-authoritative answer:
Name: test-api.sponsorpay.com
Address: 85.195.94.196