@anand-murugan-0 I run FusionAuth in ECS/Fargate. I don't know about the clustering side, but to make standing up a FusionAuth instance automated I needed to do 2 things:
-
enable Silent Mode https://fusionauth.io/docs/v1/tech/guides/silent-mode which skips the first boot / migration page. This required passing in database credentials as env vars, so that Fusionauth doesn't need to ask you for them.
-
Use a
kickstart.json
to configure an API key https://fusionauth.io/docs/v1/tech/installation-guide/kickstart#using-environment-variables
Adding a kickstart.json file to a docker image in ECS is a bit non-trivial (either with EFS or S3). So I made my own Dockerfile:
FROM fusionauth/fusionauth-app:1.38.1
ARG FUSIONAUTH_APP_KICKSTART_VALUE
ENV FUSIONAUTH_APP_KICKSTART_FILE=/tmp/kickstart.json
RUN echo ${FUSIONAUTH_APP_KICKSTART_VALUE} > ${FUSIONAUTH_APP_KICKSTART_FILE}
When running docker build, if you pass in an argument like
docker build \
--build-arg FUSIONAUTH_APP_KICKSTART_VALUE="{\"apiKeys\": [{\"key\": \"42\" } ] }" \
.
will build and write out a /tmp/kickstart.json
file and tell Fusionauth to look at that path when it starts up. NOTE: any random value would work, I picked 42
for simplicity, don't use this in Production.
With those 2 things, ECS will start a Fusionauth instance that doesn't prompt for initial installation (assuming you pass in db credentials as environment variable) and will