Skip to content

Commit 094730e

Browse files
authored
Merge pull request #42 from babbel/aws-provider-v6
Support AWS Provider v6
2 parents 9ee357d + c32797d commit 094730e

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
resource "aws_lambda_function" "this" {
2+
region = var.region
3+
24
function_name = var.function_name
35
description = var.description
46

@@ -80,6 +82,8 @@ resource "aws_iam_role_policy" "cloudwatch-log-group" {
8082
}
8183

8284
resource "aws_cloudwatch_log_group" "this" {
85+
region = var.region
86+
8387
name = "/aws/lambda/${var.function_name}"
8488

8589
retention_in_days = var.cloudwatch_log_group_retention_in_days
@@ -110,6 +114,8 @@ locals {
110114
resource "aws_security_group" "this" {
111115
for_each = local.vpc_configs
112116

117+
region = var.region
118+
113119
name = "lambda-${var.function_name}"
114120
description = "Lambda: ${var.function_name}"
115121
vpc_id = each.value.vpc.id
@@ -126,6 +132,8 @@ resource "aws_security_group" "this" {
126132
resource "aws_security_group_rule" "egress" {
127133
for_each = aws_security_group.this
128134

135+
region = var.region
136+
129137
security_group_id = each.value.id
130138

131139
type = "egress"
@@ -192,6 +200,8 @@ data "aws_partition" "current" {
192200

193201
data "aws_region" "current" {
194202
for_each = local.vpc_configs
203+
204+
region = var.region
195205
}
196206

197207
data "aws_caller_identity" "current" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,9 @@ VPC configuration of the Lambda function:
183183
If `vpc_config` is `null` the Lambda function will not be placed into a VPC.
184184
EOS
185185
}
186+
187+
variable "region" {
188+
description = "Region where the resource(s) will be managed. Defaults to the region set in the provider configuration"
189+
type = string
190+
default = null
191+
}

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ terraform {
88
}
99
aws = {
1010
source = "hashicorp/aws"
11-
version = ">= 3"
11+
version = ">= 6.0"
1212
}
1313
}
1414
}

0 commit comments

Comments
 (0)