File tree Expand file tree Collapse file tree 8 files changed +20
-7
lines changed
simple-lambda-with-deploy-test Expand file tree Collapse file tree 8 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ Also Note: CodePipeline and CodeDeploy cannot be used together to deploy a Lambd
26
26
## Usage
27
27
``` hcl
28
28
module "lambda_api" {
29
- source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.2 .0"
29
+ source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.3 .0"
30
30
app_name = "my-lambda"
31
31
env = "dev"
32
32
codedeploy_service_role_arn = module.acs.power_builder_role.arn
@@ -101,6 +101,7 @@ module "lambda_api" {
101
101
| use_codedeploy | bool | If true, CodeDeploy App and Deployment Group will be created and TF will not update alias to point to new versions of the Lambda (becuase CodeDeploy will do that). | false
102
102
| timeout | number | How long the lambda will run (in seconds) before timing out | 3 (same as terraform default)
103
103
| memory_size | number | Size of the memory of the lambda. CPU will scale along with it | 128 (same as terraform default)
104
+ | xray_enabled | bool | Whether or not the X-Ray daemon should be created with the Lambda API. | false
104
105
105
106
#### lambda_vpc_config
106
107
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ module "lambda_api" {
23
23
vpc_id = module. acs . vpc . id
24
24
public_subnet_ids = module. acs . public_subnet_ids
25
25
role_permissions_boundary_arn = module. acs . role_permissions_boundary . arn
26
+ xray_enabled = true
26
27
27
28
lambda_vpc_config = {
28
29
subnet_ids = module.acs.private_subnet_ids
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ module "lambda_api" {
23
23
vpc_id = module. acs . vpc . id
24
24
public_subnet_ids = module. acs . public_subnet_ids
25
25
role_permissions_boundary_arn = module. acs . role_permissions_boundary . arn
26
+ xray_enabled = true
26
27
27
28
lambda_vpc_config = {
28
29
subnet_ids = module.acs.private_subnet_ids
Original file line number Diff line number Diff line change 1
1
provider "aws" {
2
- version = " ~> 2.56 "
2
+ version = " ~> 3.0 "
3
3
region = " us-west-2"
4
4
}
5
5
6
6
module "acs" {
7
- source = " github.com/byu-oit/terraform-aws-acs-info?ref=v2.1 .0"
7
+ source = " github.com/byu-oit/terraform-aws-acs-info?ref=v3.2 .0"
8
8
}
9
9
10
10
module "lambda_api" {
11
- # source = "../../"
12
- source = " github.com/byu-oit/terraform-aws-lambda-api?ref=v1.2 .0"
11
+ // source = "../../"
12
+ source = " github.com/byu-oit/terraform-aws-lambda-api?ref=v1.3 .0"
13
13
app_name = " my-lambda"
14
14
env = " dev"
15
15
lambda_zip_file = " ./src/lambda.zip"
@@ -20,6 +20,7 @@ module "lambda_api" {
20
20
vpc_id = module. acs . vpc . id
21
21
public_subnet_ids = module. acs . public_subnet_ids
22
22
role_permissions_boundary_arn = module. acs . role_permissions_boundary . arn
23
+ xray_enabled = true
23
24
}
24
25
25
26
output "url" {
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ module "acs" {
9
9
10
10
module "lambda_api" {
11
11
# source = "../../"
12
- source = " github.com/byu-oit/terraform-aws-lambda-api?ref=v1.2 .0"
12
+ source = " github.com/byu-oit/terraform-aws-lambda-api?ref=v1.3 .0"
13
13
app_name = " my-lambda"
14
14
env = " dev"
15
15
lambda_zip_file = " ./src/lambda.zip"
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ module "acs" {
9
9
10
10
module "lambda_api" {
11
11
# source = "../../"
12
- source = " github.com/byu-oit/terraform-aws-lambda-api?ref=v1.2 .0"
12
+ source = " github.com/byu-oit/terraform-aws-lambda-api?ref=v1.3 .0"
13
13
app_name = " my-lambda-codedeploy"
14
14
env = " dev"
15
15
codedeploy_service_role_arn = module. acs . power_builder_role . arn
Original file line number Diff line number Diff line change @@ -251,6 +251,10 @@ resource "aws_lambda_function" "api_lambda" {
251
251
timeout = var. timeout
252
252
memory_size = var. memory_size
253
253
254
+ tracing_config {
255
+ mode = var. xray_enabled == true ? " Active" : " PassThrough"
256
+ }
257
+
254
258
dynamic "environment" {
255
259
for_each = var. environment_variables != null ? [1 ] : []
256
260
content {
Original file line number Diff line number Diff line change @@ -127,3 +127,8 @@ variable "memory_size" {
127
127
description = " Memory Size of the lambda"
128
128
default = 128
129
129
}
130
+ variable "xray_enabled" {
131
+ type = bool
132
+ description = " Whether or not the X-Ray daemon should be created with the Lambda API."
133
+ default = false
134
+ }
You can’t perform that action at this time.
0 commit comments