diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0643025 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI + +on: + pull_request: + push: + branches: + - main + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + + - uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4 + + - name: Lint + run: tflint --format compact diff --git a/LICENSE b/LICENSE index 1fc0ec2..b9e765c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Transcend +Copyright (c) 2026 Transcend Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/main.tf b/main.tf index a0aa90e..e436d83 100644 --- a/main.tf +++ b/main.tf @@ -140,8 +140,8 @@ resource "aws_iam_role_policy" "logs_role_policy" { * of the CloudFront edge location handling the request. */ resource "aws_cloudwatch_log_group" "log_group" { - name = "/aws/lambda/${var.name}" - tags = var.tags + name = "/aws/lambda/${var.name}" + tags = var.tags kms_key_id = var.cloudwatch_log_groups_kms_arn } diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..d994f40 --- /dev/null +++ b/mise.toml @@ -0,0 +1,3 @@ +[tools] +terraform = "0.13" +tflint = "0.63.1" diff --git a/variables.tf b/variables.tf index 5dfff53..dabb9d5 100644 --- a/variables.tf +++ b/variables.tf @@ -1,12 +1,15 @@ variable name { + type = string description = "Name of the Lambda@Edge Function" } variable description { + type = string description = "Description of what the Lambda@Edge Function does" } variable s3_artifact_bucket { + type = string description = "Name of the S3 bucket to upload versioned artifacts to" } @@ -17,6 +20,7 @@ variable tags { } variable lambda_code_source_dir { + type = string description = "An absolute path to the directory containing the code to upload to lambda" } @@ -27,21 +31,24 @@ variable file_globs { } variable local_file_dir { + type = string description = "A path to the directory to store plan time generated local files" default = "." } variable runtime { + type = string description = "The runtime of the lambda function" - default = "nodejs14.x" } variable handler { + type = string description = "The path to the main method that should handle the incoming requests" default = "index.handler" } variable config_file_name { + type = string description = "The name of the file var.plaintext_params will be written to as json" default = "config.json" } @@ -98,4 +105,3 @@ variable cloudwatch_log_groups_kms_arn { description = "KMS ARN to encrypt the log group in cloudwatch" default = null } - diff --git a/versions.tf b/versions.tf index 9b2c6b7..bd82229 100644 --- a/versions.tf +++ b/versions.tf @@ -1,10 +1,12 @@ terraform { required_providers { archive = { - source = "hashicorp/archive" + source = "hashicorp/archive" + version = ">= 2.0.0" } aws = { - source = "hashicorp/aws" + source = "hashicorp/aws" + version = ">= 3.11.0" } } required_version = ">= 0.13"