ฉันกำลังติดตามคำตอบใน สิ่งนี้ คำถาม ฉันพยายามเปิดใช้งานการเอ็กซเรย์แล้วได้ผล รหัสที่ฉันใช้:
resource "null_resource" "enable_step_function_logging" {
triggers = {
state_machine_arn = aws_sfn_state_machine.sfn_state_machine.arn
}
provisioner "local-exec" {
command = "aws stepfunctions update-state-machine --state-machine-arn ${self.triggers.state_machine_arn} --tracing-configuration enabled=true"
}
}
ตอนนี้ฉันต้องการเปิดใช้งานส่วนการบันทึก cloudwatch ' --logging-configuration=xxx' แต่ฉันยังคงได้รับข้อผิดพลาด นี่คือสิ่งที่ฉันได้ลอง:
resource "null_resource" "enable_step_function_logging" {
triggers = {
state_machine_arn = aws_sfn_state_machine.sfn_state_machine.arn
logs_params = <<PARAMS
{
"level":"ALL",
"includeExecutionData":true,
"destinations":[
{
"cloudWatchLogsLogGroup":{
"logGroupArn":"${aws_cloudwatch_log_group.sfn_cloudwatch_log_group.arn}:*"
}
}
]
}
PARAMS
}
provisioner "local-exec" {
command = "aws stepfunctions update-state-machine --state-machine-arn ${self.triggers.state_machine_arn} --tracing-configuration enabled=true --logging-configuration='${self.triggers.logs_params}'"
}
}
จากนั้นเมื่อฉันสมัครใน Terraform มันทำให้ฉันมีข้อผิดพลาด:
Error: Error running command 'aws stepfunctions update-state-machine --state-machine-arn arn:aws:states:us-east-1:xxxxxxxxx:stateMachine:xxxxxxxxstate-machine --tracing-configuration enabled=true --logging-configuration=' {
"level":"ALL",
"includeExecutionData":true,
"destinations":[
{
"cloudWatchLogsLogGroup":{
"logGroupArn":"arn:aws:logs:us-east-1:xxx:log-group:/aws/vendedlogs/states/xxxxxxx-Logs:*"
}
}
]
}
'': exit status 252. Output:
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
Unknown options: {
มันบ่นว่าคำสั่ง aws มีรูปแบบที่ไม่ถูกต้อง ฉันไม่พบตัวอย่างออนไลน์ ใครสามารถช่วยได้บ้าง