Skip to content

Commit

Permalink
fix: e2e test and terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
tractorcow committed Jul 19, 2023
1 parent 57800cb commit ba6df92
Show file tree
Hide file tree
Showing 4 changed files with 340 additions and 20 deletions.
17 changes: 11 additions & 6 deletions gatsby-plugin-s3-e2e-tests-infrastructure/template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ variable "bucket_deletion_period" {


terraform {
required_version = "~> 0.12"
required_version = "~> 1.5.2"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}

provider "aws" {
version = "~> 2.59"
region = local.region
}

Expand Down Expand Up @@ -60,12 +65,12 @@ data "archive_file" "lambda_function" {

source {
filename = "cleanupLambda.js"
content = file("${path.module}/../test/cleanupLambda.js")
content = file("${path.module}/../gatsby-plugin-s3-e2e-tests/dist/cleanupLambda.js")
}

source {
filename = "helpers.js"
content = file("${path.module}/../test/helpers.js")
content = file("${path.module}/../gatsby-plugin-s3-e2e-tests/dist/helpers.js")
}
}

Expand All @@ -76,7 +81,7 @@ resource "aws_lambda_function" "function" {
handler = "cleanupLambda.default"

source_code_hash = data.archive_file.lambda_function.output_base64sha256
runtime = "nodejs12.x"
runtime = "nodejs18.x"
}

resource "aws_cloudwatch_event_rule" "event" {
Expand All @@ -100,4 +105,4 @@ output "test_user_access_key_id" {
output "test_user_secret_access_key" {
value = aws_iam_access_key.key.secret
sensitive = true
}
}
Loading

0 comments on commit ba6df92

Please sign in to comment.