Giter Site home page Giter Site logo

awsinaction / code2 Goto Github PK

View Code? Open in Web Editor NEW
182.0 19.0 107.0 15.78 MB

Code of Amazon Web Services in Action, Second Edition

Home Page: https://bit.ly/amazon-web-services-in-action-2nd-edition

License: MIT License

HTML 6.08% JavaScript 74.64% PowerShell 4.42% Shell 13.60% Python 1.27%
aws amazon-web-services manning

code2's Introduction

Amazon Web Services in Action, Second Edition

Cover of Amazon Web Services in Action, Second Edition

Code of Amazon Web Services in Action, Second Edition

About the book

Amazon Web Services in Action, Second Edition is a comprehensive introduction to computing, storing, and networking in the AWS cloud. You'll find clear, relevant coverage of all the essential AWS services you to know, emphasizing best practices for security, high availability and scalability. The practical, hands-on examples include different approaches to deploying applications on AWS, how to secure your infrastructure by isolating networks, and controlling traffic and managing access to AWS resources. You'll also learn to integrate AWS services into your own applications using SDKs and gain handy ideas on how to design applications for high availability, fault tolerance, and scalability.

Fully updated to include the latest revisions and updates to AWS; this new edition also offers three new chapters covering the latest additions to the AWS platform: serverless infrastructure automation with AWS Lambda, sharing data volumes between machines with EFS, and caching data in memory with ElastiCache!

Code examples by chapter

About the authors

Andreas Wittig and Michael Wittig are software engineers and consultants focused on AWS and web development. They migrated the first bank in Germany to AWS along with other heavily regulated businesses with legacy applications.

code2's People

Contributors

andreaswittig avatar michaelwittig avatar rvichithran 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  avatar

code2's Issues

Chapter16

Dear Michael:

Since AWS updates node.js with new versions:

64bit Amazon Linux 2 v5.4.5 running Node.js 12
64bit Amazon Linux 2 v5.4.5 running Node.js 14

The image processing template in your book (chapter 16) is not working well.

Could you please update the template if possible?

Thank you very much!

Zhengzhong

Chapter 2 - Autoscaling causing rollback

When trying to run the template for chapter 2, I get ROLLBACK_COMPLETE status. This is because the AutoScalingGroup creation is receiving the following status:

Unable to satisfy 100% MinSuccessfulInstancesPercent requirement

Logs

2020-01-12 17:12:43 UTC-0500 | wordpress | ROLLBACK_IN_PROGRESS | The following resource(s) failed to create: [AutoScalingGroup]. . Rollback requested by user.

2020-01-12 17:12:42 UTC-0500 | AutoScalingGroup | CREATE_FAILED | Received 1 FAILURE signal(s) out of 1. Unable to satisfy 100% MinSuccessfulInstancesPercent requirement

2020-01-12 17:12:41 UTC-0500 | AutoScalingGroup | CREATE_IN_PROGRESS | Received FAILURE signal with UniqueId i-03a31d0a1bc91baa2

Any help would be awesome! Thank you!

Section 5.3.2 causes rollback

First, thank you for the book!

Second, 5.3.2 causes a rollback for me:

  curl -s https://raw.githubusercontent.com/AWSinAction/\
> code2/master/chapter05/\
> vpn-create-cloudformation-stack.sh | bash -ex
++ aws ec2 describe-vpcs --filter 'Name=isDefault, Values=true' --query 'Vpcs[0].VpcId' --output text
+ VpcId=vpc-REDACTED
++ aws ec2 describe-subnets --filters Name=vpc-id,Values=vpc-REDACTED --query 'Subnets[0].SubnetId' --output text
+ SubnetId=subnet-REDACTED
++ openssl rand -base64 30
+ SharedSecret=w+65YOC1I/vbQMpV48KqqBR8SZJo8Oy5A5PZqIhY
++ openssl rand -base64 30
+ Password=3jfeYkMB5fN9Q5HxaOdM7KHSiI1ELTkmfWuOK4eL
+ aws cloudformation create-stack --stack-name vpn --template-url https://s3.amazonaws.com/awsinaction-code2/chapter05/vpn-cloudformation.yaml --parameters ParameterKey=KeyName,ParameterValue=mykey ParameterKey=VPC,ParameterValue=vpc-REDACTED ParameterKey=Subnet,ParameterValue=subnet-REDACTEDParameterKey=IPSecSharedSecret,ParameterValue=w+65YOC1I/vbQMpV48KqqBR8SZJo8Oy5A5PZqIhY ParameterKey=VPNUser,ParameterValue=vpn ParameterKey=VPNPassword,ParameterValue=3jfeYkMB5fN9Q5HxaOdM7KHSiI1ELTkmfWuOK4eL
{
    "StackId": "arn:aws:cloudformation:us-east-1:450REDACTED:stack/vpn/edbbREDACTED"
}
+ aws cloudformation wait stack-create-complete --stack-name vpn

Waiter StackCreateComplete failed: Waiter encountered a terminal failure state

AWS Console says:
ROLLBACK_COMPLETE

Events says:

Timestamp
Logical ID
Status
Status reason
2020-09-30 15:46:06 UTC-0500	vpn	ROLLBACK_COMPLETE	-
2020-09-30 15:45:48 UTC-0500	vpn	ROLLBACK_IN_PROGRESS	Parameter validation failed: parameter value mykey for parameter name KeyName does not exist. Rollback requested by user.
2020-09-30 15:45:45 UTC-0500	vpn	CREATE_IN_PROGRESS	User Initiated

Etherpad environment fails

When creating an environment using Elastic Beanstalk The following errors happen:

1- SolutionStackName is a deprecated platform, using [1] instead of [0] in the command below fixes that (basically using Amazon Linux 2)
aws elasticbeanstalk list-available-solution-stacks --output text --query "SolutionStacks[?contains(@, 'running Node.js')] | [1]"

2-Unknown or duplicate parameter: NodeCommand

When I unzipped the code, added ProcFile with content web: npm start the problem went away, need to update the hosted S3 file to reflect that

Chapter 4 - `describe-images` response takes mintues

Hello,

Not sure if this is the correct place to raise issues or ask questions in relation to particular chapters but when I run aws ec2 describe-images the response-time routinely takes minutes to complete. Any idea what's going on?

Add chapter names

When browsing some time after reading the book, it's a bit hard to navigate the repository. Would it be possible to name folders e.g. "chapter06_IAM" or similar?

cloud-init failing

Trying to use the script in Chapter 5 and it kept failing. Copied the yaml out and started it manually in cloud formation UI and turned off Roll Back on Failure. It is still failing, but the VM loads successfully. However, in the cloud-init, I see these errors:

Cloud-init v. 0.7.6 running 'modules:config' at Mon, 03 Jun 2019 00:10:05 +0000. Up 7.22 seconds.
Loaded plugins: priorities, update-motd, upgrade-helper

One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Disable the repository, so yum won't use it by default. Yum will then
    just ignore the repository until you permanently enable it again or use
    --enablerepo for temporary usage:

        yum-config-manager --disable <repoid>

 4. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: amzn-main/latest
Could not retrieve mirrorlist http://repo.us-east-2.amazonaws.com/latest/main/mirror.list error was
12: Timeout on http://repo.us-east-2.amazonaws.com/latest/main/mirror.list: (28, 'Connection timed out after 5000 milliseconds')
Jun 03 00:10:21 cloud-init[2491]: util.py[WARNING]: Package upgrade failed
Jun 03 00:10:21 cloud-init[2491]: cc_package_update_upgrade_install.py[WARNING]: 1 failed with exceptions, re-raising the last one
Jun 03 00:10:21 cloud-init[2491]: util.py[WARNING]: Running module package-update-upgrade-install (<module 'cloudinit.config.cc_package_update_upgrade_install' from '/usr/lib/python2.7/dist-packages/cloudinit/config/cc_package_update_upgrade_install.pyc'>) failed
Cloud-init v. 0.7.6 running 'modules:final' at Mon, 03 Jun 2019 00:10:22 +0000. Up 23.41 seconds.

  • export IPSEC_PSK=12345
  • IPSEC_PSK=12345
  • export VPN_USER=12345
  • VPN_USER=12345
  • export VPN_PASSWORD=12345
  • VPN_PASSWORD=12345
  • bash -ex
  • curl -s https://raw.githubusercontent.com/AWSinAction/code2/master/chapter05/vpn-setup.sh
  • /opt/aws/bin/cfn-signal -e 0 --stack vpn --resource EC2Instance --region us-east-2
    Unknown error signaling EC2Instance
    Jun 03 00:17:46 cloud-init[2606]: util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/part-001 [1]
    Jun 03 00:17:46 cloud-init[2606]: cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
    Jun 03 00:17:46 cloud-init[2606]: util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python2.7/dist-packages/cloudinit/config/cc_scripts_user.pyc'>) failed
    Cloud-init v. 0.7.6 finished at Mon, 03 Jun 2019 00:17:46 +0000. Datasource DataSourceEc2. Up 467.85 seconds
    [root@ip-172-31-16-113 log]#

Issues with nodecc

Are you looking for help with this code for the next edition? I was working through the first Edition and I saw there was a new version of nodecc so I tried it out. I had some problems that maybe I can help you address.

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.