Frontend service to visualize the results of the votes.
The "results" service illustrates how you can have multiple services share the same load balancer. The "vote" service listens on "/" whereas "results" listens on "/results". AWS Copilot handles creating multiple listener rules for you and assigning them a priority.
- Install the AWS Copilot CLI https://aws.github.io/copilot-cli/
- Run
$ copilot init
- Enter "voting-app" for the name of your application.
- Select "Load Balanced Web Service" for the service type.
- Enter "results" for the name of the service.
- Say "Y" to deploying to a "test" environment 🚀
Once deployed, your service will be accessible at an HTTP endpoint provided by the CLI like: http://votin-publi-anelun2kxbrl-XXXXXXX.YYYYY.elb.amazonaws.com/results
AWS Copilot uses AWS CloudFormation under the hood to provision your infrastructure resources.
You should be able to see a voting-app-test-results
stack that yours ECS service along with all the peripheral resources
needed for logging, service discovery, and more...
Copilot stores the infrastructure-as-code for your service under the copilot/
directory.
copilot
└── results
└── manifest.yml
The manifest.yml
file under results/
holds the common configuration for a "load balanced web service" pattern.
The difference between the manifest in the "vote" service and
"results" is the http.path
field.
If you'd like to delete only the service from the "voting-app" application.
$ copilot svc delete
If you'd like to delete the entire application including other services and deployment environments:
$ copilot app delete