Terragrunt gives the permission denied error while it try to open the terragrunt.hcl file in ecs fargate instance not sure what is going on wrong for an instance placing the dockerfile and logs content as well
FROM runatlantis/atlantis:latest
ENV DEFAULT_TERRAFORM_VERSION=1.0.2
RUN apk add python3 &&
apk add py3-pip &&
pip3 --no-cache-dir install --upgrade awscli &&
apk add jq
EXPOSE 4141
COPY terragrunt.hcl /usr/local/bin/terragrunt.hcl
RUN chmod +x /usr/local/bin/terragrunt.hcl
COPY get_creds.sh /home/atlantis/get_creds.sh
RUN chmod +x /home/atlantis/get_creds.sh
ARG TERRAGRUNT_VERSION=v0.31.1
ENV TERRAGRUNT_VERSION=$TERRAGRUNT_VERSION
Download Terragrunt
RUN curl -s -Lo terragrunt https://github.com/gruntwork-io/terragrunt/releases/download/${TERRAGRUNT_VERSION}/terragrunt_linux_amd64 &&
chmod +x terragrunt &&
mv terragrunt /usr/local/bin && chmod +x /usr/local/bin/terragrunt &&
terragrunt --version | grep “v${TERRAGRUNT}”
RUN chown -R atlantis:atlantis /usr/local/bin/atlantis
COPY override.tf /home/atlantis/override.tf
COPY policies /home/atlantis/policies/
COPY workflow.yaml /home/atlantis/workflow.yaml
CMD [“server”]
And while executing it I get the below error :
exit status 1: running "terragrunt hclfmt --terragrunt-hclfmt-file /usr/local/bin/terragrunt.hcl" in "/home/atlantis/repos/ninjahck/IAC/21/default":
time=2021-07-28T14:05:41Z level=info msg=Formatting hcl file at: /usr/local/bin/terragrunt.hcl.
time=2021-07-28T14:05:41Z level=info msg=Formatting /usr/local/bin/terragrunt.hcl
time=2021-07-28T14:05:41Z level=error msg=open /usr/local/bin/terragrunt.hcl: permission denied
time=2021-07-28T14:05:41Z level=error msg=Unable to determine underlying exit code, so Terragrunt will exit with error code 1