tencentcloud_tat_command

最近更新时间:2025-09-04 14:56:13

我的收藏

描述

腾讯云自动化助手(TencentCloud Automation Tools,TAT),产品介绍

示例

resource "tencentcloud_tat_command" "example" {
username = "root"
command_name = "tf-example"
content = <<EOF
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "Please run this script as the root user." >&2
exit 1
fi
ps aux
EOF
description = "Terraform demo."
command_type = "SHELL"
working_directory = "/root"
timeout = 50
}

参数说明

类型
名称
数据类型
说明
必填
region
string
地域,如:ap-guangzhou,默认使用 provider 中定义的 region 也可以在 resource 中指定地域,覆盖默认设置
content
string
命令内容,最大长度为65536个字符
可选
availability_zone
string
可用区
count
int
资源数量,默认为 1 如果为 0 则不创建资源
activity_id
int
计费活动 ID,保留字段
command_name
string
实例名称,由服务统一生成
description
string
命令描述,最大长度为120个字符
command_type
enum
命令类型,支持 SHELLPOWERSHELLBAT,默认值为 SHELL
枚举值:
SHELL:Shell 脚本命令
POWERSHELL:PowerShell 命令
BAT:BAT 命令
working_directory
string
命令执行路径,默认值为 /rootC:/Program Files/qcloudtat_agent/workdir
timeout
int
命令超时时间,单位秒,取值范围为 [1, 86400],默认值为60
enable_parameter
boolean
是否启用自定义参数功能,创建后不可修改,默认值为 false
default_parameters
string
自定义参数功能时的默认参数值,格式为 JSON 字符串
示例:{"varA": "222"}
限制条件:
最多支持20个参数
参数名称不能超过64个字符,且名称只能包含字母(大小写)、数字、下划线和中划线
username
string
在 CVM 或 Lighthouse 实例上执行命令的用户名
tags
Schema[]
资源标签
Schema 类型详见:TatTagSchema
output_cos_bucket_url
string
上传日志的 COS 存储桶 URL,必须以 https 开头,例如 https://BucketName-123454321.cos.ap-beijing.myqcloud.com
output_cos_key_prefix
string
日志保存的 COS 存储桶目录
限制条件:
必须由数字、字母和可见字符组成,最多允许60个字符
使用斜杠(/)创建子目录
不允许连续的点(.)或斜杠(/),且不能以斜杠(/)开头
生成
id
string
资源实例 ID
created_time
string
资源创建时间
updated_time
string
资源更新时间
formatted_description
string
命令的格式化描述
对于用户命令,此参数为空字符串;对于公共命令,此参数包含值
created_by
string
命令创建者,TAT 表示公共命令,USER 表示个人命令

数据结构

TatTagSchema

参数说明

类型
名称
数据类型
说明
必填
key
string
标签 key
value
string
标签值