如何轻松扩展由第三方编写的Terraform模块?

时间:2019-07-03 09:20:05

标签: terraform

这是一个为RDS事件创建sns主题的模块

module "rds_event_sns" {
  source = "../../../../common/sns/topic"
  name = "${var.lambda_filename}-rds-event"
}

这是main.tf中的common/sns/topic的内容

terraform {
  required_version = "0.11.7"
}

variable "name" {}

variable "publishers" {
  type = "list"
}


resource "aws_sns_topic" "topic_simple" {
  name = "canva-${var.queue_prefix}${var.name}"
}

我希望如何在sns主题上设置lambda_failure_feedback_role_arnlambda_failure_feedback_role_arn。资源topic_simple似乎不接受这些属性。

是否可以仅将这些属性传递给topic_simple而无需更改common/sns/topic?例如

module "rds_event_sns" {
  source = "../../../../common/sns/topic"
  name = "${var.lambda_filename}-rds-event"
  lambda_failure_feedback_role_arn: "arn:aws:iam::147857925614:role/SNSFailureFeedback"
  lambda_success_feedback_role_arn: "arn:aws:iam::147857925614:role/SNSSuccessFeedback"
}

如果不是terraform的工作原理,那么有什么好的选择?

0 个答案:

没有答案