def METHOD_NAME(key_arn: str) -> str:
  # An AWS key ARN is of the form
  # arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.
  key_arn_parts = key_arn.split(':')
  if len(key_arn_parts) < 6:
    raise tink.TinkError('invalid key id')
  return key_arn_parts[3]