Skip to content

Commit bd95a46

Browse files
authored
feat: Add iam_permission_boundary to IAM role (#18)
1 parent 9478259 commit bd95a46

File tree

7 files changed

+20
-10
lines changed

7 files changed

+20
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,4 @@ All notable changes to this project will be documented in this file.
8383
[v0.4.0]: https://github.com/terraform-aws-modules/terraform-aws-appsync/compare/v0.3.0...v0.4.0
8484
[v0.3.0]: https://github.com/terraform-aws-modules/terraform-aws-appsync/compare/v0.2.0...v0.3.0
8585
[v0.2.0]: https://github.com/terraform-aws-modules/terraform-aws-appsync/compare/v0.1.0...v0.2.0
86+

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ $ terraform apply
111111

112112
| Name | Version |
113113
|------|---------|
114-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.6 |
114+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
115115
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.46 |
116116
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
117117

@@ -158,6 +158,7 @@ No modules.
158158
| <a name="input_elasticsearch_allowed_actions"></a> [elasticsearch\_allowed\_actions](#input\_elasticsearch\_allowed\_actions) | List of allowed IAM actions for datasources type AMAZON\_ELASTICSEARCH | `list(string)` | <pre>[<br> "es:ESHttpDelete",<br> "es:ESHttpHead",<br> "es:ESHttpGet",<br> "es:ESHttpPost",<br> "es:ESHttpPut"<br>]</pre> | no |
159159
| <a name="input_functions"></a> [functions](#input\_functions) | Map of functions to create | `any` | `{}` | no |
160160
| <a name="input_graphql_api_tags"></a> [graphql\_api\_tags](#input\_graphql\_api\_tags) | Map of tags to add to GraphQL API | `map(string)` | `{}` | no |
161+
| <a name="input_iam_permissions_boundary"></a> [iam\_permissions\_boundary](#input\_iam\_permissions\_boundary) | ARN for iam permissions boundary | `string` | `null` | no |
161162
| <a name="input_lambda_allowed_actions"></a> [lambda\_allowed\_actions](#input\_lambda\_allowed\_actions) | List of allowed IAM actions for datasources type AWS\_LAMBDA | `list(string)` | <pre>[<br> "lambda:invokeFunction"<br>]</pre> | no |
162163
| <a name="input_log_cloudwatch_logs_role_arn"></a> [log\_cloudwatch\_logs\_role\_arn](#input\_log\_cloudwatch\_logs\_role\_arn) | Amazon Resource Name of the service role that AWS AppSync will assume to publish to Amazon CloudWatch logs in your account. | `string` | `null` | no |
163164
| <a name="input_log_exclude_verbose_content"></a> [log\_exclude\_verbose\_content](#input\_log\_exclude\_verbose\_content) | Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level. | `bool` | `false` | no |

examples/complete/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Note that this example may create resources which cost money. Run `terraform des
2020

2121
| Name | Version |
2222
|------|---------|
23-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.6 |
23+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
2424
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.46 |
2525
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
2626

examples/complete/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.12.6"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = ">= 2.46"

iam.tf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ data "aws_iam_policy_document" "assume_role" {
6262
resource "aws_iam_role" "logs" {
6363
count = var.logging_enabled && var.create_logs_role ? 1 : 0
6464

65-
name = coalesce(var.logs_role_name, "${var.name}-logs")
66-
assume_role_policy = data.aws_iam_policy_document.assume_role.json
67-
tags = merge(var.tags, var.logs_role_tags)
65+
name = coalesce(var.logs_role_name, "${var.name}-logs")
66+
assume_role_policy = data.aws_iam_policy_document.assume_role.json
67+
permissions_boundary = var.iam_permissions_boundary
68+
69+
tags = merge(var.tags, var.logs_role_tags)
6870
}
6971

7072
resource "aws_iam_role_policy_attachment" "logs" {
@@ -78,9 +80,9 @@ resource "aws_iam_role_policy_attachment" "logs" {
7880
resource "aws_iam_role" "service_role" {
7981
for_each = local.service_roles_with_specific_policies
8082

81-
name = lookup(each.value, "service_role_name", "${each.key}-role")
82-
83-
assume_role_policy = data.aws_iam_policy_document.assume_role.json
83+
name = lookup(each.value, "service_role_name", "${each.key}-role")
84+
permissions_boundary = var.iam_permissions_boundary
85+
assume_role_policy = data.aws_iam_policy_document.assume_role.json
8486
}
8587

8688
resource "aws_iam_role_policy" "this" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ variable "elasticsearch_allowed_actions" {
126126
default = ["es:ESHttpDelete", "es:ESHttpHead", "es:ESHttpGet", "es:ESHttpPost", "es:ESHttpPut"]
127127
}
128128

129+
variable "iam_permissions_boundary" {
130+
description = "ARN for iam permissions boundary"
131+
type = string
132+
default = null
133+
}
134+
129135
# VTL request/response templates
130136
variable "direct_lambda_request_template" {
131137
description = "VTL request template for the direct lambda integrations"

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.12.6"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
55
aws = ">= 2.46"

0 commit comments

Comments
 (0)