OpenStack: Application credentials

List application credentials

openstack application credential list

Create application credentials (with pre-formated output for clouds.yaml)

openstack application credential create foo-dev-admin \
  --role admin \
  --expiration $(date -I -d '+3 month')T23:59:59  \
  --description "Test application credentials" \
  --unrestricted \
  -c id \
  -c secret \
  -f json \
  | jq -r '"application_credential_id: \"" + .id + "\"", "application_credential_secret: \"" + .secret + "\""'

Configure clouds.yml

# ~/.config/openstack/clouds.yaml
clouds:
  dev-foo-unrestricted:
    auth_type: "v3applicationcredential"
    auth:
      auth_url: https://keystone.example.com/v3
      application_credential_id: "b9275fc5b3aadceeb407fbe941427425"
      application_credential_secret: "HqfdfKk3q63xrnIZgdkizePfv1s27aYPBTrbiMKFNdrOU1JpdjfR0KSyomS4A01vSdxjkE9MzPuM4dVG7emWuA"

Test application credentials

openstack --os-cloud=dev-foo-unrestricted image list

Delete application credentials

openstack application credential delete ${APPLICATION_CREDENTIAL_ID}

Links
https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/application-credentials.html