tencentcloud_tcr_service_account

最近更新时间:2026-01-08 15:03:22

我的收藏

描述

腾讯云容器镜像服务 TCR 服务级账号。

示例

resource "tencentcloud_tcr_service_account" "tcr_service_account" {
registry_id = tencentcloud_tcr_instance.tcr.id
name = "tcr-service-account"
permissions {
resource = tencentcloud_tcr_namespace.tcr_ns.name
actions = ["tcr:PushRepository", "tcr:PullRepository"]
}
description = "tf example for tcr custom account"
duration = 10
}

参数说明

类型
名称
数据类型
说明
必填
region
string
地域,如:ap-guangzhou,默认使用 provider 中定义的 region 也可以在 resource 中指定地域,覆盖默认设置
registry_id
string
实例 ID
name
string
服务级账号名
permissions
Schema[]
策略列表
Schema 类型详见:PermissionSchema
可选
availability_zone
string
可用区
count
int
资源数量,默认为 1 如果为 0 则不创建资源
activity_id
int
计费活动 ID,保留字段
description
string
服务级账号描述
duration
int
有效期(单位:天),从当前时间开始计算
expires_at
int
过期时间(时间戳,单位:毫秒)
disable
boolean
是否禁用服务级账号
password
string
自定义密码(不传则使用默认生成的密码,仅创建/修改时可用,读取时返回最近一次设置的密码)
生成
id
string
资源实例 ID
create_time
string
资源创建时间

数据结构

PermissionSchema

描述

策略列表。

参数说明

类型
名称
数据类型
说明
必填
resource
string
资源路径,目前仅支持 Namespace
actions
string[]
动作列表