-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module "iam_role_with_managed_policies" { | ||
source = "github.com/dsreehas/terraform-iam-role" | ||
role_name = var.role_name | ||
assume_role_policy = file("./policies/assume_role_policy.json") | ||
managed_policy_arns = var.managed_policy_arns | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
output "iam_role_with_managed_policies_arn" { | ||
description = "The Amazon Resource Name (ARN) specifying the IAM role with managed policies" | ||
value = module.iam_role_with_managed_policies.iam_role_arn | ||
} | ||
|
||
output "iam_role_with_managed_policies_name" { | ||
description = "The name of the IAM role with managed policies" | ||
value = module.iam_role_with_managed_policies.iam_role_name | ||
} | ||
|
||
output "iam_role_with_managed_policies_assume_role_policy" { | ||
description = "The IAM assume role policy associated with the role with managed policies" | ||
value = module.iam_role_with_managed_policies.iam_role_assume_role_policy | ||
} | ||
|
||
output "iam_role_with_managed_policies_managed_policy_arns" { | ||
description = "The managed policy ARNs attached to the IAM role with managed policies" | ||
value = module.iam_role_with_managed_policies.iam_role_managed_policy_arns | ||
} |
12 changes: 12 additions & 0 deletions
12
examples/eks-role/aws-managed/eks-service-role/policies/assume_role_policy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "eks.amazonaws.com" | ||
}, | ||
"Action": "sts:AssumeRole" | ||
} | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
examples/eks-role/aws-managed/eks-service-role/providers.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 3.0.0" | ||
} | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = var.aws_region | ||
profile = var.aws_profile | ||
} |
23 changes: 23 additions & 0 deletions
23
examples/eks-role/aws-managed/eks-service-role/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
variable "aws_region" { | ||
description = "Selected AWS region" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "aws_profile" { | ||
description = "Selected AWS profile" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "role_name" { | ||
description = "Name of the IAM role" | ||
type = string | ||
default = "multiple-managed-policies-role" | ||
} | ||
|
||
variable "managed_policy_arns" { | ||
description = "List of managed policies ARNs to attach" | ||
type = list(string) | ||
default = ["arn:aws:iam::aws:policy/AmazonEKSClusterPolicy", "arn:aws:iam::aws:policy/AmazonEKSVPCResourceController"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
terraform { | ||
required_version = ">= 0.13" | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module "iam_role_with_managed_policies" { | ||
source = "github.com/dsreehas/terraform-iam-role" | ||
role_name = var.role_name | ||
assume_role_policy = file("./policies/assume_role_policy.json") | ||
managed_policy_arns = var.managed_policy_arns | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
examples/eks-role/aws-managed/eks-worker-node-role/outputs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
output "iam_role_with_managed_policies_arn" { | ||
description = "The Amazon Resource Name (ARN) specifying the IAM role with managed policies" | ||
value = module.iam_role_with_managed_policies.iam_role_arn | ||
} | ||
|
||
output "iam_role_with_managed_policies_name" { | ||
description = "The name of the IAM role with managed policies" | ||
value = module.iam_role_with_managed_policies.iam_role_name | ||
} | ||
|
||
output "iam_role_with_managed_policies_assume_role_policy" { | ||
description = "The IAM assume role policy associated with the role with managed policies" | ||
value = module.iam_role_with_managed_policies.iam_role_assume_role_policy | ||
} | ||
|
||
output "iam_role_with_managed_policies_managed_policy_arns" { | ||
description = "The managed policy ARNs attached to the IAM role with managed policies" | ||
value = module.iam_role_with_managed_policies.iam_role_managed_policy_arns | ||
} |
12 changes: 12 additions & 0 deletions
12
examples/eks-role/aws-managed/eks-worker-node-role/policies/assume_role_policy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "ec2.amazonaws.com" | ||
}, | ||
"Action": "sts:AssumeRole" | ||
} | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
examples/eks-role/aws-managed/eks-worker-node-role/providers.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 3.0.0" | ||
} | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = var.aws_region | ||
profile = var.aws_profile | ||
} |
23 changes: 23 additions & 0 deletions
23
examples/eks-role/aws-managed/eks-worker-node-role/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
variable "aws_region" { | ||
description = "Selected AWS region" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "aws_profile" { | ||
description = "Selected AWS profile" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "role_name" { | ||
description = "Name of the IAM role" | ||
type = string | ||
default = "multiple-managed-policies-role" | ||
} | ||
|
||
variable "managed_policy_arns" { | ||
description = "List of managed policies ARNs to attach" | ||
type = list(string) | ||
default = ["arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy", "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy", "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"] | ||
} |
3 changes: 3 additions & 0 deletions
3
examples/eks-role/aws-managed/eks-worker-node-role/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
terraform { | ||
required_version = ">= 0.13" | ||
} |