通过在EC2上运行的PowerShells脚本来访问Terraform用户数据变量

发布于 2025-02-04 06:47:45 字数 408 浏览 2 评论 0原文

我正在努力在Windows AWS EC2上自动化一些软件安装。我作为开发环境和产品环境的基础设施。因此,为了处理我试图通过用户数据的一些变量:

data "template_file" "template_name" {

  template = file("user-data/user-data-software.ps1")

  vars = {
    aws_region = var.region
    bucket_key = module.s3_access_key.bucket_id
    bucket_sim_files = module.s3_sim_files.bucket_id
  }
}

我的问题是我无法访问这些变量,然后我无法通过“ args”或使用param。

你们曾经遇到过吗?

I'm working on automating some software installation on Windows AWS EC2. My infrastructure as a dev environment and a prod environment. So to handle that i'm trying to pass through user data some variables :

data "template_file" "template_name" {

  template = file("user-data/user-data-software.ps1")

  vars = {
    aws_region = var.region
    bucket_key = module.s3_access_key.bucket_id
    bucket_sim_files = module.s3_sim_files.bucket_id
  }
}

My issue is that I'm not able to access these variables, I couldn't get then through 'args' or with param.

Do you guys ever encounter this?

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

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

发布评论

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