Class LambdaEdgeManager
- java.lang.Object
-
- pl.wrzasq.lambda.edgedeploy.service.LambdaEdgeManager
-
public class LambdaEdgeManager extends Object
Lambda API implementation.
-
-
Field Summary
Fields Modifier and Type Field Description private com.amazonaws.services.lambda.AWSLambdalambdaAWS Lambda API client.private org.slf4j.LoggerloggerLogger.private com.fasterxml.jackson.databind.ObjectMapperobjectMapperJSON generator.private com.amazonaws.services.s3.AmazonS3s3AWS S3 API client.
-
Constructor Summary
Constructors Constructor Description LambdaEdgeManager(com.amazonaws.services.lambda.AWSLambda lambda, com.amazonaws.services.s3.AmazonS3 s3, com.fasterxml.jackson.databind.ObjectMapper objectMapper)Initializes object with given Lambda client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ByteBufferbuildZipFile(EdgeDeployRequest input)Builds deployment ZIP package.pl.wrzasq.commons.aws.cloudformation.CustomResourceResponse<com.amazonaws.services.lambda.model.PublishVersionResult>create(EdgeDeployRequest input, String physicalResourceId)Handles function creation.pl.wrzasq.commons.aws.cloudformation.CustomResourceResponse<com.amazonaws.services.lambda.model.PublishVersionResult>delete(EdgeDeployRequest input, String physicalResourceId)Handles function deletion.private com.amazonaws.services.lambda.model.PublishVersionResultpublishLambdaVersion(String functionName)Publishes new version of Lambda.pl.wrzasq.commons.aws.cloudformation.CustomResourceResponse<com.amazonaws.services.lambda.model.PublishVersionResult>update(EdgeDeployRequest input, String physicalResourceId)Handles function update.
-
-
-
Field Detail
-
logger
private org.slf4j.Logger logger
Logger.
-
lambda
private com.amazonaws.services.lambda.AWSLambda lambda
AWS Lambda API client.
-
s3
private com.amazonaws.services.s3.AmazonS3 s3
AWS S3 API client.
-
objectMapper
private com.fasterxml.jackson.databind.ObjectMapper objectMapper
JSON generator.
-
-
Constructor Detail
-
LambdaEdgeManager
public LambdaEdgeManager(com.amazonaws.services.lambda.AWSLambda lambda, com.amazonaws.services.s3.AmazonS3 s3, com.fasterxml.jackson.databind.ObjectMapper objectMapper)Initializes object with given Lambda client.- Parameters:
lambda- AWS Lambda client.s3- AWS S3 client.objectMapper- JSON generator.
-
-
Method Detail
-
create
public pl.wrzasq.commons.aws.cloudformation.CustomResourceResponse<com.amazonaws.services.lambda.model.PublishVersionResult> create(EdgeDeployRequest input, String physicalResourceId)
Handles function creation.- Parameters:
input- Resource creation request.physicalResourceId- Physical ID of existing resource (if present).- Returns:
- Data about published version.
-
update
public pl.wrzasq.commons.aws.cloudformation.CustomResourceResponse<com.amazonaws.services.lambda.model.PublishVersionResult> update(EdgeDeployRequest input, String physicalResourceId)
Handles function update.- Parameters:
input- Resource update request.physicalResourceId- Physical ID of existing resource (if present).- Returns:
- Data about published version.
-
delete
public pl.wrzasq.commons.aws.cloudformation.CustomResourceResponse<com.amazonaws.services.lambda.model.PublishVersionResult> delete(EdgeDeployRequest input, String physicalResourceId)
Handles function deletion.- Parameters:
input- Resource delete request.physicalResourceId- Physical ID of existing resource (if present).- Returns:
- Data about deleted version.
-
publishLambdaVersion
private com.amazonaws.services.lambda.model.PublishVersionResult publishLambdaVersion(String functionName)
Publishes new version of Lambda.- Parameters:
functionName- Function stackSetName.- Returns:
- Published version data.
-
buildZipFile
private ByteBuffer buildZipFile(EdgeDeployRequest input)
Builds deployment ZIP package.- Parameters:
input- Function setup.- Returns:
- ZIP file buffer.
-
-