Closed mattboschatliveoak closed 2 years ago
What version of Apigee are you using? The difficulty with this provider is that there are 3 versions of Apigee, each with slightly different REST APIs. Therefore, the provider has to tweak its REST API calls to match the version of Apigee it is taking to.
I don’t have access to all three versions so I can’t test very well. And when I say version, I don’t mean a number. I am referring to this page: https://registry.terraform.io/providers/scastria/apigee/latest/docs
I am running Apigee on Google Cloud (ApigeeX). This is the API call and result for getting a specific target server:
curl -s -H "Authorization: Bearer $TOKEN" -X GET "https://apigee.googleapis.com/v1/organizations/<org>/environments/<env>/targetservers/tftest"
{
"name": "tftest",
"host": "auth.company.com",
"port": 443,
"isEnabled": true,
"sSLInfo": {
"enabled": true
},
"protocol": "HTTP"
}
Hi @scastria , Even i'm facing the same issue. Could you please help us in getting this issue resolved.
@scastria issue looks like when apigee sends a response about targetserver details on ssl enabled is a boolean value. But in the go template that is being used for terraform it is expecting a string. Can you please debug the issue and make possible changes on this side to fix the issue.
@mattboschatliveoak, Please let me know if you have fixed this issue already. Please do provide the steps regarding what you have done to fix it. This is blocking our CICD pipeline implementation for Apigee. Any help would be really great.
@scastria for fixing this issue should we consider changing the https://github.com/scastria/terraform-provider-apigee/blob/main/apigee/client/ssl_info.go#L4 field to bool? Please share your thoughts.
Sure, but only for your Apigee version. I still need it to be a string for my version. I have done this type of selective change in other resource types so shouldn’t be a problem.
@scastria thanks for the response. How to change the field type to bool for a particular version. I'm not very sure on that. Could you please mention the steps for this.
@scastria please help fixing this issue. As we are not able to deploy SSL enabled targetservers to Apigee X using this terraform provider.
Try version v0.1.47 when it is done building. I don't have access to a Google server for Apigee X so I cannot test. I did test that it doesn't break my old OPDK Apigee server. I also noticed there was a difference between string and boolean for clientAuthEnabled so I fixed that too.
Above version fixed the issue. Thanks @scastria.
@scastria thanks for providing this apigee provider! I started testing the creation of apigee resources, but have run into an issue with the target server resource.
Following the successful creation of a target server with the following config:
Subsequent executions of terraform apply result with the following error: