Перейти к основному содержимому
selectel_craas_token_v1
Последнее изменение:

selectel_craas_token_v1

к сведению

Эта инструкция — копия документации Selectel Terraform-провайдера в Terraform Registry.

Creates and manages tokens in Container Registry using public API v1. For more information about Container Registry, see the official Selectel documentation.

Basic usage example

resource "selectel_craas_token_v1" "token_1" {
project_id = selectel_vpc_project_v2.project_1.id
}

Docker CLI login example

resource "selectel_craas_token_v1" "token_1" {
project_id = selectel_vpc_project_v2.project_1.id
}

output "registry_username" {
value = selectel_craas_token_v1.token_1.username
sensitive = true
}

output "registry_token" {
value = selectel_craas_token_v1.token_1.token
sensitive = true
}
REGISTRY_USERNAME=$(terraform output -raw registry_username)
REGISTRY_TOKEN=$(terraform output -raw registry_token)
echo $REGISTRY_TOKEN | docker login cr.selcloud.ru --username $REGISTRY_USERNAME --password-stdin

Argument Reference

  • project_id — (Required) Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel_vpc_project_v2 resource. Learn more about Projects.

  • token_ttl — (Optional) Token lifetime. Changing this creates a new token. Available values are 1y for a year and 12h for 12 hours. The default value is 1y.

Attributes Reference

  • username — (Sensitive) Username to access Container Registry.

  • token — (Sensitive) Token to access Container Registry.