Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Use safer aws_iam_role_policy_attachment #62

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,10 @@ resource "aws_iam_policy" "network" {
policy = data.aws_iam_policy_document.network[0].json
}

resource "aws_iam_policy_attachment" "network" {
resource "aws_iam_role_policy_attachment" "network" {
count = var.vpc_config == null ? 0 : 1

name = "${var.function_name}-network"
roles = [aws_iam_role.lambda.name]
role = aws_iam_role.lambda.name
policy_arn = aws_iam_policy.network[0].arn
}

Expand Down