Let's assume that there's only one container started from the docker hub nginx image. And lets imagine that it uses a mysql database to store data.
So the app itself and it's deployment looks something like the following:
flowchart TD
User[Browser] --> |http/https request| LB;
LB[Load Balancer] -->|http request| ec1[instance1];
LB -->|http| ec2[instance2];
ec1 <--> DB[(Data Base)];
ec2 <--> DB;
Registry --> |docker pull app image| CD;
CI --> |docker push app image| Registry;
CD --> |deploy| ec1 & ec2
Or the app and CI/CD separately.
flowchart TD
User[Browser] --> |http/https| LB;
LB[Load Balancer] -->|http| ec1[instance1];
LB -->|http| ec2[instance2];
ec1 <--> DB[(Data Base)];
ec2 <--> DB;
flowchart TD
Registry --> |docker pull app image| CD;
CI --> |docker push app image| Registry;
CD --> |deploy| ec1[instance1] & ec2[instance2]
Please create the infrastructure as code leaving out the actual CI and CD. You can pick the tools/languages and underlying cloud that you are most comfortable with. This is a practical task, so some IaC or configs/scripts are required.
You are not expected to be thorough, but pick parts that make most sense to go into a code repository in your opinion. Making assumptions and cutting corners is fine. Please document the decision making related to that.
You can submit your code/comments as a pull request to this repository.