Skip to content

Commit

Permalink
Fix old token not deleted after update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Tom committed Oct 17, 2023
1 parent ccdc3e8 commit d842dc6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aws-lambda/src/databricks_cdk/resources/tokens/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def create_or_update_token(properties: TokenProperties, physical_resource_id: Op
if update_token or existing_token is None:
logger.info("Creating new token")
new_token = _create_token(url, properties.comment, properties.lifetime_seconds)
# delete old token if it exists
if existing_token:
_delete_token(token_url=url, token_id=token_id)

token_id = new_token["token_info"]["token_id"]
token_value = new_token["token_value"]
Expand Down

0 comments on commit d842dc6

Please sign in to comment.