Build the JAR:
mvn clean compile assembly:single # Build JARUpload it to a bucket that you control.
aws s3 cp target/java-demo.jar s3://code402Create the AWS CloudFormat stack. You'll need to change the end of the line to tell it which S3 bucket contains the JAR in:
aws cloudformation --region us-east-1 create-stack --stack-name java-demo --template-body file://stack.yaml --capabilities CAPABILITY_IAM --parameters ParameterKey=S3Bucket,ParameterValue=code402You can check the progress at the AWS dashboard.
The outputs tab will show the URL of your API, e.g. something like https://p8nf9ly3s4.execute-api.us-east-1.amazonaws.com/echo
Future updates to the stack should use update-stack instead of create-stack:
aws cloudformation --region us-east-1 update-stack --stack-name java-demo --template-body file://stack.yaml --capabilities CAPABILITY_IAMWhen you're done, delete it:
aws cloudformation --region us-east-1 delete-stack --stack-name java-demoBuild the JAR:
mvn clean compile assembly:single # Build JARUpload it to a bucket that you control.
aws s3 cp target/java-demo.jar s3://code402Create the AWS CloudFormat stack. You'll need to change the end of the line to tell it which S3 bucket contains the JAR in:
aws cloudformation --region us-east-1 create-stack --stack-name java-custom-domain-demo --template-body file://stack-custom-domain.yaml --capabilities CAPABILITY_IAM --parameters ParameterKey=S3Bucket,ParameterValue=code402 ParameterKey=DomainName,ParameterValue=java-echo.code402.com ParameterKey=HostedZoneId,ParameterValue=Z2M7YRI8V9GBAFYou can check the progress at the AWS dashboard.
The outputs tab will show the URL of your API, e.g. something like https://p8nf9ly3s4.execute-api.us-east-1.amazonaws.com/echo
Future updates to the stack should use update-stack instead of create-stack:
aws cloudformation --region us-east-1 update-stack --stack-name java-custom-domain-demo --template-body file://stack-custom-domain.yaml --capabilities CAPABILITY_IAMWhen you're done, delete it:
aws cloudformation --region us-east-1 delete-stack --stack-name java-custom-domain-demo