Skip to content

Commit

Permalink
Merge pull request #3 from solutionDrive/change-assume-role-to-be-opt…
Browse files Browse the repository at this point in the history
…ional

Adds a default parameter to the 'assume_role' variable to mark it as …
  • Loading branch information
Jnoack331 authored Dec 10, 2019
2 parents d570c10 + bb61434 commit 3d2c78c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
8 changes: 8 additions & 0 deletions 00_provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
provider "aws" {
alias = "module"
region = "${var.provider_region}"
profile = "${var.profile}"
assume_role {
role_arn = "${var.assume_role_arn}"
}
}
9 changes: 0 additions & 9 deletions main.tf → 50_main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
provider "aws" {
alias = "module"
region = "${var.provider_region}"
profile = "${var.profile}"
assume_role {
role_arn = "${var.assume_role_arn}"
}
}

resource "aws_security_group" "security_group" {
provider = "aws.module"
name = "${var.name}"
Expand Down
6 changes: 5 additions & 1 deletion variables.tf → 80_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,12 @@ variable "source_security_group" {

variable "assume_role_arn" {
description = "ARN of the role to use"
default = ""
}

variable "provider_region" {}

variable "account_id" {}
variable "account_id" {
description = "Account id (deprecated | please use the 'assume_role_arn' variable)"
default = ""
}
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module "security_group_webserver" {
security_group_ingress_rules_count = 1 # This count has to equal the amount of Ports defined in <security_group_ingress_rules>
provider_region = "${var.default_region}"
account_id = "${var.oxid_dev_account_id}" # to be able to assume Roles from a specific account
# assume_role_arn = arn:aws:iam::123456789012:role/AnotherRole # Assume 'AnotherRole' to create security group
}
```

Expand Down

0 comments on commit 3d2c78c

Please sign in to comment.