GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — aws-api-gateway-example/java at master · code402/aws-api-gateway-example

Expand file tree

/

java

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

java

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src/main/java/com/code402
src/main/java/com/code402
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 
stack-custom-domain.yaml
stack-custom-domain.yaml
 
 
stack.yaml
stack.yaml
 
 

README.md

Outline

java

Without custom domain name

Build the JAR:

mvn clean compile assembly:single   # Build JAR

Upload it to a bucket that you control.

aws s3 cp target/java-demo.jar s3://code402

Create 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=code402

You 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_IAM

When you're done, delete it:

aws cloudformation --region us-east-1 delete-stack --stack-name java-demo

With custom domain name

Build the JAR:

mvn clean compile assembly:single   # Build JAR

Upload it to a bucket that you control.

aws s3 cp target/java-demo.jar s3://code402

Create 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=Z2M7YRI8V9GBAF

You 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_IAM

When you're done, delete it:

aws cloudformation --region us-east-1 delete-stack --stack-name java-custom-domain-demo
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.