Skip to content

Commit a71f2cb

Browse files
authored
Merge branch 'master' into feat/pip-args
2 parents b827f60 + dedc736 commit a71f2cb

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.96.3
3+
rev: v1.98.1
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_wrapper_module_for_each

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [7.20.2](https://github.com/terraform-aws-modules/terraform-aws-lambda/compare/v7.20.1...v7.20.2) (2025-04-09)
6+
7+
8+
### Bug Fixes
9+
10+
* Add aws_partition to support usage of this module in aws-cn and gov ([64433c0](https://github.com/terraform-aws-modules/terraform-aws-lambda/commit/64433c096e690b767a8b106b67383edfe8263ba7))
11+
512
## [7.20.1](https://github.com/terraform-aws-modules/terraform-aws-lambda/compare/v7.20.0...v7.20.1) (2025-01-26)
613

714

modules/deploy/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ No modules.
137137
| [aws_iam_role.codedeploy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_role) | data source |
138138
| [aws_lambda_alias.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lambda_alias) | data source |
139139
| [aws_lambda_function.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lambda_function) | data source |
140+
| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |
140141

141142
## Inputs
142143

modules/deploy/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ EOF
8686

8787
}
8888

89+
data "aws_partition" "current" {}
90+
8991
data "aws_lambda_alias" "this" {
9092
count = var.create && var.create_deployment ? 1 : 0
9193

@@ -209,7 +211,7 @@ resource "aws_iam_role_policy_attachment" "codedeploy" {
209211
count = var.create && var.create_codedeploy_role ? 1 : 0
210212

211213
role = try(aws_iam_role.codedeploy[0].id, "")
212-
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambda"
214+
policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AWSCodeDeployRoleForLambda"
213215
}
214216

215217
data "aws_iam_policy_document" "hooks" {

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ output "lambda_function_arn" {
66

77
output "lambda_function_arn_static" {
88
description = "The static ARN of the Lambda Function. Use this to avoid cycle errors between resources (e.g., Step Functions)"
9-
value = local.create && var.create_function && !var.create_layer ? "arn:aws:lambda:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:function:${var.function_name}" : ""
9+
value = local.create && var.create_function && !var.create_layer ? "arn:${data.aws_partition.current.partition}:lambda:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:function:${var.function_name}" : ""
1010
}
1111

1212
output "lambda_function_invoke_arn" {

0 commit comments

Comments
 (0)