This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import boto3 | |
import os | |
from langchain.llms.bedrock import Bedrock | |
from langchain import PromptTemplate | |
from typing import Optional, List, Mapping, Any, Dict | |
from langchain.retrievers import AmazonKendraRetriever | |
from langchain.chains import RetrievalQA | |
S3_BUCKET_NAME = os.environ["S3_BUCKET_NAME"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Resources for re:Invent SVS402", | |
"description": "Learsn how to build a complete serverless web application for a popular theme park called Innovator Island. The theme park is rolling out a mobile app that provides thousands of visitors with wait times, photo opportunities, notification alerts, and language translation for visitors who need it. In this series, you'll get hands-on experience building a scalable serverless application with a single-page application (SPA) front-end that delivers a feature-rich user experience. Expect to leave this series with a solid understanding of serverless concepts like event-driven computing and real time messaging, as well practical hands-on experience deploying a serverless mobile front-end and using IoT to send messages to thousands of users in real time. Your experience with Innovator Island will prepare you to bring serverless best practices to your next serverless application.", | |
"introBox": { | |
"headline": "Decoupling serverless workloads with Ama |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This creates a VPC with two public subnets and two private subnets in two Availability Zones, | |
# together with a NAT Gateway and associated routing. Change the Availability Zone locations as needed. | |
# Important: this configures various AWS services and there are costs associated with these services after the Free Tier usage. | |
# Please see the AWS Pricing pages for details. You are responsible for any AWS costs incurred. | |
# No warranty is implied in this example. | |
# Usage from command line: | |
# aws cloudformation --region <<YOUR-REGION>> create-stack --stack-name vpc- --template-body file://vpc-setup.yaml | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/environment/theme-park-backend/ | |
git pull | |
cd ~/environment/theme-park-backend/1-app-deploy/sam-app/ | |
sam package --output-template-file packaged.yaml --s3-bucket $s3_deploy_bucket | |
sam deploy --template-file packaged.yaml --stack-name theme-park-backend --capabilities CAPABILITY_IAM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: EventBridge Rule Test | |
Resources: | |
CFNLogGroup: | |
Type: AWS::Logs::LogGroup | |
Properties: | |
RetentionInDays: 3 | |
LogGroupName: '/aws/events/eventbridgeLog' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>*</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>PUT</AllowedMethod> | |
<AllowedMethod>POST</AllowedMethod> | |
<AllowedMethod>HEAD</AllowedMethod> | |
<AllowedHeader>*</AllowedHeader> | |
</CORSRule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
MIT No Attribution | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
software and associated documentation files (the "Software"), to deal in the Software | |
without restriction, including without limitation the rights to use, copy, modify, | |
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | |
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | |
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
MIT No Attribution | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
software and associated documentation files (the "Software"), to deal in the Software | |
without restriction, including without limitation the rights to use, copy, modify, | |
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: docker:latest | |
variables: | |
- enableCostAnalysis: "true" | |
before_script: | |
- apt-get update -y # Updating the Ubuntu Docker instance. | |
- python -V # Print out python version for debugging. | |
- apt install -y zip jq | |
- pip install awscli --upgrade --user |