Skip to content

Accessing the Web UI

The terraform-aws-ecs-express-mode-demo container exposes a Swagger UI at the /docs path. Once your Express Gateway Service
The aws_ecs_express_gateway_service Terraform resource that provisions an ECS service with managed ALB, auto scaling, and simplified configuration for HTTP/HTTPS web applications and APIs.
is running and healthy, retrieve the URL and open it in your browser:

Terminal window
terraform output -raw web_ui_url

Copy the printed URL into your browser’s address bar. The root URL returns 404 by design — the demo serves its UI at /docs.

The Swagger UI provides an interactive interface for exploring and testing the API endpoints without needing a separate HTTP client. You can view request schemas, try out endpoints directly in the browser, and inspect response payloads.

PLACEHOLDER: Swagger UI at /docs endpoint

The demo application uses Amazon Bedrock
AWS fully managed service providing foundation models for generative AI applications.
with a Foundation Model
A pre-trained large language or multimodal model available through Amazon Bedrock.
to perform image analysis. The API accepts an image and returns a natural-language description generated by the model through an Inference Profile
A Bedrock configuration that specifies model parameters and routing for inference requests.
.

The image analysis request follows this path:

  1. Client sends a POST request to the /analyze endpoint via the Swagger UI or any HTTP client
  2. The container receives the request and prepares a multimodal inference call
  3. The container invokes Bedrock using the Task Role credentials (scoped to foundation model and inference profile ARNs)
  4. Bedrock processes the image with the configured foundation model and returns a text response
  5. The container returns the model’s analysis as a JSON response to the client

The API supports multiple ways to provide an image for analysis:

Input MethodDescriptionExample Usage
Base64-encoded stringImage data encoded as a base64 string in the JSON request body

Include the image bytes directly in the image field of the POST payload

URL referenceA publicly accessible URL pointing to the image file

Pass the image URL in the image_url field and the container fetches it before sending to Bedrock

The API returns a JSON response containing the model’s analysis:

{
"description": "The image shows a golden retriever sitting on a grassy lawn...",
"model_id": "anthropic.claude-3-sonnet-20240229-v1:0",
"input_tokens": 1024,
"output_tokens": 256
}

The response includes the generated description, the model identifier used for inference, and token usage metrics. Token counts help you estimate costs and monitor usage patterns.

You can test the image analysis endpoint directly from the Swagger UI:

  1. Open the web_ui_url output in your browser (or navigate to /docs on your Application URL
    The unique Express-provisioned HTTPS URL on *.ecs.<region>.on.aws used for all normal application traffic.
    )
  2. Expand the POST /analyze endpoint
  3. Click Try it out
  4. Provide an image using one of the supported input methods (base64 string or URL)
  5. Click Execute to send the request
  6. Review the response body containing the model’s image description

Alternatively, use curl from the command line:

Terminal window
SERVICE_URL=$(terraform output -raw service_url)
Terminal window
curl -X POST "${SERVICE_URL}/analyze" \
-H "Content-Type: application/json" \
-d '{"image_url": "https://placehold.co/600x400/png"}'