lord-kyron / terraform-provider-phpipam

Terrform provider for PHPIPAM
https://registry.terraform.io/providers/lord-kyron/phpipam/latest
Apache License 2.0
54 stars 30 forks source link

Can't access to phpipam API via terraform #32

Closed UmanGarbag closed 3 years ago

UmanGarbag commented 3 years ago

Hello , i want to use the phpipam provider for reserve ip address for my virtual machine.

I setup a API Key with a app_id and app_code from phpipam web interface, and i specify the app_id in my main.tf.

For username and password i put a account who have read/write permissions.

But when i run terraform apply ,in return i have a 404 not found.

What is the step for access to the API via terraform ?

Thank you

pavel-z1 commented 3 years ago

Hi @UmanGarbag , if you will use HTTP API calls (security = none), you need to change this option to True inside config.php website file.

$api_allow_unsafe = True;

PHPIPAM API option App security in this case should be User token

In the readme file provided example of provider config options, draw your attention to the endpoint URL, that ending with /api

provider "phpipam" {
  app_id   = "test"
  endpoint = "http://phpipam.example.com/api"
  password = "PHPIPAM_PASSWORD"
  username = "Admin"
  insecure = false
}