【问题标题】:how to use terragrunt as pre-processor and generate terraform files如何使用 terragrunt 作为预处理器并生成 terraform 文件
【发布时间】:2021-05-21 17:27:54
【问题描述】:

是否可以使用 terragrunt 作为预处理器以供 terraform 稍后使用,有人可以分享一下这方面的想法吗?谢谢!

【问题讨论】:

    标签: terraform terragrunt


    【解决方案1】:

    可能会帮助别人;通过使用欺骗 terraform 调用 terragrunt 来解决它

    $cat tfspoof
    #! /bin/bash
    #
    # Filename    : tfspoof
    # Date        : 21 May 2021
    # Author      : Balaji Venkataraman (xbalaji)
    # Description : terragrunt demo - terraform spoof executable
    # Usage       :
    #
    
    [[ "$1" == "--version" ]] && version=$(terraform --version) && echo "$version" && exit 0
    echo "other commands passed: " $*
    

    使用 tf 选项调用 terragrunt

    terragrunt plan --terragrunt-tfpath ./tfspoof
    

    terragrunt 现在无需实际调用terraform 即可生成文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-08-10
      • 2015-01-03
      • 1970-01-01
      • 1970-01-01
      • 2018-01-03
      • 1970-01-01
      相关资源
      最近更新 更多