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

Documentation wip #2

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 66 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,46 @@
# Terradactile
<br />
<p align="center">
<a href="https://github.com/sparkgeo/template-barebones">
<img src="./images/sparkgeo-logo.png" width="100">
</a>
<h3 align="center">Terradactile Lambda</h3>
</p>


<!-- TABLE OF CONTENTS -->
### Table of Contents

* [About this Program](#about-the-project)
* [Getting Started](#getting-started)
* [Prerequisites](#prerequisites)
* [Installation and Deployment](#installation-and-deployment)
* [Usage](#usage)
* [Contact](#contact)


<!-- ABOUT THE PROJECT -->
# About This Program

Terradactile is an API and Lambda function for fetching, assembling, and processing elevation data.

This project contains source code and supporting files for a serverless application that you can deploy with the SAM CLI. It includes the following files and folders.

- terradactile/terradactile - Code for the application's Lambda function.
- terradactile/template.yaml - A template that defines the application's AWS resources. **Update the environment variables for BUCKET and ALLOWED_ORIGINS.**
File Contents

- `terradactile/terradactile` - Code for the application's Lambda function.
- `terradactile/template.yaml` - A template that defines the application's AWS resources.

The application uses several AWS resources, including Lambda functions and an API Gateway API. These resources are defined in the `template.yaml` file in this project. You can update the template to add AWS resources through the same deployment process that updates your application code.
**Update the environment variables for BUCKET and ALLOWED_ORIGINS.**
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider making this more explicit by adding a .env-example file with those in it. Or use a code block here such as:

export BUCKET=myBucket
export ALLOWED_ORIGINS=*


Sample .env file:
```
export BUCKET=myBucket
export ALLOWED_ORIGINS=*
```



<!-- GETTING STARTED -->
# Getting Started

If you prefer to use an integrated development environment (IDE) to build and test your application, you can use the AWS Toolkit.
The AWS Toolkit is an open source plug-in for popular IDEs that uses the SAM CLI to build and deploy serverless applications on AWS. The AWS Toolkit also adds a simplified step-through debugging experience for Lambda function code. See the following links to get started.
Expand All @@ -17,23 +50,36 @@ The AWS Toolkit is an open source plug-in for popular IDEs that uses the SAM CLI
* [VS Code](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/welcome.html)
* [Visual Studio](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/welcome.html)

## Deploy the application

The Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.
### Prerequisites

To use the SAM CLI, you need the following tools.

* SAM CLI - [Install the SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
* [Python 3 installed](https://www.python.org/downloads/)
* Docker - [Install Docker community edition](https://hub.docker.com/search/?type=edition&offering=community)


The application uses several AWS resources, including Lambda functions and an API Gateway API. These resources are defined in the `/terradactile/template.yaml` file in this project. You can update the template to add AWS resources through the same deployment process that updates your application code.


# Installation and Deployment

## Deployment

The Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.

To build and deploy your application for the first time, cd to the project directory and run the following in your shell:
Copy link
Contributor

Choose a reason for hiding this comment

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

What directory are you cd into? Consider adding it to the code block below to be explicit.



```bash
cd terradactile-lambda/terradactile/terradactile/
sam build --use-container
sam deploy --guided
```


<!-- USAGE EXAMPLES -->
# Usage
The first command will build the source of your application. The second command will package and deploy your application to AWS, with a series of prompts:

* **Stack Name**: The name of the stack to deploy to CloudFormation. This should be unique to your account and region, and a good starting point would be something matching your project name.
Expand All @@ -51,3 +97,15 @@ To delete the sample application that you created, use the AWS CLI. Assuming you
```bash
aws cloudformation delete-stack --stack-name terradactile
```

<!-- CONTACT -->
# Contact

Project Link: [https://github.com/sparkgeo/terradactile-lambda/](https://github.com/sparkgeo/terradactile-lambda/)

Readme template edited by Alex Leamy at SparkGeo Consulting Ltd.
Copy link

@jbants jbants Mar 11, 2021

Choose a reason for hiding this comment

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

Let's remove this edited component


Based off original template from [Othniel Drew](https://github.com/othneildrew/Best-README-Template)



Binary file added images/sparkgeo-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.