Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Add permissions_boundary for created IAM role. #207

Merged
merged 1 commit into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions modules/consul-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ resource "aws_iam_role" "instance_role" {
name_prefix = var.cluster_name
assume_role_policy = data.aws_iam_policy_document.instance_role.json

permissions_boundary = var.iam_permissions_boundary

# aws_iam_instance_profile.instance_profile in this module sets create_before_destroy to true, which means
# everything it depends on, including this resource, must set it as well, or you'll get cyclic dependency errors
# when you try to do a terraform destroy.
Expand Down
6 changes: 6 additions & 0 deletions modules/consul-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ variable "iam_instance_profile_name" {
default = null
}

variable "iam_permissions_boundary" {
description = "If set, restricts the created IAM role to the given permissions boundary"
type = string
default = null
}

variable "protect_from_scale_in" {
description = "(Optional) Allows setting instance protection. The autoscaling group will not select instances with this setting for termination during scale in events."
type = bool
Expand Down