Created
November 24, 2018 21:30
-
-
Save kyleian/294cbacac7cde81dbe21ff57beaffb91 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_lambda_function" "api" { | |
s3_bucket = "${aws_s3_bucket_object.api.bucket}" | |
s3_key = "${aws_s3_bucket_object.api.key}" | |
s3_object_version = "${aws_s3_bucket_object.api.version_id}" | |
function_name = "${var.resource_prefix}-api" | |
description = "${var.project_name} API" | |
role = "${aws_iam_role.lambda_execution.arn}" | |
runtime = "${var.lambda_runtime}" | |
timeout = "${var.lambda_timeout}" | |
memory_size = "${var.lambda_memory_size_api}" | |
handler = "${var.lambda_handler_api}" | |
environment { | |
variables { | |
ENV = "${var.env}" | |
SFTP_SERVER = "${var.sftp_server}" | |
SFTP_PATH = "${var.sftp_path}" | |
SFTP_USERNAME = "${var.sftp_username}" | |
SFTP_PASSWORD = "${var.sftp_password}" | |
} | |
} | |
vpc_config = { | |
subnet_ids = "${var.lambda_subnets}" | |
security_group_ids = "${var.lambda_security_groups}" | |
} | |
} | |
resource "aws_lambda_function" "ping" { | |
s3_bucket = "${aws_s3_bucket_object.api.bucket}" | |
s3_key = "${aws_s3_bucket_object.api.key}" | |
s3_object_version = "${aws_s3_bucket_object.api.version_id}" | |
function_name = "${var.resource_prefix}-api" | |
description = "${var.project_name} API" | |
role = "${aws_iam_role.lambda_execution.arn}" | |
runtime = "${var.lambda_runtime}" | |
timeout = "${var.lambda_timeout}" | |
memory_size = "${var.lambda_memory_size_api}" | |
handler = "${var.lambda_handler_api}" | |
environment { | |
variables { | |
ENV = "${var.env}" | |
} | |
} | |
# Required for access to the Platform | |
vpc_config = { | |
subnet_ids = "${var.lambda_subnets}" | |
security_group_ids = "${var.lambda_security_groups}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment