Giter Site home page Giter Site logo

good-parts / aws-bootstrap Goto Github PK

View Code? Open in Web Editor NEW
576.0 14.0 97.0 6.06 MB

A template for setting up an AWS environment from scratch.

Home Page: https://gum.co/aws-good-parts

JavaScript 20.09% Shell 79.91%
aws aws-bootstrap cloudformation code-build code-deploy continous-deployment

aws-bootstrap's Introduction

AWS Bootstrap

This is the source code from The Bootstrap Guide of The Good Parts of AWS. The final result is a template for setting up a new AWS environment from scratch, and each code commit follows the checkpoints in the book.

Userbase

Book Sample

Here's a sample from the book. No email address necessary.

Contents

  • Preface
  • Part 1: The Good Parts
    • The Default Heuristic
    • DynamoDB
    • S3
    • EC2
    • EC2 Auto Scaling
    • Lambda
    • ELB
    • CloudFormation
    • Route 53
    • SQS
    • Kinesis
  • Part 2: The Bootstrap Guide
    • Starting from Scratch
    • Infrastructure as Code
    • Automatic Deployments
    • Load Balancing
    • Scaling
    • Production
    • Custom Domains
    • HTTPS
    • Network Security

aws-bootstrap's People

Contributors

dvassallo avatar jpschorr 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

aws-bootstrap's Issues

PDF book: First 'Release Change' fails on npm run

Version 1.1

On page 82, the first deployment can take place by hitting "Release Change" in the console. However this fails because there is no npm test target.

The fix is to remove the 'test' and 'build' commands from buildspec.yml (defined on page 71) and replace with npm start.

aws_b_fail.log

trouble with first cloud formation script

I'm having trouble getting the first cloud formation script to fully execute....It will run for several minutes and even start creating instances, but ultimately it rolls back the entire stack. Do you have any ideas for common errors or omissions? I included the screen shot with the error i'm getting and a zip file with the deploy and yaml files. I'm trying this on a windows system using git bash.
***when i tried to copied the code as-is from the lesson console and tried to run it, i was getting an error about the parameter override argument so i tried to tweak it based on similar question/answers in stack overflow. I don't know if I have it correct now, but my current problem doesn't seem related to that. Is this a common thing or do I have to tweak something in my bash setup?
thanks and I'm really learning a lot already. I'm studying for the csaa cert and this has helped to cement a lot of concepts.
Thanks.
main2.zip
image

ec2 instance refuse to connect error

Hey sorry if this is a silly question but I've been struggling for quite a while and can't figure out the problem - any hints or help would be greatly appreciated! I've successfully created the code pipeline for automatic deployments (in that there are no errors, managed to get the

Successfully created/updated stack - awsbootstrap
[
    "http://ec2-18-141-142-6.ap-southeast-1.compute.amazonaws.com:8080"
]

message, checked my CloudFormation stacks and ec2 instance and saw create_complete, instance running etc. However, when I try to navigate to http://ec2-18-141-142-6.ap-southeast-1.compute.amazonaws.com:8080, I get a "This site can't be reached" error.

This site can’t be reached. ec2-18-141-142-6.ap-southeast-1.compute.amazonaws.com refused to connect.

Similarly, running curl http://ec2-18-141-142-6.ap-southeast-1.compute.amazonaws.com:8080 in my terminal returns:

curl: (7) Failed to connect to ec2-18-141-142-6.ap-southeast-1.compute.amazonaws.com port 8080: Connection refused

May I ask how to solve this?

I've tried googling and one of the links said that I should troubleshoot by logging in the instance over ssh with my my_key.pem but I'm not sure I have that?

PDF-book Version 1.3, 2020-02-03: error when setting up nested Staging stack

Hey @dvassallo , fist of all thank you for such an awesome book. I feel like it's a great way to get my feet wet on infrastructure-as-code on AWS 💪

I had an issue when setting up the nested Staging stack. By following the book's instructions in the section Creating a nested stack for staging I got the following error when attempting to deploy the infra:

Unable to fetch parameters ami-XXXXXX from parameter store for this account cloudformation

under the logical id Staging.

I came here to compare my code and found the issue: When the book says to create stage.yml as a copy of main.yml, after following the steps, we end up with the following EC2AMI in stage.yml:

EC2AMI:
    Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
    Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2'

which causes the error. By changing it to a Type: String like here 629ab65#diff-66ce0f88586a9e9a7f4f95e1483718f6R7 it got sorted out.

I searched in the book (V1.3) and didn't find any mention of this. Apologies in case I missed it!

Thanks.

Bug: Cannot delete your epub book in MacOS Books app

Hi Daniel,

For reasons I do not know, after I dropped your epub book to my Books app, they cannot be deleted. I drop 1 more copy to try delete and I can't delete too. But I can still open both of them in the app.

I believe this is a bug in your epub book because I can delete all other epub Books I dropped into the Official Apple MacOS Books app. Books by other Gumroad, Leanpub, apress, oreilly.etc authors

Thank you

PDF-book Version 1.2, 2020-01-10: errors in ASG configuration description

On page 106, in the main.yml example, there are two lines annotated with number (1).

The first description for (1) says "The WaitOnResourceSignal works for ASGs in the same way that the CreationPolicy worked on individual instances."; I believe it should be "The UpdatePolicy works..."

The actual "WaitOnResourceSignals" parameter, which is also annotated with (1), is not documented at all.

The remaining descriptions are off by one.

PDF book: EC2AMI value never gets set

I am working with Version 1.1, 2019-12-29

On page 74, the config has the EC2AMI value is defined:

  EC2AMI:
    Type: String
    Description: 'The EC2 AMI. Only tested on Amazon Linux 2.'

This is different to the value on page 57 where it is initially set:

EC2AMI:
  Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>' 
  Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2'

So by the time deployment is run (page 64), this value is not set.

In this repo I can see that it is passed in as a param, so this may be a mistake in the book. We either should not delete the Default, or we should pass EC2AMI in as a parameter.

The fix is to re-add the Default string

Update

From page 122, Running ./deploy-infra.sh fails with the error:

unable to fetch parameters [ami-xyz] from parameter store for this account

If you check the parameter store for the stack, then this value is present.

The fix is to pass the AMI as a parameter override, eg:

EC2AMI=ami-01f14919ba412de34 \

The parameter has to be declared in stage.yml and main.yml as follows:

Parameters:
  EC2AMI:
    Type: String

Also page 122, typo: "Within a few of minutes"

Need a VPC error when trying to run the CloudFormation step in Chapter 2

Book version: 1.3, 2020-02-03

I am getting this error in Chapter 2 when I run the ./deploy-infra.sh step...

The specified instance type can only be used in a VPC. A subnet ID or network interface ID is required to carry out the request. (Service: AmazonEC2; Status Code: 400; Error Code: VPCResourceNotSpecified; Request ID: 5bdea2d7-db4a-42ef-9932-8311faef9cc0; Proxy: null)

Anand

Script working when using IAM User. Not working when using AWS SSO user.

My organization initially gave me IAM Role access and the script was working. However this changed to AWS SSO Access, and I'm logging in with my Azure AD account.

Even when I have updated the credentials file with the key and secret key for programmatic access, I still get a "Unable to locate credentials. You can configure credentials by running "aws configure". " error.

I have tried running aws configure and the error still persists.

This line is the one which is giving me the error in the deploy-infra.sh file.

AWS_ACCOUNT_ID=aws sts get-caller-identity --profile awsbootstrap --query "Account" --output text

I am running this on Windows with the GitBash terminal and this is the error when running deploy-infra.sh

$ ./deploy-infra.sh

Unable to locate credentials. You can configure credentials by running "aws configure".

=========== Deploying setup.yml ===========

Unable to locate credentials. You can configure credentials by running "aws configure".

=========== Packaging main.yml ===========
ERROR while running 'aws cloudformation package' command:
Unable to locate credentialsage.yml referenced by TemplateURL parameter of Prod resource.

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.