Two scenarios are provided:
- Public
- Public with VPC Connector
Create the ECR and other modules:
terraform -chdir="infra" init
terraform -chdir="infra" apply -auto-approveNow, build and push the Java application to ECR:
(cd ./apps/java; bash ./ecrBuildPush.sh)Create the .auto.tfvars file:
touch infra/.auto.tfvarsSet the instance type:
# Choose one
app_runner_workload = "PUBLIC"
app_runner_workload = "PUBLIC_WITH_VPC"Apply again to create the App Runner instance:
terraform -chdir="infra" apply -auto-approveTesting the Java service:
curl https://<service-id>.us-east-2.awsapprunner.com/actuator/healthBuild and run the image:
docker build -t javaapp-local .
docker run --rm -p 8080:8080 -e OBSERVABILITY_ENABLED=1 -e XRAY_LOGGING_LEVEL=INFO -e OTEL_JAVAAGENT_DEBUG=false -t javaapp-localDestroy the resources when done:
terraform -chdir="infra" destroy -auto-approve