Skip to content

Commit

Permalink
Make terraform resource / var names completely consistent for easier …
Browse files Browse the repository at this point in the history
…automation. (open-telemetry#59)
  • Loading branch information
Anuraag Agrawal authored Apr 21, 2021
1 parent 0c80e96 commit 7355458
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 49 deletions.
10 changes: 5 additions & 5 deletions java/integration-tests/aws-sdk/agent/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ resource "aws_lambda_layer_version" "collector_layer" {
source_code_hash = filebase64sha256("../../../../collector/build/collector-extension.zip")
}

module "hello-awssdk-function" {
source = "../../../sample-apps/aws-sdk/deploy/agent"
name = var.function_name
collector_layer_arn = aws_lambda_layer_version.sdk_layer.arn
java_agent_layer_arn = aws_lambda_layer_version.collector_layer.arn
module "hello-lambda-function" {
source = "../../../sample-apps/aws-sdk/deploy/agent"
name = var.function_name
collector_layer_arn = aws_lambda_layer_version.sdk_layer.arn
sdk_layer_arn = aws_lambda_layer_version.collector_layer.arn
}
10 changes: 5 additions & 5 deletions java/integration-tests/aws-sdk/wrapper/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ resource "aws_lambda_layer_version" "collector_layer" {
source_code_hash = filebase64sha256("../../../../collector/build/collector-extension.zip")
}

module "hello-awssdk-function" {
source = "../../../sample-apps/aws-sdk/deploy/wrapper"
name = var.function_name
collector_layer_arn = aws_lambda_layer_version.sdk_layer.arn
java_wrapper_layer_arn = aws_lambda_layer_version.collector_layer.arn
module "hello-lambda-function" {
source = "../../../sample-apps/aws-sdk/deploy/wrapper"
name = var.function_name
collector_layer_arn = aws_lambda_layer_version.sdk_layer.arn
sdk_layer_arn = aws_lambda_layer_version.collector_layer.arn
}
10 changes: 5 additions & 5 deletions java/integration-tests/okhttp/wrapper/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ resource "aws_lambda_layer_version" "collector_layer" {
source_code_hash = filebase64sha256("../../../../collector/build/collector-extension.zip")
}

module "hello-okhttp-function" {
source = "../../../sample-apps/okhttp/deploy/wrapper"
name = var.function_name
collector_layer_arn = aws_lambda_layer_version.sdk_layer.arn
java_wrapper_layer_arn = aws_lambda_layer_version.collector_layer.arn
module "hello-lambda-function" {
source = "../../../sample-apps/okhttp/deploy/wrapper"
name = var.function_name
collector_layer_arn = aws_lambda_layer_version.sdk_layer.arn
sdk_layer_arn = aws_lambda_layer_version.collector_layer.arn
}
8 changes: 4 additions & 4 deletions java/sample-apps/aws-sdk/deploy/agent/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module "hello-awssdk-javaagent" {
module "hello-lambda-function" {
source = "terraform-aws-modules/lambda/aws"

function_name = var.name
Expand All @@ -14,7 +14,7 @@ module "hello-awssdk-javaagent" {

layers = [
var.collector_layer_arn,
var.java_agent_layer_arn
var.sdk_layer_arn
]

environment_variables = {
Expand All @@ -37,8 +37,8 @@ module "hello-awssdk-javaagent" {

resource "aws_lambda_alias" "provisioned" {
name = "provisioned"
function_name = module.hello-awssdk-javaagent.this_lambda_function_name
function_version = module.hello-awssdk-javaagent.this_lambda_function_version
function_name = module.hello-lambda-function.this_lambda_function_name
function_version = module.hello-lambda-function.this_lambda_function_version
}

resource "aws_lambda_provisioned_concurrency_config" "lambda_api" {
Expand Down
2 changes: 1 addition & 1 deletion java/sample-apps/aws-sdk/deploy/agent/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variable "collector_layer_arn" {
// TODO(anuraaga): Add default when a public layer is published.
}

variable "java_agent_layer_arn" {
variable "sdk_layer_arn" {
type = string
description = "ARN for the Lambda layer containing the OpenTelemetry Java Agent"
// TODO(anuraaga): Add default when a public layer is published.
Expand Down
8 changes: 4 additions & 4 deletions java/sample-apps/aws-sdk/deploy/wrapper/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module "hello-awssdk-java-wrapper" {
module "hello-lambda-function" {
source = "terraform-aws-modules/lambda/aws"

function_name = var.name
Expand All @@ -13,7 +13,7 @@ module "hello-awssdk-java-wrapper" {

layers = [
var.collector_layer_arn,
var.java_wrapper_layer_arn
var.sdk_layer_arn
]

environment_variables = {
Expand All @@ -38,6 +38,6 @@ module "api-gateway" {
source = "../../../../../utils/terraform/api-gateway-proxy"

name = var.name
function_name = module.hello-awssdk-java-wrapper.this_lambda_function_name
function_invoke_arn = module.hello-awssdk-java-wrapper.this_lambda_function_invoke_arn
function_name = module.hello-lambda-function.this_lambda_function_name
function_invoke_arn = module.hello-lambda-function.this_lambda_function_invoke_arn
}
2 changes: 1 addition & 1 deletion java/sample-apps/aws-sdk/deploy/wrapper/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variable "collector_layer_arn" {
// TODO(anuraaga): Add default when a public layer is published.
}

variable "java_wrapper_layer_arn" {
variable "sdk_layer_arn" {
type = string
description = "ARN for the Lambda layer containing the OpenTelemetry Java Wrapper"
// TODO(anuraaga): Add default when a public layer is published.
Expand Down
9 changes: 4 additions & 5 deletions java/sample-apps/okhttp/deploy/wrapper/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

module "hello-okhttp-java-wrapper" {
module "hello-lambda-function" {
source = "terraform-aws-modules/lambda/aws"

function_name = var.name
Expand All @@ -14,7 +13,7 @@ module "hello-okhttp-java-wrapper" {

layers = [
var.collector_layer_arn,
var.java_wrapper_layer_arn
var.sdk_layer_arn
]

environment_variables = {
Expand All @@ -41,6 +40,6 @@ module "api-gateway" {
source = "../../../../../utils/terraform/api-gateway-proxy"

name = var.name
function_name = module.hello-okhttp-java-wrapper.this_lambda_function_name
function_invoke_arn = module.hello-okhttp-java-wrapper.this_lambda_function_invoke_arn
function_name = module.hello-lambda-function.this_lambda_function_name
function_invoke_arn = module.hello-lambda-function.this_lambda_function_invoke_arn
}
2 changes: 1 addition & 1 deletion java/sample-apps/okhttp/deploy/wrapper/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variable "collector_layer_arn" {
// TODO(anuraaga): Add default when a public layer is published.
}

variable "java_wrapper_layer_arn" {
variable "sdk_layer_arn" {
type = string
description = "ARN for the Lambda layer containing the OpenTelemetry Java Wrapper"
// TODO(anuraaga): Add default when a public layer is published.
Expand Down
10 changes: 5 additions & 5 deletions nodejs/integration-tests/aws-sdk/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ resource "aws_lambda_layer_version" "collector_layer" {
source_code_hash = filebase64sha256("../../../collector/build/collector-extension.zip")
}

module "hello-awssdk-function" {
source = "../../sample-apps/aws-sdk/deploy"
name = var.function_name
collector_layer_arn = aws_lambda_layer_version.sdk_layer.arn
nodejs_wrapper_layer_arn = aws_lambda_layer_version.collector_layer.arn
module "hello-lambda-function" {
source = "../../sample-apps/aws-sdk/deploy"
name = var.function_name
collector_layer_arn = aws_lambda_layer_version.sdk_layer.arn
sdk_layer_arn = aws_lambda_layer_version.collector_layer.arn
}
8 changes: 4 additions & 4 deletions nodejs/sample-apps/aws-sdk/deploy/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module "hello-nodejs" {
module "hello-lambda-function" {
source = "terraform-aws-modules/lambda/aws"

function_name = var.name
Expand All @@ -13,7 +13,7 @@ module "hello-nodejs" {

layers = [
var.collector_layer_arn,
var.nodejs_wrapper_layer_arn
var.sdk_layer_arn
]

environment_variables = {
Expand Down Expand Up @@ -41,7 +41,7 @@ module "api-gateway" {
source = "../../../../utils/terraform/api-gateway-proxy"

name = var.name
function_name = module.hello-nodejs.this_lambda_function_name
function_invoke_arn = module.hello-nodejs.this_lambda_function_invoke_arn
function_name = module.hello-lambda-function.this_lambda_function_name
function_invoke_arn = module.hello-lambda-function.this_lambda_function_invoke_arn
}

2 changes: 1 addition & 1 deletion nodejs/sample-apps/aws-sdk/deploy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variable "collector_layer_arn" {
// TODO(anuraaga): Add default when a public layer is published.
}

variable "nodejs_wrapper_layer_arn" {
variable "sdk_layer_arn" {
type = string
description = "ARN for the Lambda layer containing the OpenTelemetry NodeJS Wrapper"
// TODO(anuraaga): Add default when a public layer is published.
Expand Down
10 changes: 5 additions & 5 deletions python/integration-tests/function/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ resource "aws_lambda_layer_version" "collector_layer" {
source_code_hash = filebase64sha256("../../../collector/build/collector-extension.zip")
}

module "function" {
source = "../../sample-apps/deploy"
name = var.function_name
collector_layer_arn = aws_lambda_layer_version.sdk_layer.arn
python_wrapper_layer_arn = aws_lambda_layer_version.collector_layer.arn
module "hello-lambda-function" {
source = "../../sample-apps/deploy"
name = var.function_name
collector_layer_arn = aws_lambda_layer_version.sdk_layer.arn
sdk_layer_arn = aws_lambda_layer_version.collector_layer.arn
}
4 changes: 2 additions & 2 deletions python/sample-apps/deploy/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module "function" {
module "hello-lambda-function" {
source = "terraform-aws-modules/lambda/aws"

function_name = var.name
Expand All @@ -13,7 +13,7 @@ module "function" {

layers = [
var.collector_layer_arn,
var.python_wrapper_layer_arn
var.sdk_layer_arn
]

environment_variables = {
Expand Down
2 changes: 1 addition & 1 deletion python/sample-apps/deploy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variable "collector_layer_arn" {
// TODO(anuraaga): Add default when a public layer is published.
}

variable "python_wrapper_layer_arn" {
variable "sdk_layer_arn" {
type = string
description = "ARN for the Lambda layer containing the OpenTelemetry Python Wrapper"
// TODO(anuraaga): Add default when a public layer is published.
Expand Down

0 comments on commit 7355458

Please sign in to comment.