Hi Jaimin Joshi,
The error unexpected status 409 (409 Conflict) with error: RegistryErrorResponse: An error response is received from the docker registry 'index.docker.io'. Please retry later. indicates that Azure Container Instances (ACI) is having trouble pulling the nginx:latest image from Docker Hub (index.docker.io). This issue is not directly related to your Terraform configuration, but rather to Docker Hub's rate limiting or availability issues.
Leverage Azure Container Registry (ACR): Store your Docker Hub images in an ACR instance and configure your ACI and deployments to pull from this private registry. This will help you avoid the Docker Hub rate limits.
Please check this with similar issue: Azure Container issue pulling images on restart
For your reference: https://github.com/datalust/seq-tickets/discussions/2223
DockerHub Rate limit with Azure Container Instance
Please check this document: RegistryErrorResponse when creating Azure Container Instance
If you have any other queries, let me know. If the information provided above is helpful, please click on Upvote and Accept Answer on it.