私はインフラストラクチャを構築するためにモジュール式にTerraformを使用しています。私はこれを行うために、異なるモジュールを呼び出す設定ファイルを用意しています。私はインフラストラクチャ変数を渡して、アプリケーションが構築しなければならないGithubリポジトリのタグ付きバージョンを取得したいと思います。最も重要なのは、設定ファイルの "source"変数で文字列の連結を行う方法を理解しようとしていることです。私はそれをコンパイルしたソースは、このように見えるようにするためにしたいTerraform - 変数を「ソース」パラメータに渡す
module "athenaelb" {
source = "${concat("git::https://github.com/ORG/REPONAME.git?ref=",var.infra_version)}"
aws_access_key = "${var.aws_access_key}"
aws_secret_key = "${var.aws_secret_key}"
aws_region = "${var.aws_region}"
availability_zones = "${var.availability_zones}"
subnet_id = "${var.subnet_id}"
security_group = "${var.athenaelb_security_group}"
branch_name = "${var.branch_name}"
env = "${var.env}"
sns_topic = "${var.sns_topic}"
s3_bucket = "${var.elb_s3_bucket}"
athena_elb_sns_topic = "${var.athena_elb_sns_topic}"
infra_version = "${var.infra_version}"
}
(例えば):gitの:: https://github.com/ORG/REPONAME.git?ref=v1
誰もがこの作業を行う方法上の任意の考えを持っていますか?
おかげで、 ケレン
P.S.ひどい書式設定にごめんなさい...これをコードブロックbcとして送信できませんでした。Stack Overflowは書式設定について不平を言っていました... – Keren
まだサポートされていません。確認してください - https://github.com/hashicorp/terraform/issues/1439 – Baskar