hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.68k stars 9.55k forks source link

Support for configuring Akamai #5639

Closed joshuaspence closed 6 years ago

joshuaspence commented 8 years ago

We are using Akamai as a CDN provider and it would be awesome if we could use Terraform to configure our Akamai sites.

joshuaspence commented 8 years ago

I started doing some work on this, but I've run into a few issues so far...

1. Some resources are read-only Some Akamai resources, such as a contract, are read-only. I think that this is because they are created on Akamai's end rather than by the account owner. In the Akamai account that I have access to there exists only a single contract so I was thinking that we could have an akamai_contract data source, but I suppose it is possible that other accounts will have multiple contracts. It seems that when creating other resources through the API, they must be linked to a contract.

2. There is no API sandbox There is no API sandbox and I don't think that users can register there own accounts with Akamai. A similar question was asked on Akamai's community forums and the response was:

Unfortunately, the only way to interact with the services that the APIs expose is to have an account setup with Akamai.

3. Configuration is readonly It seems that (at least in my use case) the primary resources for an Akamai provider would be akamai_property and maybe akamai_property_version. I think that the data model for Akamai properties is different to what Terraform exacts, though. In Akamai, a property can have multiple versions of its configuration associated with it. The versions are labelled sequentially beginning at 1. Changing anything in the property configuration means that a new version needs to be created. I'm not sure if any other existing Terraform providers behave in this way.

4. Configuration requires explicit activation Once a property has been configured, it is then required to be "activated". Activation can be performed to either the staging environment, the production environment, or both. I'm not sure how best to handle this in Terraform. My initial thought was to leave activation out of scope and require users to manually verify and activate any configuration that Terraform creates. I suppose that another option would be to add some activate_immediately property to the resource.

CpuID commented 8 years ago

@joshuaspence one thing to note, HashiCorp are normally willing to maintain an active account (with minimal or no traffic throughput) with various CDNs for acceptance testing purposes. I know I went through this with @jen20 for Edgecast/VDMS earlier this year. This may help when you want to perform potentially destructive code testing on resources, and you want to do it on a non-production account.

apparentlymart commented 8 years ago

Hi @joshuaspence,

Not sure if this is still useful since I guess you've started already, but FYI the Fastly provider has a similar versioning mechanism to deal with. You can see the notes I made while researching/designing that in #3716.

joshuaspence commented 8 years ago

Thanks for the pointer to #3716, definitely useful

jschulenklopper commented 7 years ago

Things might have changed (recently). This page, https://developer.akamai.com/api/luna/papi/overview.html, mentions (with emphasis by me):

The Property Manager API (a.k.a. PAPI) offers a programmatic OPEN interface to manage how Akamai edge servers process requests, responses, and objects served over the Akamai platform. [...] Like the Luna Control Center’s Property Manager [the administration UI - JSc], this API lets you modify your property configurations and activate them on Akamai staging or production networks. The API allows you to access the same features rapidly and flexibly using your own tools. PAPI allows you to generate properties dynamically, associate them with dynamically generated hostnames, and to create new CP codes to report on your content’s traffic.

Using PAPI requires that Akamai enables that for your account, so account creation and account-level configuration is outside of the scope of this API... but after that many (all?) of the things possible via manual configuration in Luna should be possible via the API.

I reached out to Akamai Community asking for a Terraform provider - apparently that question hasn't been asked there previously.

jamiesonio commented 7 years ago

I was looking for Akamai Terraform provider today and came across this that was published recently. https://github.com/Comcast/terraform-provider-akamai

paultyng commented 6 years ago

Closing, as there is a community provider.

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.