Skip to content

Commit

Permalink
prepping for github
Browse files Browse the repository at this point in the history
  • Loading branch information
em0ney committed Sep 18, 2015
1 parent 2042d02 commit 3437d75
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 29 deletions.
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Autotag

This is an open-source tagging solution for AWS. Deploy autotag to lambda and set up CloudTrail and have each of your resources tagged with the resource who created it.
This is an open-source tagging solution for AWS. Deploy autotag to lambda and set up CloudTrail and have each of your resources tagged with the resource who created it. It was written by GorillaStack.



## Setup

## Baseline policies for your lambda IAM role
#### Baseline policies for your lambda IAM role

If you install your lambda function and don't plan on tagging resources, at very least you will need these permissions:

Expand Down Expand Up @@ -47,7 +49,7 @@ If you install your lambda function and don't plan on tagging resources, at very
```


## Necessary policies for your lambda's IAM role
#### Necessary policies for your lambda's IAM role
Actions to allow for all resources:

* S3: `s3:GetBucketTagging`
Expand Down Expand Up @@ -99,3 +101,29 @@ Actions to allow for all resources:
]
}
```

## Contributing

If you have questions, feature requests or bugs to report, please do so on the github repository.

If you are interested in contributing, please get started by forking our github repository and submit pull-requests.

### Development guide

Autotag is implemented in Javascript (ECMAScript 2015 - a.k.a. es6). To make this compatible with lambda and other es5 environments, we use [babel](https://babeljs.io/) to transpile the es6 code to es5. For this reason, you will need to install babel globally to get started:

```bash
$ npm install -g babel
```

To setup babel to listen to the `src/` directory and transpile the code to es5, run:

```bash
$ babel -d lib --watch src
```

To assist you in packaging and deploying your code to your lambda function, I have provided a script `deploy_lambda_code.sh`. For this to run, you need the AWS CLI installed and an AWS profile available with sufficient access to deploy code. Edit the script to provide your aws account id, lambda function name and location of the zipfile on your filesystem.

```bash
$ bash deploy_lambda_code.sh
```
3 changes: 1 addition & 2 deletions deploy_lambda_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ mv lib/autotag.zip .
zip -g autotag.zip -r node_modules/
echo ---
echo 2. Uploading code via AWS CLI
aws lambda --region ap-northeast-1 update-function-code --function-name arn:aws:lambda:ap-northeast-1:002790823159:function:gs_autotag --zip-file fileb:///home/e/dev/gs/autotag/autotag.zip
# aws s3 cp autotag.zip s3://gs-lambda-functions/autotag.zip
aws lambda --region ap-northeast-1 update-function-code --function-name arn:aws:lambda:[AWS_REGION]:[AWS_ACCOUNT_ID]:function:gs_autotag --zip-file fileb:///[PATH_TO_AUTOTAG_DIR]/autotag.zip
24 changes: 0 additions & 24 deletions notes

This file was deleted.

25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "autotag",
"version": "1.0.0",
"description": "Autotagging for AWS resources",
"main": "autotag.js",
"private": true,
"dependencies": {
"aws-sdk": "^2.1.50",
"babel": "^5.8.23",
"co": "^4.6.0",
"underscore": "^1.8.3",
"jasmine": "^2.3.2"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@github.com:GorillaStack/autotag.git"
},
"author": "Elliott Spira",
"license": "ISC",
"homepage": "https://bitbucket.org/gorillastack/autotag#readme"
}

0 comments on commit 3437d75

Please sign in to comment.