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

Commit ae88203

Browse files
authored
Merge pull request #207 from dsaidgovsg/feat--perms-boundary
Add `permissions_boundary` for created IAM role.
2 parents ab06327 + 4ab7068 commit ae88203

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

modules/consul-cluster/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ resource "aws_iam_role" "instance_role" {
216216
name_prefix = var.cluster_name
217217
assume_role_policy = data.aws_iam_policy_document.instance_role.json
218218

219+
permissions_boundary = var.iam_permissions_boundary
220+
219221
# aws_iam_instance_profile.instance_profile in this module sets create_before_destroy to true, which means
220222
# everything it depends on, including this resource, must set it as well, or you'll get cyclic dependency errors
221223
# when you try to do a terraform destroy.

modules/consul-cluster/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,12 @@ variable "iam_instance_profile_name" {
278278
default = null
279279
}
280280

281+
variable "iam_permissions_boundary" {
282+
description = "If set, restricts the created IAM role to the given permissions boundary"
283+
type = string
284+
default = null
285+
}
286+
281287
variable "protect_from_scale_in" {
282288
description = "(Optional) Allows setting instance protection. The autoscaling group will not select instances with this setting for termination during scale in events."
283289
type = bool

0 commit comments

Comments
 (0)