I have created a new Terraform provider for Apigee:
https://registry.terraform.io/providers/scastria/apigee/latest
As you would expect, it leverages the Apigee Management API to perform all of the underlying work. This provider does not currently support all resource types that the Apigee Management API can handle, but it does offer quite a few. If you would like to know which resource types it does support, there is a Documentation tab at the link above.
If anyone would like to contribute to this provider or offer feedback, please go to the Github source repo here: https://github.com/scastria/terraform-provider-apigee
Here is a small example of what it looks like to create a proxy, deploy proxy, create product, create developer, create developer app, and import custom credential:
resource "apigee_proxy" "MyProxy" {
name = "MyProxy"
bundle = "proxies/MyProxy.zip"
bundle_hash = filebase64sha256("proxies/MyProxy.zip")
}
resource "apigee_proxy_deployment" "MyProxyDeploy" {
proxy_name = apigee_proxy.MyProxy.name
environment_name = "dev"
revision = apigee_proxy.MyProxy.revision
}
resource "apigee_product" "MyProduct" {
name = "MyProduct"
display_name = "My Product"
auto_approval_type = true
environments = [
"dev",
"test",
"stage"
]
proxies = [
apigee_proxy.MyProxy.name
]
scopes = [
"openid",
"profile"
]
}
resource "apigee_developer" "MyDeveloper" {
email = "Alex.Hamilton@example.com"
first_name = "Alex"
last_name = "Hamilton"
user_name = "ahamilton"
}
resource "apigee_developer_app" "MyApp" {
developer_email = apigee_developer.MyDeveloper.email
name = "MyApp"
attributes = {
DisplayName = "My App"
}
}
resource "apigee_developer_app_credential" "MyAppCred" {
developer_email = apigee_developer.MyDeveloper.email
developer_app_name = apigee_developer_app.MyApp.name
consumer_key = "importedKeyValue"
consumer_secret = "importedSecretValue"
api_products = [
apigee_product.MyProduct.name
]
}
NOTE: This is NOT intended to help install Apigee OnPrem, but to automate the configuration of Apigee whether in the Public Cloud or OnPrem.