Skip to content

Commit

Permalink
feat: Bump terraform aws provider required version to v4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumelecerf committed Mar 15, 2022
1 parent 382469e commit 2f3eba0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ locals {
# s3_* - to get package from S3
s3_bucket = var.s3_existing_package != null ? lookup(var.s3_existing_package, "bucket", null) : (var.store_on_s3 ? var.s3_bucket : null)
s3_key = var.s3_existing_package != null ? lookup(var.s3_existing_package, "key", null) : (var.store_on_s3 ? var.s3_prefix != null ? format("%s%s", var.s3_prefix, replace(local.archive_filename_string, "/^.*//", "")) : replace(local.archive_filename_string, "/^\\.//", "") : null)
s3_object_version = var.s3_existing_package != null ? lookup(var.s3_existing_package, "version_id", null) : (var.store_on_s3 ? try(aws_s3_bucket_object.lambda_package[0].version_id, null) : null)
s3_object_version = var.s3_existing_package != null ? lookup(var.s3_existing_package, "version_id", null) : (var.store_on_s3 ? try(aws_s3_object.lambda_package[0].version_id, null) : null)

}

Expand Down Expand Up @@ -96,7 +96,7 @@ resource "aws_lambda_function" "this" {
# When a lambda function is invoked, AWS creates the log group automatically if it doesn't exist yet.
# Without the dependency, this can result in a race condition if the lambda function is invoked before
# Terraform can create the log group.
depends_on = [null_resource.archive, aws_s3_bucket_object.lambda_package, aws_cloudwatch_log_group.lambda]
depends_on = [null_resource.archive, aws_s3_object.lambda_package, aws_cloudwatch_log_group.lambda]
}

resource "aws_lambda_layer_version" "this" {
Expand All @@ -117,10 +117,10 @@ resource "aws_lambda_layer_version" "this" {
s3_key = local.s3_key
s3_object_version = local.s3_object_version

depends_on = [null_resource.archive, aws_s3_bucket_object.lambda_package]
depends_on = [null_resource.archive, aws_s3_object.lambda_package]
}

resource "aws_s3_bucket_object" "lambda_package" {
resource "aws_s3_object" "lambda_package" {
count = local.create && var.store_on_s3 && var.create_package ? 1 : 0

bucket = var.s3_bucket
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.69"
version = ">= 4.0"
}
external = {
source = "hashicorp/external"
Expand Down

0 comments on commit 2f3eba0

Please sign in to comment.