Closed fkieling closed 10 months ago
I have noticed that README.md
is missing description about --schema
flag which generating data in the format you are expecting. However help command is mentioning about it:
--schema Generate content of the policy using HCL instead of JSON file (default: false)
README.md will be updated in comnig release. Description of the flag is already in the 'help' of the export-imaging comand.
This issue should be resolved with recent release.
Hi there,
Akamai CLI Version
akamai version 1.5.5 akamai terraform version 1.7.0
Expected Behavior
When I export the image manager configuration I get full hcl code. At least since version 3.5 the terraform datat source is supported. The current version of the terraform provider is 5.0. See: https://github.com/akamai/terraform-provider-akamai/issues/453.
`terraform { required_providers { akamai = { source = "akamai/akamai" version = ">= 5.0.0" } } required_version = ">= 0.13" }
provider "akamai" { edgerc = var.edgerc_path config_section = var.config_section }
resource "akamai_imaging_policy_set" "policyset" { name = "XXX" region = "EMEA" type = "IMAGE" contract_id = "ctr_XXX" }
resource "akamai_imaging_policy_image" "policy__auto" { policy_id = ".auto" contract_id = "ctr_XXX" policyset_id = akamai_imaging_policy_set.policyset.id activate_on_production = true json = file("_auto.json") }
resource "akamai_imaging_policy_image" "policy_policy1" { policy_id = "policy1" contract_id = "ctr_XXX" policyset_id = akamai_imaging_policy_set.policyset.id activate_on_production = true json = data.akamai_imaging_policy_image.policy1.json }
data "akamai_imaging_policy_image" "policy1" { policy { output { adaptive_quality = 50 } breakpoints { widths = [ 400, 650, 850, 1010 ] } } }`
Actual Behavior
When I export the image manager configuration I get an "imaging.tf" and much json-files:
imaging.tf:
`terraform { required_providers { akamai = { source = "akamai/akamai" version = ">= 2.0.0" } } required_version = ">= 0.13" }
provider "akamai" { edgerc = var.edgerc_path config_section = var.config_section }
resource "akamai_imaging_policy_set" "policyset" { name = "XXX" region = "EMEA" type = "IMAGE" contract_id = "ctr_XXX" }
resource "akamai_imaging_policy_image" "policy__auto" { policy_id = ".auto" contract_id = "ctr_XXX" policyset_id = akamai_imaging_policy_set.policyset.id activate_on_production = true json = file("_auto.json") }
resource "akamai_imaging_policy_image" "policy_policy1" { policy_id = "policy1" contract_id = "ctr_XXX" policyset_id = akamai_imaging_policy_set.policyset.id activate_on_production = true json = file("policy1.json") }`
policy1.json:
{ "breakpoints": { "widths": [ 400, 650, 850, 1010 ] }, "output": { "adaptiveQuality": 50 } }