Before you begin, you must create a provider configuration that allows Terraform to interact with the resources and data sources. The provider configuration should be placed in the root module of the Terraform configuration.
main.tf:terraform {
required_providers {
bluecat = {
version = "2.0.2"
source = "bluecatlabs/bluecat"
}
}
}
provider "bluecat" {
server = "127.0.0.1"
api_version = "1"
transport = "http"
port = "80"
username = "api_user"
password = "api_password"
encrypt_password = "false"
}Where the fields represent the following:
server: the IP address of the BlueCat REST API image.api_version: the version of the REST API.transport: the protocol used to access the REST API.port: the port used to access the REST API.username: the username of the API user with the correct permissions to access the REST API.encrypt_password(optional): True or false option to use an encrypted password in thepasswordfield.password: Ifencrypt_passwordis set to false or not set, the password of the API users with the correct permissions to access the REST API. Ifencrypt_passwordis set to true, the filename of the encrypted password as created in BlueCat Gateway.Example:
To encrypt the password, log into Gateway and navigate to Administration > Encrypt Password.encrypt_password = "true" password = ".encrypted_password"After this is complete, you can use thePath: customizations/.encrypted_passwordPassword: user_password_here.encrypted_passwordvalue in the BlueCat Provider password field.
Once you have created the provider configuration, you can access the BlueCat resources and data sources.