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

Commit 8f6bd85

Browse files
authored
Merge pull request #51 from dgrizzanti/instance_role_options
Instance role options
2 parents 33a378c + 429023c commit 8f6bd85

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

examples/couchbase-ami/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ The Packer template in this example folder can build not only AMIs, but also Doc
9393
convenient for testing out the various scripts in the `modules` folder without having to wait for an AMI to build and
9494
a bunch of EC2 Instances to boot up. See the [local-mocks
9595
folder](https://github.com/gruntwork-io/terraform-aws-couchbase/tree/master/modules/install-couchbase-server) for
96-
instructions.
96+
instructions.

modules/couchbase-cluster/main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,10 @@ resource "aws_iam_instance_profile" "instance_profile" {
165165
}
166166

167167
resource "aws_iam_role" "instance_role" {
168-
name_prefix = var.cluster_name
169-
assume_role_policy = data.aws_iam_policy_document.instance_role.json
168+
name_prefix = var.cluster_name
169+
assume_role_policy = data.aws_iam_policy_document.instance_role.json
170+
path = var.instance_role_path
171+
permissions_boundary = var.instance_permissions_boundary
170172

171173
# aws_iam_instance_profile.instance_profile in this module sets create_before_destroy to true, which means
172174
# everything it depends on, including this resource, must set it as well, or you'll get cyclic dependency errors

modules/couchbase-cluster/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,18 @@ variable "instance_profile_path" {
164164
default = "/"
165165
}
166166

167+
variable "instance_role_path" {
168+
description = "Path in which to create the IAM instance role."
169+
type = string
170+
default = "/"
171+
}
172+
173+
variable "instance_permissions_boundary" {
174+
description = "The ARN of the policy that is used to set the permissions boundary for the instance profile role"
175+
type = string
176+
default = null
177+
}
178+
167179
variable "ssh_port" {
168180
description = "The port used for SSH connections"
169181
type = number

0 commit comments

Comments
 (0)