スキップしてコンテンツを表示

Host entry on Batch

0

I have a process which have to do a SOAP request to an url, but this URL doesn't exists, so I have to mock it using the /etc/hosts file. I'm using an ubuntu docker image, but it seems that AWS Batch overwrites the /etc/hosts file. I'm using the same image on AWS Lambda, and there the /etc/hosts file is preserverd and works fine. Is there a way to change that file on AWS Batch to make those requests?

Thank you!

質問済み 4年前389ビュー

2回答
0

Hello,

You can try using the Launch template support for AWS Batch for this requirement. Using launch template you can add custom userdata which will add a particular entry to /etc/hosts file on instance launch.

#!/bin/bash
echo "1.1.1.1    myexampledomain.com" >> /etc/hosts

Reference documentation: https://docs.aws.amazon.com/batch/latest/userguide/launch-templates.html

AWS
サポートエンジニア

回答済み 4年前

エキスパート

レビュー済み 2年前

0

Hi!

Thank you for the response, but I forgot to mention we are using Fargate and it seems that Launch Template are not supported by Fargate.

回答済み 4年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ