Skip to content

Commit b8a4ed3

Browse files
authored
Merge pull request #13 from SPHTech-Platform/feature/create-role-handling
Create lambda role and create cloudwatch log group variable toggle support
2 parents e8e0315 + 9773dac commit b8a4ed3

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
| <a name="input_create_github_actions_oidc_provider"></a> [create\_github\_actions\_oidc\_provider](#input\_create\_github\_actions\_oidc\_provider) | Controls Whether to create openid connect provider. | `bool` | `false` | no |
5252
| <a name="input_create_github_actions_role"></a> [create\_github\_actions\_role](#input\_create\_github\_actions\_role) | Controls whether to create AWS OIDC integration GitHub Actions | `bool` | `true` | no |
5353
| <a name="input_create_lambda_function_url"></a> [create\_lambda\_function\_url](#input\_create\_lambda\_function\_url) | Controls whether the Lambda Function URL resource should be created | `bool` | `false` | no |
54+
| <a name="input_create_lambda_role"></a> [create\_lambda\_role](#input\_create\_lambda\_role) | Controls whether the Lambda Role | `bool` | `true` | no |
55+
| <a name="input_create_lambda_cloudwatch_log_group"></a> [create\_lambda\_cloudwatch\_log\_group](#input\_create\_lambda\_cloudwatch\_log\_group) | Controls whether the Lambda Role | `bool` | `true` | no |
5456
| <a name="input_create_unqualified_alias_lambda_function_url"></a> [create\_unqualified\_alias\_lambda\_function\_url](#input\_create\_unqualified\_alias\_lambda\_function\_url) | Whether to use unqualified alias pointing to $LATEST version in Lambda Function URL | `bool` | `true` | no |
5557
| <a name="input_dead_letter_target_arn"></a> [dead\_letter\_target\_arn](#input\_dead\_letter\_target\_arn) | The ARN of an SNS topic or SQS queue to notify when an invocation fails. | `string` | `null` | no |
5658
| <a name="input_default_conditions"></a> [default\_conditions](#input\_default\_conditions) | (Optional) Default condtions to apply, at least one of the following is madatory: 'allow\_main', 'allow\_environment', 'deny\_pull\_request' and 'allow\_all'. | `list(string)` | <pre>[<br> "allow_main",<br> "allow_environment"<br>]</pre> | no |

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ module "lambda" {
5050
authorization_type = var.authorization_type
5151
cors = var.cors
5252

53+
create_role = var.create_lambda_role
5354
role_name = var.role_name
5455
attach_policy_jsons = var.attach_policy_jsons
5556
attach_policy_json = var.attach_policy_json
@@ -68,5 +69,6 @@ module "lambda" {
6869
number_of_policy_jsons = var.number_of_policy_jsons
6970
number_of_policies = var.number_of_managed_policies
7071

72+
use_existing_cloudwatch_log_group = !var.create_lambda_cloudwatch_log_group
7173
cloudwatch_logs_retention_in_days = var.cloudwatch_logs_retention_in_days
7274
}

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ variable "create_lambda_function_url" {
1616
default = false
1717
}
1818

19+
variable "create_lambda_role" {
20+
description = "Controls whether the Lambda Role"
21+
type = bool
22+
default = true
23+
}
24+
25+
variable "create_lambda_cloudwatch_log_group" {
26+
description = "Controls whether the Lambda Role"
27+
type = bool
28+
default = true
29+
}
30+
1931
######################################
2032
# AWS OIDC integration GitHub Actions
2133
######################################

0 commit comments

Comments
 (0)