Giter Club home page Giter Club logo

aws-reinvent-trivia-game's Introduction

AWS re:Invent Trivia Game

Sample trivia game built with AWS Fargate, AWS Lambda, and Amazon Lex. See reinvent-trivia.com for a running example.

Components

  • Backend API Service (folder): REST API that serves trivia questions and answers. Runs on AWS Fargate, either with Amazon ECS or with Amazon EKS.
  • Static Site (folder): Web application page, backed by Amazon S3, Amazon CloudFront, and Amazon Route53.
  • Chat Bot (folder): Conversational bot that asks trivia questions and validates answers, and can be integrated into Slack workspace. Running on Amazon Lex and AWS Lambda.
  • Continuous Delivery (folder): Pipelines that deploy code and infrastructure for each of the components.
  • Canaries (folder): Monitoring canaries to continuously test the application and alarm in case of issues.
  • Alarms (folder): E-mail and chat notifications for alarms in case of issues.

The components above are almost entirely deployed with AWS CloudFormation, using either the AWS Cloud Development Kit or the AWS Serverless Application Model.

License Summary

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

Credits

Static site based on React Trivia

aws-reinvent-trivia-game's People

Contributors

chriscoombs avatar clareliguori avatar dependabot-preview[bot] avatar dependabot[bot] avatar michaelmoussa avatar somanyhs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-reinvent-trivia-game's Issues

Seeking some clarification on your article

Hi Clare, sorry that I've raised this as an issue in an unrelated repo, but i didn't know how to contact you otherwise.. And thanks for your sessions at Reinvent ( the stay at home version ).. Helpful stuff! and quite timely.

I'm actively using cdk-pipelines which is still in experimental.. One of the topics that is being discussed is if a pipeline should only have a single source. As coded right now, it only as one, and i've found that to be quite restrictive.

Your article ( https://aws.amazon.com/builders-library/automating-safe-hands-off-deployments/ ) is being used as a reference, to model it from ( see aws/aws-cdk#10872 )..

I've re-read your article several times, and i cant' find anything to suggest that a pipeline can only have one source. The only suggestion in your article is that 'Source' has been shown as a single box in some of the diagrams.

I have a use case where i don't' have much choice but to have multiple sources, because the ownership/business models precludes it all from being in a single source. My IaC repo is in one place, and the repos for a number of containers are owned by others in other places. However, a commit in either place, needs to trigger some changes. I'd love to have everything in one place, but it just wont' happen.

I've hacked a solution together to get around it, by having my code build post stage kick of the cdk pipelines, after its finished building an image and placing it in ECR.

  post_build:
    commands: |
      echo Build completed on $(date)
      echo Pushing the Docker image...
      docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
      aws ssm put-parameter --name "/$INFRA_PIPELINE/$IMAGE_NAME/CurrentTag" --type "String" --value "$IMAGE_TAG" --overwrite
      aws codepipeline start-pipeline-execution --name $INFRA_PIPELINE

This feels like a 'hacky' hack.

Is their any chance you could clarify if you article really meant that there should only be one source?

Todo: let pipelines update themselves

When changes to the pipeline CDK code occur, it's annoying to manually re-synthesize and deploy each pipeline. Add a step to each pipeline that synthesizes its own CloudFormation template and deploys it. Then, we only need to manually run the CDK CLI when bootstrapping a new pipeline.

Deploys using EXTERNAL deployment controller

How are new versions of the backend deployed when using the CloudFormation infra for EXTERNAL deployment controller?
https://github.com/aws-samples/aws-reinvent-2019-trivia-game/tree/master/trivia-backend/infra/cfn-task-sets

Deploying EXTERNAL task sets are not discussed here https://github.com/aws-samples/aws-reinvent-2019-trivia-game/tree/master/trivia-backend

Would I use the CLI to create a new taskdefinition referencing the new image, and a new taskset aws ecs register-task-definition aws ecs create-task-set and then update the primary taskset aws ecs update-service-primary-task-set? But then CloudFormation will be out of sync and future stack updates may fail.

Todo: switch pipelines to use CodeStar Connections

The pipeline CDK code currently configures the pipeline source actions using "GitHub V1" action with a GitHub personal access token. Switch the code to instead use the "V2" action using CodeStar Connections to connect the pipeline to the GitHub repository.

reinvent-trivia-game-static-site pipeline : Add cdk bootstrap to buildspec.yml

Pipeline of reinvent-trivia-game-static-site failed because of this error

TriviaGameStaticSiteInfraTest: deploying...

   TriviaGameStaticSiteInfraTest failed: Error: This stack uses assets, so the toolkit stack must be deployed to the environment (Run "cdk bootstrap aws://xx/us-east-1")
This stack uses assets, so the toolkit stack must be deployed to the environment (Run "cdk bootstrap aws://xx/us-east-1")
npm ERR! code ELIFECYCLE

Need to add this code line to https://github.com/aws-samples/aws-reinvent-2019-trivia-game/blob/master/static-site/buildspec.yml#L13

Can you create Certificates in the same stack as the bluegreenhook?

I've used your code as the basis for another project, but run into a problem.

(https://github.com/aws-samples/aws-reinvent-2019-trivia-game/blob/master/trivia-backend/infra/cdk/ecs-service-blue-green.ts)

If i create the cert for the load balancer in the same stack as the bluegreen hook, cloudformation fails on updates.. ( it thinks theres a change in the cert )..

In your code you've imported the cert from an existing one.

I wonder if you've tryed to create a cert in the same stack. I raised a support ticket, and the support engineer found an internal aws ticket about this issue, but its not very clear...

This was the errors i got from CF.

2021-01-17 19:41:55 UTC+1300	TaskCertificateechoserverdevcontactappsnz2459CD99	UPDATE_FAILED	1 validation error detected: Value null at 'domainValidationOptions.1.member.validationDomain' failed to satisfy constraint: Member must not be null (Service: AWSCertificateManager; Status Code: 400; Error Code: ValidationException; Request ID: 07f4dd7a-743e-47e7-b102-7e49ee148dd6; Proxy: null)

2021-01-17 19:41:55 UTC+1300	TaskCertificateechoserverdevcontactappsnz2459CD99	UPDATE_IN_PROGRESS	Requested update requires the creation of a new physical resource; hence creating one.
Stack ID(s) / Stack ARN: arn:aws:cloudformation:ap-southeast-2:2xxxxxxxxxx4:stack/gnd-dev-ApplicationStack/7ca8f4f0-5869-11eb-b947-0663c7d01c4a

Trigger for each of the delivery pipelines

Hi,

First of all, it's a great project to learn from! Thanks for building it ๐Ÿ˜ƒ.

Do I understand correctly that all pipelines will run on each commit? If so, wouldn't it be preferable (from time, cost and operations perspective) to have a separate Git repository for each component? That would include the pipeline, infrastructure and runtime.

I understand that it is much easier to reason about the workload when it is in the same Git repository. On the other hand, some components (generally) can have very different change rates and reasons from other components. This can make rollbacks and bisecting difficult.

How do i deploy the demo..

Hi, thanks for an excellent session at reinvent. A really useful set of info.

i was wondering if there was any more info on how to deploy this demo?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.