fix(aws/lambda): Support upsert of  event source configurations in lambda aliases
MODIFY
clouddriver-lambda/src/main/java/com/netflix/spinnaker/clouddriver/lambda/deploy/description/UpsertLambdaFunctionEventMappingDescription.java
clouddriver-lambda/src/main/java/com/netflix/spinnaker/clouddriver/lambda/deploy/description/UpsertLambdaFunctionEventMappingDescription.java
@@ -23,7 +23,7 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = false)
public class UpsertLambdaFunctionEventMappingDescription extends AbstractLambdaFunctionDescription {
String functionName;
-
+ String qualifier;
Integer batchsize = 1;
Boolean enabled = false;
String eventSourceArn = null;

MODIFY
clouddriver-lambda/src/main/java/com/netflix/spinnaker/clouddriver/lambda/deploy/ops/UpsertLambdaEventSourceAtomicOperation.java
clouddriver-lambda/src/main/java/com/netflix/spinnaker/clouddriver/lambda/deploy/ops/UpsertLambdaEventSourceAtomicOperation.java
@@ -22,6 +22,7 @@ import com.netflix.spinnaker.clouddriver.lambda.cache.model.LambdaFunction;
import com.netflix.spinnaker.clouddriver.lambda.deploy.description.UpsertLambdaFunctionEventMappingDescription;
import com.netflix.spinnaker.clouddriver.orchestration.AtomicOperation;
import java.util.List;
+import org.pf4j.util.StringUtils;
public class UpsertLambdaEventSourceAtomicOperation
extends AbstractLambdaAtomicOperation<UpsertLambdaFunctionEventMappingDescription, Object>
@@ -67,6 +68,12 @@ public class UpsertLambdaEventSourceAtomicOperation
.withEnabled(description.getEnabled())
.withUUID(description.getUuid());
+ if (StringUtils.isNotNullOrEmpty(description.getQualifier())) {
+ String fullArnWithQualifier =
+ String.format("%s:%s", cache.getFunctionArn(), description.getQualifier());
+ request.setFunctionName(fullArnWithQualifier);
+ }
+
UpdateEventSourceMappingResult result = client.updateEventSourceMapping(request);
updateTaskStatus("Finished Updating of AWS Lambda Function Event Mapping Operation...");
@@ -85,6 +92,12 @@ public class UpsertLambdaEventSourceAtomicOperation
.withStartingPosition(description.getStartingPosition())
.withEventSourceArn(description.getEventSourceArn());
+ if (StringUtils.isNotNullOrEmpty(description.getQualifier())) {
+ String fullArnWithQualifier =
+ String.format("%s:%s", cache.getFunctionArn(), description.getQualifier());
+ request.setFunctionName(fullArnWithQualifier);
+ }
+
CreateEventSourceMappingResult result = client.createEventSourceMapping(request);
updateTaskStatus("Finished Creation of AWS Lambda Function Event Mapping Operation...");

fix(aws/lambda): Support upsert of  event source configurations in lambda aliases (#4956)

Co-authored-by: smaniyedath <shyam_maniyedath@intuit.com>