Skip to content

Commit

Permalink
Bump iam_role and iam_policy modules (#19)
Browse files Browse the repository at this point in the history
* Bump iam_role and iam_policy modules

* Auto Format

* Update README to reflect changes to IAM policy

* Auto Format

Co-authored-by: cloudpossebot <[email protected]>
  • Loading branch information
nitrocode and cloudpossebot authored Dec 22, 2021
1 parent b38d98f commit abe5f59
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 25 deletions.
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,30 +122,33 @@ module "helm_release" {
# values = [
# ]
# Enable the IAM role
iam_role_enabled = true
# Add the IAM role using set()
service_account_role_arn_annotation_enabled = true
# Dictates which ServiceAccounts are allowed to assume the IAM Role.
# In this case, only the "echo" ServiceAccount in the "echo" namespace
# will be able to assume the IAM Role created by this module.
service_account_name = "echo"
service_account_namespace = "echo"
iam_role_enabled = true
iam_policy_statements = [
{
sid = "ListMyBucket"
# IAM policy statements to add to the IAM role
iam_policy_statements = {
ListMyBucket = {
effect = "Allow"
actions = ["s3:ListBucket"]
resources = ["arn:aws:s3:::test"]
conditions = []
},
{
sid = "WriteMyBucket"
WriteMyBucket = {
effect = "Allow"
actions = ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"]
resources = ["arn:aws:s3:::test/*"]
conditions = []
},
]
}
}
```

Expand All @@ -167,7 +170,10 @@ module "helm_release" {
service_account_namespace = "echo"
iam_role_enabled = true
...
service_account_role_arn_annotation_enabled = true
# ...
}
```

Expand Down Expand Up @@ -214,8 +220,8 @@ Available targets:

| Name | Source | Version |
|------|--------|---------|
| <a name="module_eks_iam_policy"></a> [eks\_iam\_policy](#module\_eks\_iam\_policy) | cloudposse/iam-policy/aws | 0.2.3 |
| <a name="module_eks_iam_role"></a> [eks\_iam\_role](#module\_eks\_iam\_role) | cloudposse/eks-iam-role/aws | 0.10.3 |
| <a name="module_eks_iam_policy"></a> [eks\_iam\_policy](#module\_eks\_iam\_policy) | cloudposse/iam-policy/aws | 0.3.0 |
| <a name="module_eks_iam_role"></a> [eks\_iam\_role](#module\_eks\_iam\_role) | cloudposse/eks-iam-role/aws | 0.11.0 |
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |

## Resources
Expand Down
24 changes: 15 additions & 9 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,30 +91,33 @@ usage: |-
# values = [
# ]
# Enable the IAM role
iam_role_enabled = true
# Add the IAM role using set()
service_account_role_arn_annotation_enabled = true
# Dictates which ServiceAccounts are allowed to assume the IAM Role.
# In this case, only the "echo" ServiceAccount in the "echo" namespace
# will be able to assume the IAM Role created by this module.
service_account_name = "echo"
service_account_namespace = "echo"
iam_role_enabled = true
iam_policy_statements = [
{
sid = "ListMyBucket"
# IAM policy statements to add to the IAM role
iam_policy_statements = {
ListMyBucket = {
effect = "Allow"
actions = ["s3:ListBucket"]
resources = ["arn:aws:s3:::test"]
conditions = []
},
{
sid = "WriteMyBucket"
WriteMyBucket = {
effect = "Allow"
actions = ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"]
resources = ["arn:aws:s3:::test/*"]
conditions = []
},
]
}
}
```
Expand All @@ -136,7 +139,10 @@ usage: |-
service_account_namespace = "echo"
iam_role_enabled = true
...
service_account_role_arn_annotation_enabled = true
# ...
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

| Name | Source | Version |
|------|--------|---------|
| <a name="module_eks_iam_policy"></a> [eks\_iam\_policy](#module\_eks\_iam\_policy) | cloudposse/iam-policy/aws | 0.2.3 |
| <a name="module_eks_iam_role"></a> [eks\_iam\_role](#module\_eks\_iam\_role) | cloudposse/eks-iam-role/aws | 0.10.3 |
| <a name="module_eks_iam_policy"></a> [eks\_iam\_policy](#module\_eks\_iam\_policy) | cloudposse/iam-policy/aws | 0.3.0 |
| <a name="module_eks_iam_role"></a> [eks\_iam\_role](#module\_eks\_iam\_role) | cloudposse/eks-iam-role/aws | 0.11.0 |
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |

## Resources
Expand Down
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ locals {

module "eks_iam_policy" {
source = "cloudposse/iam-policy/aws"
version = "0.2.3"
version = "0.3.0"

enabled = local.iam_role_enabled

Expand All @@ -18,12 +18,12 @@ module "eks_iam_policy" {

module "eks_iam_role" {
source = "cloudposse/eks-iam-role/aws"
version = "0.10.3"
version = "0.11.0"

enabled = local.iam_role_enabled

aws_account_number = var.aws_account_number
aws_iam_policy_document = local.iam_role_enabled ? module.eks_iam_policy.json : "{}"
aws_iam_policy_document = local.iam_role_enabled ? [module.eks_iam_policy.json] : ["{}"]
aws_partition = var.aws_partition
eks_cluster_oidc_issuer_url = var.eks_cluster_oidc_issuer_url
service_account_name = var.service_account_name
Expand Down

0 comments on commit abe5f59

Please sign in to comment.