From 5f9060d8546c7d133cffe00b0bd0280e6b985249 Mon Sep 17 00:00:00 2001 From: nitro Date: Thu, 13 Feb 2020 18:08:10 -0500 Subject: [PATCH] Use safer aws_iam_role_policy_attachment --- iam.tf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iam.tf b/iam.tf index 4b6995d..cd7ef7c 100644 --- a/iam.tf +++ b/iam.tf @@ -122,11 +122,10 @@ resource "aws_iam_policy" "network" { policy = "${data.aws_iam_policy_document.network.json}" } -resource "aws_iam_policy_attachment" "network" { +resource "aws_iam_role_policy_attachment" "network" { count = "${var.attach_vpc_config ? 1 : 0}" - name = "${var.function_name}-network" - roles = ["${aws_iam_role.lambda.name}"] + role = "${aws_iam_role.lambda.name}" policy_arn = "${aws_iam_policy.network.arn}" }