Sorry you’re running into these issues. At first glance, this sounds like a Personal API Key vs Admin API Key issue, or potentially a region and/or cross-account issue.
If you’ve already been through our v2 migration guide (it sounds like you have) and are still having this problem, then my immediate hunch is that the account ID and Personal API Key are in a cross-account scenario where user role/permissions might be causing an issue. We’ll want to ensure your API keys being referenced fall within the account ID being used.
If your Terraform runs only fail intermittently, then something could be going on with an upstream API, but 403s indicate a permissions issue. Are you trying to use multiple accounts in your configuration?
Generally speaking, the following bullet points have resolved this scenario for several customers.
Your Personal API Key (usually starts with
NRAK-) can now be considered your main API key. Use your Personal API Key (
NRAK-) to set the
api_key attribute in the provider configuration.
Your Admin API Key (usually starts with
NRAA-) is required to provision Synthetics resources and Infrastructure Alert Conditions resources. All other resources can be managed with your Personal API Key. Use your Admin API Key (
NRAA-) to set the
admin_api_key attribute in the provider configuration.
region attribute of the provider configuration is required and must be set to “US” or “EU”.
Use API keys that fall under associated account ID
(Note: You can use environment variables as well to set these attributes under the hood.)
If we’re still having issues after double checking all of the above, we’ll probably need to see your provider configuration (sensitive data redacted) to do some further debugging, but hopefully this helps.