Turn your Akamai property into a Terraform configuration in less than 1 minute!

Hello there! With the Akamai Terraform CLI you can export your existing Akamai properties (content delivery configurations) into a Terraform configuration file in less than a minute.

If you have the Akamai CLI installed, you can run the ‘akamai install terraform’ command to install the Terraform sub-package. Once installed and relying on your valid edgerc file, you can run the export-property command. This command will lookup your property based on the name of the property and export all relevant Akamai objects such as the property, Edge Hostnames, CP Codes and all the relevant rules, criteria and behaviors into Terraform data sources and resources.

With ‘akamai terraform export-property wildcard.securitylevelup.eu’, I was able to easily export my property into Terraform code. You will also have an Terraform import script that will help import all assets into your Terraform state making this the easiest start to start using Terraform for your Akamai properties.

Other Akamai solutions such as Edge DNS or Application Security are also supported with the Akamai CLI but that is a DevTip for another time.

Thanks for reading! If you have any questions about this DevTip, please feel free to let me know in the comments below and I will help you out.

4 Likes

This is a Great video!

1 Like

+1. Silent but efficient :slight_smile:

2 Likes

Did I imagine it or did I read somewhere that the CLI terraform package would support exporting PM config to HCL where the PM config is set to “latest” rule format ?

TIL; If you switch the PM from the “latest” rule format to say “v2023-01-05” you get loads of config errors, for behaviours such as Set Variable and Origin Server. We’d seen that before and couldn’t figure out the reason, and AkaTech advised we’d have to remove the behaviours and then change the format and then re-add the behaviours. Maybe not so bad if the config is fully converted to Terraform (ours isn’t).
What I learnt today was that if you switch the rule format to one of the newer/newest format, voila, no errors. :smiley:

Hi David,

We are aware of the ‘latest’ rule format incompatibility and have flagged this to be solved to both the Akamai Terraform engineering and Property Manager engineering teams. I haven’t heard of a timeline yet when this would be supported so for now it is locked/specified rule format versions only.

And yes, the behaviors were mostly likely on an old version and removing and readding them will load in the latest version of it.

/Mike

many thanks for the update Mike :man_mage:

1 Like