我如何将动态动作传递给AWS胶合触发Terraform中的资源?

发布于 2025-01-27 19:23:29 字数 625 浏览 3 评论 0原文

我正在尝试在Terraform中创建一个触发器,该触发器将运行具有几组不同参数的胶合作业。这些参数之一是基于任意数量的JSON字典。

问题是,当我尝试使用动态块进行触发操作的动态块时,我会收到以下错误:

错误:动作不足
至少需要1个“动作”块。

据推测,因为AWS_GLUE_TRIGGER资源要求有一个动作块并使此动态阻止计划识别它吗? 这就是我的资源块的样子:

resource "aws_glue_trigger" "api_ingestion" {
  name     = "some trigger"
  enabled  = local.is_live_environment

  dynamic "actions" {
    for_each = fileset(path.module, "../queries/*.json")
    content {
      job_name = module.api_ingestion_job.job_name
      arguments = {
        "--json"      = file(actions.value)
      }
    }
  }
}

感谢您的任何帮助!

I'm trying to create a trigger in Terraform that will run a glue job with several different sets of parameters. One of those parameters is based on an arbitrary number of json dictionaries.

The problem is when I try to do this with a dynamic block for the actions in the trigger I get the following error:

Error: Insufficient actions blocks
At least 1 "actions" blocks are required.

Presumably, because the aws_glue_trigger resource requires there to be an actions block and making this dynamic prevents the plan from recognising it as such?
This is what my resource block looks like:

resource "aws_glue_trigger" "api_ingestion" {
  name     = "some trigger"
  enabled  = local.is_live_environment

  dynamic "actions" {
    for_each = fileset(path.module, "../queries/*.json")
    content {
      job_name = module.api_ingestion_job.job_name
      arguments = {
        "--json"      = file(actions.value)
      }
    }
  }
}

Thanks for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文