Skip to content

Commit 64e3d28

Browse files
Adding permission boundary (#6)
Co-authored-by: cloudpossebot <[email protected]>
1 parent 890fd36 commit 64e3d28

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ Available targets:
210210
| <a name="input_name"></a> [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br>This is the only ID element not also included as a `tag`.<br>The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
211211
| <a name="input_namespace"></a> [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
212212
| <a name="input_package_type"></a> [package\_type](#input\_package\_type) | The Lambda deployment package type. Valid values are Zip and Image. | `string` | `"Zip"` | no |
213+
| <a name="input_permissions_boundary"></a> [permissions\_boundary](#input\_permissions\_boundary) | ARN of the policy that is used to set the permissions boundary for the role | `string` | `""` | no |
213214
| <a name="input_publish"></a> [publish](#input\_publish) | Whether to publish creation/change as new Lambda Function Version. | `bool` | `false` | no |
214215
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
215216
| <a name="input_reserved_concurrent_executions"></a> [reserved\_concurrent\_executions](#input\_reserved\_concurrent\_executions) | The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. | `number` | `-1` | no |

docs/terraform.md

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
| <a name="input_name"></a> [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br>This is the only ID element not also included as a `tag`.<br>The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
7676
| <a name="input_namespace"></a> [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
7777
| <a name="input_package_type"></a> [package\_type](#input\_package\_type) | The Lambda deployment package type. Valid values are Zip and Image. | `string` | `"Zip"` | no |
78+
| <a name="input_permissions_boundary"></a> [permissions\_boundary](#input\_permissions\_boundary) | ARN of the policy that is used to set the permissions boundary for the role | `string` | `""` | no |
7879
| <a name="input_publish"></a> [publish](#input\_publish) | Whether to publish creation/change as new Lambda Function Version. | `bool` | `false` | no |
7980
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
8081
| <a name="input_reserved_concurrent_executions"></a> [reserved\_concurrent\_executions](#input\_reserved\_concurrent\_executions) | The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. | `number` | `-1` | no |

iam-role.tf

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
resource "aws_iam_role" "this" {
2-
count = local.enabled ? 1 : 0
3-
name = "${var.function_name}-${local.region_name}"
4-
assume_role_policy = data.aws_iam_policy_document.assume_role_policy.json
2+
count = local.enabled ? 1 : 0
3+
name = "${var.function_name}-${local.region_name}"
4+
assume_role_policy = data.aws_iam_policy_document.assume_role_policy.json
5+
permissions_boundary = var.permissions_boundary
56
}
67

78
data "aws_iam_policy_document" "assume_role_policy" {

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ variable "package_type" {
145145
type = string
146146
}
147147

148+
variable "permissions_boundary" {
149+
type = string
150+
default = ""
151+
description = "ARN of the policy that is used to set the permissions boundary for the role"
152+
}
153+
148154
variable "publish" {
149155
description = "Whether to publish creation/change as new Lambda Function Version."
150156
default = false

0 commit comments

Comments
 (0)