terraform-provider-yandex icon indicating copy to clipboard operation
terraform-provider-yandex copied to clipboard

yandex_storage_bucket: can't provide IAM-token from provider

Open a1ndreay opened this issue 4 months ago • 0 comments

Trouble: The storage service does not accept the IAM token as authorization method Purpose: Use an IAM token instead of an SA (service account) Steps for reproduce: I'm provide a token - (Optional) Security token or IAM token used for authentication in Yandex.Cloud. into provider block:

provider "yandex" {
 cloud_id  = local.cloud_id
 folder_id = local.folder_id
 zone      = local.zone
 token     = var.IAM_TOKEN #<-- MY IAM TOKEN
}

But there's an error ocurred while no access_key and secret_key provide to storage client https://terraform-provider.yandexcloud.net/Resources/storage_bucket#argument-reference:

resource "yandex_storage_bucket" "test" {
  folder_id = data.yandex_resourcemanager_folder.students_ext_11.folder_id
  bucket = local.bucket
  #access_key = yandex_iam_service_account_static_access_key.sa-static-key.access_key
  #secret_key = yandex_iam_service_account_static_access_key.sa-static-key.secret_key
  max_size = 1048576  #<--- MAX_SIZE requires an IAM-token, not static access key! 
}
image

But as you can see above, an error occurs without specifying the static access key: " error getting storage client: failed to get default storage client". How to specify the user providing the IAM key as a client not SA?

a1ndreay avatar Oct 08 '24 15:10 a1ndreay