Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request for the first lab #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

daghanacay
Copy link

Please see my changes, I have added quite a bit but I think it makes things little more clear. Let me know if you wish me to contribute to Lab 2 and 3

Copy link
Owner

@julianpitt julianpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few spelling and grammar changes and it'll be ready for a merge

.gitignore Outdated
@@ -1,6 +1,3 @@
.env
.envrc

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to keep these in

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

back

1. Create a new project using the Serverless framework create command
### Steps: Create a lambda function

1. Go to the root folder, e.g. Serverless-AWS-CRUD-Workshop/ and create a new project using the Serverless framework create command where [your service name] is something you call to your service e.g. myTestService. Make sure you do not use speciala characters like underscore "_".
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the word "special"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

```
sls create --template aws-nodejs --name [your service name]
```

2. Open the `serverless.yml` file and add the following to the bottom of the configuration file to create a new hello Function:
2. Open the `Serverless-AWS-CRUD-Workshop/serverless.yml` set up the AWS environment by replacing
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Open the Serverless-AWS-CRUD-Workshop/serverless.yml file. This file contains all the configuration and resources for your serverless project. To tell the serverless framework to use AWS, replace everything in the document with the configuration as follows

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

```yaml
provider:
name: aws
runtime: nodejs6.10
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be nodejs8.10

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

timeout: 30
versionFunctions: false
```
This will tell the serverless that you want your service to be deployed to Syndey region (you can choose others off course). Now find and replace the following
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration above will tell the serverless framework that you want to deploy your service in the Sydney region.
Next, we're going to specify our functions to deploy.
Paste the configuration below under the previous configuration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

9. If you're able to get a response back, congratulations! You've deployed your first lambda function.
### Adding an API to the function

9. If you're able to get a response back, congratulations! You've deployed your first lambda function. You can see where your lmbad function bgy loging into AWS console and your lambda functions under Sydney region.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few spelling errors
9. If you're able to get a response back, congratulations! You've deployed your first lambda function. You can see where your lambda function by logging into AWS console and your lambda functions in the Sydney region.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -90,10 +126,11 @@ functions:
sls deploy -v
```

11. After the deployment completes. You should see an api endpoint under `endpoints`. Click on this link to open it in the browser.
11. After the deployment completes. You should see an api endpoint under `endpoints`. Click on this link to open it in the browser. You can see your deployed endpoint at AWS console under `API gateway` under dev-myTestService and he you can find the API url under Stages->dev called Invoke URL
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see your deployed endpoint at AWS console under API gateway under dev-myTestService. You can find the API url under Stages->dev called Invoke URL

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


After you have deployed the book endpoints you can test your work using Postman. Import the `AWS Serverless CRUD.postman_collection.json` into postman.
- create a new environment called "meetup-book"
- in the invironment define variable "API_ENDPOINT" and asign it to your API URL eg https://XXXXXX.execute-api.ap-southeast-2.amazonaws.com/dev
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the environment, define a new variable called "API_ENDPOINT" and assign it to your API URL

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

After you have deployed the book endpoints you can test your work using Postman. Import the `AWS Serverless CRUD.postman_collection.json` into postman.
- create a new environment called "meetup-book"
- in the invironment define variable "API_ENDPOINT" and asign it to your API URL eg https://XXXXXX.execute-api.ap-southeast-2.amazonaws.com/dev
- Now you can chose any of the endpoint under "AWS Serverless CRUD" collection and see if it works!
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now you can choose any of the function endpoints

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants