简体   繁体   English

我们可以通过 terraform 为 AWS Step Functions 启用 Cloudwatch 日志吗

[英]Can we enable Cloudwatch logs for AWS Step Functions via terraform

Can we enable logging in Cloudwatch for a AWS Step Function created via terraform to track individual states?我们能否为通过 terraform 创建的 AWS Step Function 启用 Cloudwatch 日志记录以跟踪各个状态? The resource "aws_sfn_state_machine" available in terraform does not seem to provide any argument to configure Cloudwatch logging. terraform 中可用的资源“aws_sfn_state_machine”似乎没有提供任何配置 Cloudwatch 日志记录的参数。 As per documentation only below arguments are supported:根据文档,仅支持以下 arguments:

name,definition,role_arn,tags名称、定义、role_arn、标签

or can we configure inside the state machine definition?或者我们可以在 state 机器定义中配置吗?

Yes, there is a property called logging_configuration : https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sfn_state_machine .是的,有一个名为logging_configuration的属性: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sfn_state_machine It was not possible before, but it was added in the AWS terraform provider >3.x, I don't remember the specific minor version it was added to so just make sure you have the latest version.以前是不可能的,但是在 AWS terraform provider >3.x 中添加的,我不记得它添加到的具体次要版本所以只要确保你有最新版本即可。 Remember to also add the necessary permissions to your step function IAM role.请记住还要向您的步骤 function IAM 角色添加必要的权限。

Can we enable logging in Cloudwatch for a AWS Step Function created via terraform to track individual states?我们是否可以为通过Terraform创建的用于跟踪单个状态的AWS Step Function启用Cloudwatch登录功能? The resource "aws_sfn_state_machine" available in terraform does not seem to provide any argument to configure Cloudwatch logging. terraform中可用的资源“ aws_sfn_state_machine”似乎没有提供任何参数来配置Cloudwatch日志记录。 As per documentation only below arguments are supported :根据文档,仅支持以下参数:

name,definition,role_arn,tags名称,定义,role_arn,标签

or can we configure inside the state machine definition?还是可以在状态机定义中进行配置?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM