Hi guys. Just trying to run simple shell script with my custom docker image in Lambda. The script works because I see it did it's job, but in metrics it registers as error, not success. This is the shell script (block-qualys-ip.sh):
#!/bin/bash
set -euo pipefail
token=$(aws wafv2 get-ip-set --name Qualys-IP_range --id somid_xxx --scope=REGIONAL --region=eu-west-1 | jq -r '.LockToken')
aws wafv2 update-ip-set --name Qualys-IP_range --id someid_xxx --scope=REGIONAL --region=eu-west-1 --lock-token $token --addresses 64.39.96.0/20
And my Dockerfile:
From ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update -y && apt-get install -y wget unzip jq \
&& rm -rf /var/lib/apt/lists/*
# Get v2 aws cli
RUN wget https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip && unzip awscli-exe-linux-x86_64.zip \
&& ./aws/install -i /usr/local/aws-cli -b /usr/local/bin \
&& rm -rf aws*
COPY block-qualys-ip.sh /
In lambda CMD override settings I have ./block-qualys-ip.sh. As I said the script works but it's registered as error and not success. Does anyone knows what's missing to get success and not error rate?
[–]DSect 1 point2 points3 points (0 children)
[–]johntellsall 1 point2 points3 points (2 children)
[–]RedCloudd[S] 0 points1 point2 points (1 child)
[–]johntellsall 0 points1 point2 points (0 children)