Skip to content

Commit eb7c200

Browse files
committed
avoid tokens existing for longer than requried
1 parent 2e3fb3f commit eb7c200

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/opentofu-remote-state.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ per-checkout configuration is required.
143143

144144
```bash
145145
# Get current openstack project:
146-
PROJECT_ID=$(openstack token issue -f value -c project_id)
146+
TOKEN_DATA=$(openstack token issue -f json)
147+
PROJECT_ID=$(echo "$TOKEN_DATA" | jq -r '.project_id')
148+
TOKEN_ID=$(echo "$TOKEN_DATA" | jq -r '.id')
149+
openstack revoke token $TOKEN_ID
150+
147151
# Get first creds in current project:
148152
EC2_CREDS=$(openstack ec2 credentials list -f json | jq -r --arg pid "$PROJECT_ID" '.[] | select(.["Project ID"] == $pid) | @json' | head -n 1)
149153
# Set creds for OpenTofu s3 backend:

0 commit comments

Comments
 (0)