Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

aws-samples/aws-serverless-vending-machine

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-serverless-vending-machine

This sample application demonstrate how to create a solution to developer teams consume IaC Products, like a "Vending Machine", to automated deploy cloud service in their AWS Accounts without open a ticket or request in IT department.

In other hand, the CCoE teams or SysOps administrators can create Cloud Products, for example, a .NET application running in ECS, Fargate and a CI/CD pipelines or operational products, like a VPC with a Transit Gateway Peering.

The Vending Machine was build using AWS Serverless components, a low cost and an easy application to support

DO NOT USE THIS SOLUTION TO CREATE A CONSOLE OVER THE AWS CONSOLE!

This sample code is made available under a modified MIT license. See the LICENSE file.

Building the examples

Dependencies

Install

First clone this repo:

git clone https://github.com/aws-samples/aws-serverless-vending-machine

Deploy the Stack file scripts/deployServerlessVendingMachine.yaml at the end check the Stack Outputs to follow the instalation process.

The next step is edit the App.js file to change the REST API endpoint:

API: {
     endpoints: [
         {
             name: "VendingMachine-API",

             //CHANGE HERE THE VENDING MACHINE API
             endpoint: "https://RESTAPIID.execute-api.sa-east-1.amazonaws.com/default",

             custom_header: async () => {
                return { Authorization: `Bearer ${(await Auth.currentSession()).getIdToken().getJwtToken()}` }
             }
         }
     ]
 }

Go to Front-end directory and run the follow commands:

cd site/vendingmachineapp/
npm install
npm run build

Go to the build folder and copy files to S3, there is a S3VendingMachineSiteBucket variable in the Stack Outputs, get the S3 bucket name and use in theses commands:

cd build
aws s3 rm s3://...-cloudfrontauthorizationedge-.... —recursive
aws s3 cp . s3://...cloudfrontauthorizationedge-.... —recursive

And now just open the Vending Machine Website. You can get the VM URL on the VendingMachineUrl variable in the Stack Output.

There are more information to add Products in the folder samples.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

About

This sample application demonstrate how to create a solution to developer teams consume IaC Products, like a "Vending Machine", to automated deploy cloud service in their AWS Accounts without open a ticket or request in IT department.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.