Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
types: [opened, synchronize]
branches:
- main
paths:
- '*.tf'
concurrency: document-${{ github.base_ref }}
jobs:
document:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Release
on:
push:
branches: [ main ]
paths:
- '*.tf'
concurrency: release-${{ github.base_ref }}
jobs:
release:
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.terraform
examples/artifacts/*
!examples/artifacts/.gitignore
.DS_Store
target
CHANGELOG.md
Expand Down
34 changes: 17 additions & 17 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .tflint.hcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugin "aws" {
enabled = true
version = "0.22.1"
version = "0.42.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}

Expand Down
12 changes: 6 additions & 6 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform 1.4.5
golang 1.20.3
terraform 1.13.0
golang 1.25.0
ripgrep 13.0.0
tflint 0.46.0
github-cli 2.27.0
fd 8.7.0
terraform-docs 0.16.0
tflint 0.59.1
github-cli 2.78.0
fd 10.3.0
terraform-docs 0.20.0
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Use this URL for the source of the module. See the usage examples below for more details.

```hcl
github.com/pbs/terraform-aws-lambda-cron-module?ref=0.1.44
github.com/pbs/terraform-aws-lambda-cron-module?ref=x.y.z
```

### Alternative Installation Methods
Expand All @@ -22,7 +22,7 @@ Integrate this module like so:

```hcl
module "lambda-cron" {
source = "github.com/pbs/terraform-aws-lambda-cron-module?ref=0.1.44"
source = "github.com/pbs/terraform-aws-lambda-cron-module?ref=x.y.z"

# Required Parameters
handler = "main"
Expand All @@ -44,7 +44,7 @@ module "lambda-cron" {

If this repo is added as a subtree, then the version of the module should be close to the version shown here:

`0.1.44`
`x.y.z`

Note, however that subtrees can be altered as desired within repositories.

Expand All @@ -60,20 +60,20 @@ Below is automatically generated documentation on this Terraform module using [t

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.5.0 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.13.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.35.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 6.17.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_lambda"></a> [lambda](#module\_lambda) | github.com/pbs/terraform-aws-lambda-module | 1.3.40 |
| <a name="module_lambda"></a> [lambda](#module\_lambda) | github.com/pbs/terraform-aws-lambda-module | 2.0.0 |

## Resources

Expand All @@ -92,6 +92,7 @@ Below is automatically generated documentation on this Terraform module using [t
| <a name="input_filename"></a> [filename](#input\_filename) | Filename for the artifact to use for the Lambda | `string` | n/a | yes |
| <a name="input_handler"></a> [handler](#input\_handler) | Cloudwatch event pattern | `string` | n/a | yes |
| <a name="input_organization"></a> [organization](#input\_organization) | Organization using this module. Used to prefix tags so that they are easily identified as being from your organization | `string` | n/a | yes |
| <a name="input_owner"></a> [owner](#input\_owner) | Tag used to group resources according to product | `string` | n/a | yes |
| <a name="input_product"></a> [product](#input\_product) | Tag used to group resources according to product | `string` | n/a | yes |
| <a name="input_repo"></a> [repo](#input\_repo) | Tag used to point to the repo using this module | `string` | n/a | yes |
| <a name="input_runtime"></a> [runtime](#input\_runtime) | Runtime for the lambda function | `string` | n/a | yes |
Expand All @@ -101,10 +102,9 @@ Below is automatically generated documentation on this Terraform module using [t
| <a name="input_allow_app_config_access"></a> [allow\_app\_config\_access](#input\_allow\_app\_config\_access) | Allow AppConfig access from the Lambda function. Ignored if `policy_json` or `role_arn` are set. | `bool` | `true` | no |
| <a name="input_app_config_extension_account_number"></a> [app\_config\_extension\_account\_number](#input\_app\_config\_extension\_account\_number) | Account number for the AWS-AppConfig-Extension layer | `string` | `"027255383542"` | no |
| <a name="input_app_config_extension_version"></a> [app\_config\_extension\_version](#input\_app\_config\_extension\_version) | Lambda layer version for the AWS-AppConfig-Extension layer | `number` | `null` | no |
| <a name="input_architectures"></a> [architectures](#input\_architectures) | Architectures to target for the Lambda function | `list(string)` | <pre>[<br> "x86_64"<br>]</pre> | no |
| <a name="input_architectures"></a> [architectures](#input\_architectures) | Architectures to target for the Lambda function | `list(string)` | <pre>[<br/> "x86_64"<br/>]</pre> | no |
| <a name="input_cron"></a> [cron](#input\_cron) | (optional) cron controlling schedule of task. Is set to 07:00 GMT (02:00 EST) by default. | `string` | `"00 7 * * ? *"` | no |
| <a name="input_environment_vars"></a> [environment\_vars](#input\_environment\_vars) | Map of environment variables for the Lambda. If null, defaults to setting an SSM\_PATH based on the environment and name of the function. Set to {} if you would like for there to be no environment variables present. This is important if you are creating a Lambda@Edge. | `map(any)` | `null` | no |
| <a name="input_ephemeral_storage_size"></a> [ephemeral\_storage\_size](#input\_ephemeral\_storage\_size) | Size of the ephemeral storage in MB. Ignored if runtime is not supported. | `number` | `512` | no |
| <a name="input_event_rule_description"></a> [event\_rule\_description](#input\_event\_rule\_description) | Value to use for the CloudWatch Event Rule. Will default to name if not defined. | `string` | `null` | no |
| <a name="input_event_rule_name"></a> [event\_rule\_name](#input\_event\_rule\_name) | Name of the CloudWatch Event Rule. Will default to name if not defined. | `string` | `null` | no |
| <a name="input_file_system_config"></a> [file\_system\_config](#input\_file\_system\_config) | File system configuration for the Lambda function | `map(any)` | `null` | no |
Expand Down
2 changes: 1 addition & 1 deletion cron.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resource "aws_cloudwatch_event_rule" "event_rule" {
name = local.event_rule_name
description = local.event_rule_description
schedule_expression = "cron(${var.cron})"
is_enabled = var.is_enabled
state = var.is_enabled ? "ENABLED" : "DISABLED"

tags = local.tags
}
Expand Down
34 changes: 17 additions & 17 deletions examples/arm/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions examples/arm/main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
module "lambda_cron" {
source = "../.."

handler = "main"
filename = "../artifacts/arm-handler.zip"
runtime = "go1.x"
handler = "bootstrap"
filename = "../artifacts/handler.zip"
runtime = "provided.al2023"

architectures = ["arm64"]

environment = var.environment
product = var.product
repo = var.repo
owner = var.owner
organization = var.organization
}
11 changes: 11 additions & 0 deletions examples/arm/tags.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ variable "repo" {
}
}

variable "owner" {
description = "Tag used to group resources according to product"

default = "plops"

validation {
condition = can(regex("[a-z\\-]+", var.owner))
error_message = "The product variable violates approved regex."
}
}

variable "organization" {
description = "Organization using this module. Used to prefix tags so that they are easily identified as being from your organization"
type = string
Expand Down
Binary file added examples/artifacts/handler.zip
Binary file not shown.
33 changes: 16 additions & 17 deletions examples/basic/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module "lambda_cron" {
source = "../.."

handler = "main"
handler = "bootstrap"
filename = "../artifacts/handler.zip"
runtime = "go1.x"
runtime = "provided.al2023"

environment = var.environment
product = var.product
repo = var.repo
owner = var.owner
organization = var.organization
}
11 changes: 11 additions & 0 deletions examples/basic/tags.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ variable "repo" {
}
}

variable "owner" {
description = "Tag used to group resources according to product"

default = "plops"

validation {
condition = can(regex("[a-z\\-]+", var.owner))
error_message = "The product variable violates approved regex."
}
}

variable "organization" {
description = "Organization using this module. Used to prefix tags so that they are easily identified as being from your organization"
type = string
Expand Down
4 changes: 2 additions & 2 deletions examples/src/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/pbs/terraform-aws-lambda-module/examples/src/main

go 1.14
go 1.25

require github.com/aws/aws-lambda-go v1.22.0
require github.com/aws/aws-lambda-go v1.50.0
4 changes: 4 additions & 0 deletions examples/src/go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/aws/aws-lambda-go v1.22.0 h1:X7BKqIdfoJcbsEIi+Lrt5YjX1HnZexIbNWOQgkYKgfE=
github.com/aws/aws-lambda-go v1.22.0/go.mod h1:jJmlefzPfGnckuHdXX7/80O3BvUUi12XOkbv4w9SGLU=
github.com/aws/aws-lambda-go v1.50.0 h1:0GzY18vT4EsCvIyk3kn3ZH5Jg30NRlgYaai1w0aGPMU=
github.com/aws/aws-lambda-go v1.50.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand All @@ -10,8 +12,10 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.18
go 1.25

use (
./examples/src
Expand Down
Loading