Skip to content

Commit 2ef835c

Browse files
authored
fix: source lambda-layer from the Terraform Registry instead of git (#6)
Replace git:: module sources with registry sources and version constraints in the module and all examples (ql4b/lambda-layer/aws ~> 1.2, ql4b/lambda-function/aws ~> 1.2). lambda-layer 1.1.0 -> 1.2.x is additive for the prebuilt-zip path this module uses (new optional source_url input, no resource changes), and lambda-function 1.1.0 -> 1.2.0 has no .tf changes.
1 parent 05aaebe commit 2ef835c

6 files changed

Lines changed: 47 additions & 24 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ No providers.
327327

328328
| Name | Source | Version |
329329
| ---- | ------ | ------- |
330-
| <a name="module_runtime"></a> [runtime](#module\_runtime) | git::https://github.com/ql4b/terraform-aws-lambda-layer.git | v1.1.0 |
330+
| <a name="module_runtime"></a> [runtime](#module\_runtime) | ql4b/lambda-layer/aws | ~> 1.2 |
331331
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
332332

333333
## Resources

‎examples/aws-services/main.tf‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ module "runtime" {
1818
}
1919

2020
module "jq" {
21-
source = "git::https://github.com/ql4b/terraform-aws-lambda-layer.git?ref=v1.2.0"
21+
source = "ql4b/lambda-layer/aws"
22+
version = "~> 1.2"
2223

2324
name = "${local.name}-jq"
2425
source_url = "${local.layers_base}/jq-${local.arch}-layer.zip"
@@ -27,7 +28,8 @@ module "jq" {
2728
}
2829

2930
module "uuid" {
30-
source = "git::https://github.com/ql4b/terraform-aws-lambda-layer.git?ref=v1.2.0"
31+
source = "ql4b/lambda-layer/aws"
32+
version = "~> 1.2"
3133

3234
name = "${local.name}-uuid"
3335
source_url = "${local.layers_base}/uuid-${local.arch}-layer.zip"
@@ -66,7 +68,8 @@ resource "aws_ssm_parameter" "this" {
6668

6769
# List S3 buckets (curl only)
6870
module "buckets" {
69-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
71+
source = "ql4b/lambda-function/aws"
72+
version = "~> 1.2"
7073

7174
source_dir = "./app"
7275
name = "${local.name}-buckets"
@@ -93,7 +96,8 @@ resource "aws_iam_role_policy" "buckets_s3" {
9396

9497
# Put item to DynamoDB (uuid + jq)
9598
module "put_item" {
96-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
99+
source = "ql4b/lambda-function/aws"
100+
version = "~> 1.2"
97101

98102
source_dir = "./app"
99103
name = "${local.name}-put-item"
@@ -128,7 +132,8 @@ resource "aws_iam_role_policy" "put_item_dynamodb" {
128132

129133
# Publish to SNS (curl only)
130134
module "publish" {
131-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
135+
source = "ql4b/lambda-function/aws"
136+
version = "~> 1.2"
132137

133138
source_dir = "./app"
134139
name = "${local.name}-publish"
@@ -159,7 +164,8 @@ resource "aws_iam_role_policy" "publish_sns" {
159164

160165
# Get SSM parameter (jq)
161166
module "get_param" {
162-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
167+
source = "ql4b/lambda-function/aws"
168+
version = "~> 1.2"
163169

164170
source_dir = "./app"
165171
name = "${local.name}-get-param"
@@ -193,7 +199,8 @@ resource "aws_iam_role_policy" "get_param_ssm" {
193199

194200
# Send SQS message (jq)
195201
module "send_message" {
196-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
202+
source = "ql4b/lambda-function/aws"
203+
version = "~> 1.2"
197204

198205
source_dir = "./app"
199206
name = "${local.name}-send-message"

‎examples/basic/main.tf‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ module "runtime" {
1717
}
1818

1919
module "app" {
20-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
20+
source = "ql4b/lambda-function/aws"
21+
version = "~> 1.2"
2122

2223
source_dir = "./app"
2324

‎examples/complete/main.tf‎

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ module "runtime" {
1818
}
1919

2020
module "qrencode" {
21-
source = "git::https://github.com/ql4b/terraform-aws-lambda-layer.git?ref=v1.2.0"
21+
source = "ql4b/lambda-layer/aws"
22+
version = "~> 1.2"
2223

2324
name = "${local.name}-qrencode"
2425
source_url = "${local.layers_base}/qrencode-${local.arch}-layer.zip"
@@ -27,7 +28,8 @@ module "qrencode" {
2728
}
2829

2930
module "jq" {
30-
source = "git::https://github.com/ql4b/terraform-aws-lambda-layer.git?ref=v1.2.0"
31+
source = "ql4b/lambda-layer/aws"
32+
version = "~> 1.2"
3133

3234
name = "${local.name}-jq"
3335
source_url = "${local.layers_base}/jq-${local.arch}-layer.zip"
@@ -36,7 +38,8 @@ module "jq" {
3638
}
3739

3840
module "uuid" {
39-
source = "git::https://github.com/ql4b/terraform-aws-lambda-layer.git?ref=v1.2.0"
41+
source = "ql4b/lambda-layer/aws"
42+
version = "~> 1.2"
4043

4144
name = "${local.name}-uuid"
4245
source_url = "${local.layers_base}/uuid-${local.arch}-layer.zip"
@@ -45,7 +48,8 @@ module "uuid" {
4548
}
4649

4750
module "htmlq" {
48-
source = "git::https://github.com/ql4b/terraform-aws-lambda-layer.git?ref=v1.2.0"
51+
source = "ql4b/lambda-layer/aws"
52+
version = "~> 1.2"
4953

5054
name = "${local.name}-htmlq"
5155
source_url = "${local.layers_base}/htmlq-${local.arch}-layer.zip"
@@ -54,7 +58,8 @@ module "htmlq" {
5458
}
5559

5660
module "http_cli" {
57-
source = "git::https://github.com/ql4b/terraform-aws-lambda-layer.git?ref=v1.2.0"
61+
source = "ql4b/lambda-layer/aws"
62+
version = "~> 1.2"
5863

5964
name = "${local.name}-http-cli"
6065
source_url = "${local.layers_base}/http-cli-${local.arch}-layer.zip"
@@ -66,7 +71,8 @@ module "http_cli" {
6671

6772
# curl only (no extra layers)
6873
module "weather" {
69-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
74+
source = "ql4b/lambda-function/aws"
75+
version = "~> 1.2"
7076

7177
source_dir = "./app"
7278
name = "${local.name}-weather"
@@ -79,7 +85,8 @@ module "weather" {
7985

8086
# jq layer
8187
module "events" {
82-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
88+
source = "ql4b/lambda-function/aws"
89+
version = "~> 1.2"
8390

8491
source_dir = "./app"
8592
name = "${local.name}-events"
@@ -95,7 +102,8 @@ module "events" {
95102

96103
# uuid + jq layers
97104
module "id" {
98-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
105+
source = "ql4b/lambda-function/aws"
106+
version = "~> 1.2"
99107

100108
source_dir = "./app"
101109
name = "${local.name}-id"
@@ -112,7 +120,8 @@ module "id" {
112120

113121
# htmlq + jq layers
114122
module "runtimes" {
115-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
123+
source = "ql4b/lambda-function/aws"
124+
version = "~> 1.2"
116125

117126
source_dir = "./app"
118127
name = "${local.name}-runtimes"
@@ -129,7 +138,8 @@ module "runtimes" {
129138

130139
# http-cli + jq layers
131140
module "status" {
132-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
141+
source = "ql4b/lambda-function/aws"
142+
version = "~> 1.2"
133143

134144
source_dir = "./app"
135145
name = "${local.name}-status"
@@ -145,7 +155,8 @@ module "status" {
145155
}
146156

147157
module "qr" {
148-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
158+
source = "ql4b/lambda-function/aws"
159+
version = "~> 1.2"
149160

150161
source_dir = "./app"
151162
name = "${local.name}-qr"

‎examples/endpoints/main.tf‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ module "runtime" {
1818
}
1919

2020
module "jq" {
21-
source = "git::https://github.com/ql4b/terraform-aws-lambda-layer.git?ref=v1.2.0"
21+
source = "ql4b/lambda-layer/aws"
22+
version = "~> 1.2"
2223

2324
name = "${local.name}-jq"
2425
source_url = "${local.layers_base}/jq-${local.arch}-layer.zip"
@@ -31,7 +32,8 @@ module "jq" {
3132
# =============================================================================
3233

3334
module "public" {
34-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
35+
source = "ql4b/lambda-function/aws"
36+
version = "~> 1.2"
3537

3638
source_dir = "./app"
3739
name = "${local.name}-public"
@@ -68,7 +70,8 @@ variable "allowed_principals" {
6870
}
6971

7072
module "private" {
71-
source = "git::https://github.com/ql4b/terraform-aws-lambda-function.git?ref=v1.1.0"
73+
source = "ql4b/lambda-function/aws"
74+
version = "~> 1.2"
7275

7376
source_dir = "./app"
7477
name = "${local.name}-private"

‎main.tf‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ locals {
66
}
77

88
module "runtime" {
9-
source = "git::https://github.com/ql4b/terraform-aws-lambda-layer.git?ref=v1.1.0"
9+
source = "ql4b/lambda-layer/aws"
10+
version = "~> 1.2"
1011

1112
context = module.this.context
1213

0 commit comments

Comments
 (0)