good-parts / aws-bootstrap Goto Github PK
View Code? Open in Web Editor NEWA template for setting up an AWS environment from scratch.
Home Page: https://gum.co/aws-good-parts
A template for setting up an AWS environment from scratch.
Home Page: https://gum.co/aws-good-parts
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?
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
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"
Version 1.1 (page 115)
"Let's push these changes to GitHub"
server.js
is not included in the add statement
$ git add start-service.sh package.json
...
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.
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
.
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.
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
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
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.
CloudFormation script to create Private Subnets etc. keeps getting stuck:
When I dig into the ASG, this is what I see in the Activity History of the ASG:
And this is what I am seeing in Instance Management section of the ASG:
I tried just copying the stage.yml
from the "Network Security" tagged version of the book's repo. Still no luck.
Ugh. Any pointers??
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.