From a79f1ad45332db777159465943e5ca4cfca18977 Mon Sep 17 00:00:00 2001 From: Vishal Sawale Date: Thu, 5 Sep 2024 14:45:46 +0530 Subject: [PATCH] docs: Remove the bearer token reference from README docs --- .env.example | 1 - DEVELOPMENT.md | 11 +++-------- README.md | 18 ++---------------- TESTING.md | 2 +- docs/index.md | 7 ++----- examples/provider/provider.tf | 5 ----- templates/index.md.tmpl | 2 +- 7 files changed, 9 insertions(+), 37 deletions(-) diff --git a/.env.example b/.env.example index 81f49122..831fdfe6 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,4 @@ BA_API_URI= -BA_BEARER_TOKEN= EDB_TF_ACCESS_KEY= ############################# diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index a1d31e9a..38e39573 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -2,10 +2,6 @@ Please make sure to read the [Contributing guideline](./CONTRIBUTING.md) first. -## How to manage the BigAnimal Bearer Token? - -As described in the [Readme](./README.md#getting-an-api-token) file, you can use the `get-token.sh` script to fetch a Bearer Token. - Another common practice is using the [Biganimal CLI](https://cli.biganimal.com/). ### Using BA CLI to help initializing Provider credentials @@ -35,18 +31,17 @@ export_BA_env_vars () { biganimal credential reset $cred_name fi biganimal cluster show -c $cred_name >&/dev/null - export BA_BEARER_TOKEN=$(biganimal credential show -o json| jq -r --arg CREDNAME "$cred_name" '.[]|select(.name==$CREDNAME).accessToken') export BA_API_URI="https://"$(biganimal credential show -o json | jq -r --arg CREDNAME "$cred_name" '.[]|select(.name==$CREDNAME).address')/api/v3 export BA_CRED_NAME="$cred_name" - echo "$cred_name BA_BEARER_TOKEN and BA_API_URI are exported." + echo "$cred_name BA_API_URI is exported." export TF_VAR_project_id="prj_$(ba_get_default_proj_id)" echo "TF_VAR_project_id terraform variable is also exported. Value is $TF_VAR_project_id" } ``` -4. Now, you can use `export_BA_env_vars` command to manage your BA_BEARER_TOKEN and BA_API_URI environment variables, as well as TF_VAR_project_id terraform environment variable. +4. Now, you can use `export_BA_env_vars` command to manage your BA_API_URI environment variable, as well as TF_VAR_project_id terraform environment variable. ```console $> export_BA_env_vars ba-user1 -ba-user1 BA_BEARER_TOKEN and BA_API_URI are exported. +ba-user1 BA_API_URI is exported. TF_VAR_project_id terraform variable is also exported. Value is prj_0123456789abcdef ``` 5. If you would like to enable bash completion for the `export_BA_env_vars` command, you can add the following lines to your shellrc file: diff --git a/README.md b/README.md index 7b50ce3a..7c1d6821 100644 --- a/README.md +++ b/README.md @@ -36,31 +36,17 @@ terraform { provider "biganimal" { # Configuration options - ba_bearer_token = // See Getting an API Token section for details ba_access_key = // See Getting an Access Key section for details } ``` -You can also set the `BA_BEARER_TOKEN`, `BA_ACCESS_KEY` environment variables. When those environment variables are present, you -don't need to add any configuration options to the provider block described above. Only either `BA_BEARER_TOKEN` or `BA_ACCESS_KEY` needs to be set, if both are set then `BA_ACCESS_KEY` will take priority and be used. +You can also set the `BA_ACCESS_KEY` environment variable. When it is set as env var, you +don't need to add any configuration options to the provider block described above. ```bash -export BA_BEARER_TOKEN= export BA_ACCESS_KEY= ``` -> [!WARNING] -> OAuth2 authorization and thus `BA_BEARER_TOKEN` will be deprecated in future Terraform Provider releases. It is recommended to use `BA_ACCESS_KEY` as soon as you can. - -### Getting an API Token - -In order to access the BigAnimal API, it's necessary to fetch an api bearer token and either export it into your -environment or add this token to the provider block. - -Please -visit [Using the get-token script](https://www.enterprisedb.com/docs/biganimal/latest/reference/api/#using-the-get-token-script) -for more details. - ### Getting an Access Key You can use an access key to access the BigAnimal API. The advantage of an access key compared to an API token is that it can be set to have a long expiry date which will aide automation. diff --git a/TESTING.md b/TESTING.md index 32c9b2bf..6fde14e2 100644 --- a/TESTING.md +++ b/TESTING.md @@ -8,7 +8,7 @@ We're using [terraform-plugin-testing](https://github.com/hashicorp/terraform-pl For more information, please refer to the acceptance tests documentation. -In order to run the acceptance tests, several environment variables should be present. `BA_API_URI` and `BA_BEARER_TOKEN` to communicate with the Biganimal API. +In order to run the acceptance tests, several environment variables should be present. `BA_API_URI` to communicate with the Biganimal API. We also use the `BA_TF_ACC_VAR__` environment variables to run the acceptance tests. Example variable names can be found in the [.env.example](.env.example) file. You can run the acceptance tests with the following command: diff --git a/docs/index.md b/docs/index.md index dedca091..c99ed84b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -22,9 +22,7 @@ see [Getting started with the BigAnimal free trial.](https://www.enterprisedb.co ```terraform # Configure the BigAnimal Provider provider "biganimal" { - ba_bearer_token = "" - // ba_access_key: if set, this will be used instead of the ba_bearer_token above. - // This can also be set as an environment variable. If it is set both here and + // ba_access_key: This can also be set as an environment variable. If it is set both here and // in an environment variable then the access key set in the environment variable // will take priority and be used ba_access_key = "" @@ -34,7 +32,7 @@ provider "biganimal" { ## Environment Variables -Credentials can be provided by using the `BA_BEARER_TOKEN` or `BA_ACCESS_KEY` environment variables. +Credentials can be provided by using the `BA_ACCESS_KEY` environment variables. ## Schema @@ -42,4 +40,3 @@ Credentials can be provided by using the `BA_BEARER_TOKEN` or `BA_ACCESS_KEY` en ### Optional - `ba_access_key` (String) BigAnimal Access Key -- `ba_bearer_token` (String) BigAnimal Bearer Token diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index e0b3db4d..8940ab6c 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1,10 +1,5 @@ # Configure the BigAnimal Provider provider "biganimal" { - ba_bearer_token = "" - // ba_access_key: if set, this will be used instead of the ba_bearer_token above. - // This can also be set as an environment variable. If it is set both here and - // in an environment variable then the access key set in the environment variable - // will take priority and be used ba_access_key = "" } # Manage the resources diff --git a/templates/index.md.tmpl b/templates/index.md.tmpl index 5262faf5..bb80ed31 100644 --- a/templates/index.md.tmpl +++ b/templates/index.md.tmpl @@ -25,6 +25,6 @@ see [Getting started with the BigAnimal free trial.](https://www.enterprisedb.co ## Environment Variables -Credentials can be provided by using the `BA_BEARER_TOKEN` or `BA_ACCESS_KEY` environment variables. +Credentials can be provided by using the `BA_ACCESS_KEY` environment variables. {{ .SchemaMarkdown | trimspace }}