Skip to content

Commit 5ae25bd

Browse files
author
Ben Fortuna
committed
Added public sub-modules
1 parent b9b4b3d commit 5ae25bd

File tree

4 files changed

+56
-3
lines changed

4 files changed

+56
-3
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ clean:
1010
rm -rf .terraform/
1111

1212
test:
13-
$(TERRAFORM) init && $(TERRAFORM) validate
13+
$(TERRAFORM) init && $(TERRAFORM) validate && \
14+
$(TERRAFORM) init modules/ec2-instance-cycle && $(TERRAFORM) validate modules/ec2-instance-cycle
1415

1516
docs:
16-
docker run --rm -v "${PWD}:/work" tmknom/terraform-docs markdown ./ >./README.md
17+
docker run --rm -v "${PWD}:/work" tmknom/terraform-docs markdown ./ >./README.md && \
18+
docker run --rm -v "${PWD}:/work" tmknom/terraform-docs markdown ./modules/ec2-instance-cycle >./modules/ec2-instance-cycle/README.md
1719

1820
format:
19-
$(TERRAFORM) fmt -list=true ./
21+
$(TERRAFORM) fmt -list=true ./ && \
22+
$(TERRAFORM) fmt -list=true ./modules/ec2-instance-cycle
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Requirements
2+
3+
No requirements.
4+
5+
## Providers
6+
7+
No provider.
8+
9+
## Inputs
10+
11+
| Name | Description | Type | Default | Required |
12+
|------|-------------|------|---------|:--------:|
13+
| environment | Environment variables to configure the Lambda function | `map(string)` | `{}` | no |
14+
| function\_name | Name of the Lambda function | `string` | `"ec2-instance-cycle"` | no |
15+
| role | IAM role assumed by the Lambda function | `string` | `"ec2-lambda-role"` | no |
16+
| runtime | A runtime to use for the function (leave blank to use default runtime) | `any` | `null` | no |
17+
18+
## Outputs
19+
20+
No output.
21+

modules/ec2-instance-cycle/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module "function" {
2+
source = "../.."
3+
4+
function_name = var.function_name
5+
template = "ec2-instance-cycle"
6+
runtime = var.runtime
7+
role = var.role
8+
environment = var.environment
9+
}

modules/ec2-instance-cycle/vars.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
variable "function_name" {
2+
description = "Name of the Lambda function"
3+
default = "ec2-instance-cycle"
4+
}
5+
6+
variable "runtime" {
7+
description = "A runtime to use for the function (leave blank to use default runtime)"
8+
default = null
9+
}
10+
11+
variable "environment" {
12+
description = "Environment variables to configure the Lambda function"
13+
type = map(string)
14+
default = {}
15+
}
16+
17+
variable "role" {
18+
description = "IAM role assumed by the Lambda function"
19+
default = "ec2-lambda-role"
20+
}

0 commit comments

Comments
 (0)