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
2626## Usage
2727``` hcl
2828module "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"
3030 app_name = "my-lambda"
3131 env = "dev"
3232 codedeploy_service_role_arn = module.acs.power_builder_role.arn
@@ -101,6 +101,7 @@ module "lambda_api" {
101101| 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
102102| timeout | number | How long the lambda will run (in seconds) before timing out | 3 (same as terraform default)
103103| 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
104105
105106#### lambda_vpc_config
106107
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ module "lambda_api" {
2323 vpc_id = module. acs . vpc . id
2424 public_subnet_ids = module. acs . public_subnet_ids
2525 role_permissions_boundary_arn = module. acs . role_permissions_boundary . arn
26+ xray_enabled = true
2627
2728 lambda_vpc_config = {
2829 subnet_ids = module.acs.private_subnet_ids
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ module "lambda_api" {
2323 vpc_id = module. acs . vpc . id
2424 public_subnet_ids = module. acs . public_subnet_ids
2525 role_permissions_boundary_arn = module. acs . role_permissions_boundary . arn
26+ xray_enabled = true
2627
2728 lambda_vpc_config = {
2829 subnet_ids = module.acs.private_subnet_ids
Original file line number Diff line number Diff line change 11provider "aws" {
2- version = " ~> 2.56 "
2+ version = " ~> 3.0 "
33 region = " us-west-2"
44}
55
66module "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"
88}
99
1010module "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"
1313 app_name = " my-lambda"
1414 env = " dev"
1515 lambda_zip_file = " ./src/lambda.zip"
@@ -20,6 +20,7 @@ module "lambda_api" {
2020 vpc_id = module. acs . vpc . id
2121 public_subnet_ids = module. acs . public_subnet_ids
2222 role_permissions_boundary_arn = module. acs . role_permissions_boundary . arn
23+ xray_enabled = true
2324}
2425
2526output "url" {
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ module "acs" {
99
1010module "lambda_api" {
1111 # 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"
1313 app_name = " my-lambda"
1414 env = " dev"
1515 lambda_zip_file = " ./src/lambda.zip"
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ module "acs" {
99
1010module "lambda_api" {
1111 # 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"
1313 app_name = " my-lambda-codedeploy"
1414 env = " dev"
1515 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" {
251251 timeout = var. timeout
252252 memory_size = var. memory_size
253253
254+ tracing_config {
255+ mode = var. xray_enabled == true ? " Active" : " PassThrough"
256+ }
257+
254258 dynamic "environment" {
255259 for_each = var. environment_variables != null ? [1 ] : []
256260 content {
Original file line number Diff line number Diff line change @@ -127,3 +127,8 @@ variable "memory_size" {
127127 description = " Memory Size of the lambda"
128128 default = 128
129129}
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