Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stitcher CPR work - use aws service discovery rather than dig ti find IPs #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ RUN apk add --no-cache \
bind-tools \
;

RUN apk add python curl
RUN curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
RUN unzip awscli-bundle.zip
RUN ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

ENV RSYSLOG=y

COPY render_cfg.sh /
Expand Down
4 changes: 2 additions & 2 deletions render_cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ else

# Resolve DNS
for _service in ${service//,/ }; do
dig $_service 2>/dev/null | grep ^$_service | awk '{print $5}'
done | sort | paste -sd ',' > $tmpfile
aws servicediscovery list-instances --service-id $_service --query 'Instances[].Attributes.AWS_INSTANCE_IPV4' --output text --region eu-west-1
done | tr '\t' '\n' | sort | paste -sd ',' > $tmpfile
if [ $(wc -c $tmpfile | gawk '{print $1}') -eq 0 ]; then
rm $tmpfile
echo "Unable to resolve addresses for $service "
Expand Down