Once you have added the provider to your Terraform configuration, you need to configure the provider with your Pulsar Cluster service url and credentials.Below is an example of configuring the provider to connect to a Pulsar cluster at <pulsar-cluster-service-url> using Token authentication. Please make sure the token has the Super Admin permission in order to create resources within the Pulsar cluster.
You can specify the token in the provider configuration. Make sure the token has the Super Admin permission in order to create resources within the Pulsar cluster.
You can specify the OAuth2 key file path in the provider configuration. If your cluster is configured to require audience, you also need to specify the audience in the provider configuration.
After you have configured the provider in your Terraform configuration, you can run the following command to download and install the providers defined in the configuration:
Copy
Ask AI
terraform init
You can then run the following command to ensure the configuration is syntactically valid and internally consistent:
Copy
Ask AI
terraform validate
Apply the configuration:
Copy
Ask AI
terraform plan
If you are not able to connect to the Pulsar cluster, you will see an error message similar to the following:
Copy
Ask AI
Error: failed to create pulsar oauth2 provider: authentication failed using client credentials: <error-message>