Robert Phamle
01/20/2024, 12:26 AMError: Error creating work pool
with module.prefect2_ci_square.prefect_work_pool.example_work_pool,
on ../modules/prefect2_ci/main.tf line 14, in resource "prefect_work_pool" "example_work_pool":
14: resource "prefect_work_pool" "example_work_pool" {
Could not create work pool, unexpected error: http error: Post
"<https://api.prefect.cloud/api/accounts/><my account id>/workspaces/<my workspace id>/work_pools/":
Forbidden
Marvin
01/20/2024, 12:26 AM<https://api.prefect.cloud/api/accounts/><my account id>/workspaces/<my workspace id>/work_pools/
). Please verify that your Terraform Prefect provider configuration references the correct API URL, account ID, and workspace ID.
3. Terraform Version: Check if your Terraform version is compatible with the Prefect provider you're using. Updating to the latest version might resolve some compatibility issues.
4. Provider Configuration: Double-check your 'provider "prefect"' resource configuration. A typo or invalid value in the configuration could cause this issue.
5. Authentication: Make sure that your environment is configured correctly with the required credentials and that the API key is valid and hasn't been revoked.
If none of these steps solve the issue, consider reaching out to Prefect's support or community for more tailored assistance, as the problem may be specific to your configuration or account setup, or something might be wrong on Prefect's end.Robert Phamle
01/20/2024, 12:29 AMMarvin
01/20/2024, 12:29 AM$ prefect config set PREFECT_API_URL="<https://api.prefect.cloud/api/accounts/[ACCOUNT-ID]/workspaces/[WORKSPACE-ID]>"
$ prefect config set PREFECT_API_KEY="[API-KEY]"
Ensure that you replace [ACCOUNT-ID]
, [WORKSPACE-ID]
, and [API-KEY]
with your actual account ID, workspace ID, and the API key you generated.
2. Manage API Keys in Prefect Cloud:
- To create an API key, you should navigate to the Prefect Cloud UI.
- Select the account icon at the bottom-left corner.
- Choose "API Keys", where you can view a list of previously generated keys and have the option to create new ones.
For more detailed information, you can refer to Prefect Cloud's Connecting guide and the Manage Prefect Cloud API Keys documentation.
Remember that API keys must be kept secure and should not be hardcoded in your configurations or codebase. Environment variables or secrets management solutions are recommended for storing sensitive data like API keys.