Anything you do in the console you can also do from scripts, Terraform or the command line. Those tools sign in with an Application Credential, not your password: an ID and a secret that stand in for your login, can be limited and given an end date, and can be deleted without touching your account.
Create one
- In the console, open your account menu at the top right, choose User Center, then Application Credentials.
- Click Create Application Credentials and fill in:
- Name: a clear label, for example
terraform-ci. - Expires At (optional): the date it stops working.
- Roles (optional): leave empty to give it the same access you have, or tick only the roles it needs.
- Restriction: leave Unrestricted off. Only a tool that must create other credentials needs it.
- Description (optional).
- Name: a clear label, for example
- Confirm. Your browser downloads a file named after the credential, for example
terraform-ci.json, with itsidandsecret. The secret is in that file only and cannot be shown again, so keep the file safe.
Use it
Standard command-line and Terraform tools that speak the Gewape Cloud API read the credential from a file named clouds.yaml. Save this as clouds.yaml in the folder you run your tools from, with the id and secret from the downloaded file:
clouds:
gewape:
auth_type: v3applicationcredential
auth:
auth_url: "https://api.nbo.gewapecloud.com:5000/v3"
application_credential_id: "<id>"
application_credential_secret: "<secret>"
region_name: "RegionOne"
interface: public
To check that it works, install the command-line tool and list your servers:
pip install python-openstackclient
openstack --os-cloud gewape server list
Terraform, SDKs and the sign-in address and region name for each region are in the developer documentation at developers.gewape.cloud.
Keep it safe
Treat the secret like a password: store it in a secrets manager, never commit it to code, and replace it from time to time. If one ever leaks, delete it under Application Credentials and create a new one.