Terraform depends_on with modules

后端 未结 2 1227
野的像风
野的像风 2021-02-04 13:40

I\'m new at terraform and I created a custom azure policies on module structure. each policy represents a custom module. One of the modules that I have created is enabling diag

2条回答
  •  情书的邮戳
    2021-02-04 14:42

    module dependencies are now supported in Terraform 13, this is currently at the release candidate stage.

    resource "aws_iam_policy_attachment" "example" {
      name       = "example"
      roles      = [aws_iam_role.example.name]
      policy_arn = aws_iam_policy.example.arn
    }
    
    module "uses-role" {
      # ...
    
      depends_on = [aws_iam_policy_attachment.example]
    }
    

提交回复
热议问题