Last active
July 15, 2016 12:21
-
-
Save marcy-terui/4de92550a9a4faf01583 to your computer and use it in GitHub Desktop.
AWS Lambda向けデプロイ・管理ツール「Lamvery」について ref: http://qiita.com/marcy-terui/items/1617ab4e20e3339d1930
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api_id: myipugal74 | |
stage: dev | |
cors: | |
origin: '*' | |
methods: | |
- GET | |
- OPTION | |
headers: | |
- Content-Type | |
- X-Amz-Date | |
- Authorization | |
- X-Api-Key | |
configuration: | |
swagger: '2.0' | |
info: | |
title: Sample API | |
schemes: | |
- https | |
paths: | |
/: | |
get: | |
produces: | |
- application/json | |
parameters: | |
- name: sample | |
in: query | |
required: false | |
type: string | |
responses: | |
'200': | |
description: 200 response | |
schema: | |
$ref: '#/definitions/Sample' | |
definitions: | |
Sample: | |
type: object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rules: | |
- name: foo | |
description: bar | |
schedule: 'rate(5 minutes)' | |
targets: | |
- id: test-target-id | |
input: | |
this: | |
- is: a | |
- sample: input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- ^\.lamvery\.yml$ | |
- ^\.lamvery\.event\.yml$ | |
- ^\.lamvery\.secret\.yml$ | |
- ^\.lamvery\.exclude\.yml$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build: | |
pre: | |
- pip install -r requirements.txt -t ./ | |
post: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key_id: a5ed61a9-fa57-4ebf-9b3f-457b95de05ce # <-ここ!!! | |
cipher_texts: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
profile: default | |
region: us-east-1 | |
configuration: | |
name: sample_lambda_function | |
runtime: python2.7 # or nodejs | |
role: arn:aws:iam::000000000000:role/lambda_basic_execution | |
handler: lambda_function.lambda_handler | |
description: This is sample lambda function. | |
timeout: 10 | |
memory_size: 128 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virtualenv -p <path-to-python2.7> .venv | |
. .venv/bin/activate | |
pip install lamvery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "deb https://dl.bintray.com/willyworks/deb trusty main" | sudo tee -a /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get install lamvery | |
export PATH=/opt/lamvery/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery init -h | |
usage: lamvery init [-h] [-c CONF_FILE] | |
optional arguments: | |
-h, --help show this help message and exit | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery generate -h | |
usage: lamvery generate [-h] [-c CONF_FILE] -k KIND | |
optional arguments: | |
-h, --help show this help message and exit | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-k KIND, --kind KIND The kind of the file # accepts "function" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery build -h | |
usage: lamvery build [-h] [-c CONF_FILE] [-s] [-l] [-e ENV] | |
optional arguments: | |
-h, --help show this help message and exit | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-s, --single-file Only use the main lambda function file | |
-l, --no-libs Archiving without all libraries | |
-e ENV, --env ENV Environment variables that pass to the function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery deploy -h | |
usage: lamvery deploy [-h] [-a ALIAS] [-c CONF_FILE] [-d] [-s] [-l] [-p] | |
[-e ENV] | |
optional arguments: | |
-h, --help show this help message and exit | |
-a ALIAS, --alias ALIAS | |
Alias for a version of the function | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-d, --dry-run Dry run | |
-s, --single-file Only use the main lambda function file | |
-l, --no-libs Archiving without all libraries | |
-p, --publish Publish the version as an atomic operation | |
-e ENV, --env ENV Environment variables that pass to the function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery rollback -h | |
usage: lamvery rollback [-h] [-a ALIAS] [-c CONF_FILE] [-v VERSION] | |
optional arguments: | |
-h, --help show this help message and exit | |
-a ALIAS, --alias ALIAS | |
Alias for a version of the function | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-v VERSION, --version VERSION | |
Version of the function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery configure -h | |
usage: lamvery configure [-h] [-c CONF_FILE] [-d] | |
optional arguments: | |
-h, --help show this help message and exit | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-d, --dry-run Dry run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery set-alias -h | |
usage: lamvery set-alias [-h] [-a ALIAS] [-c CONF_FILE] [-d] [-v VERSION] | |
[-t TARGET] | |
optional arguments: | |
-h, --help show this help message and exit | |
-a ALIAS, --alias ALIAS | |
Alias for a version of the function | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-d, --dry-run Dry run | |
-v VERSION, --version VERSION | |
Version of the function | |
-t TARGET, --target TARGET | |
The alias of the version that is targeted for setting | |
alias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery encrypt -h | |
usage: lamvery encrypt [-h] [-c CONF_FILE] [-n SECRET_NAME] [-s] text | |
positional arguments: | |
text The text value to encrypt | |
optional arguments: | |
-h, --help show this help message and exit | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-n SECRET_NAME, --secret-name SECRET_NAME | |
The name of the secret value | |
-s, --store Store encripted value to the configuration file | |
(default: .lamvery.secret.yml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery encrypt-file -h | |
usage: lamvery encrypt-file [-h] [-c CONF_FILE] -p PATH [-s] file | |
positional arguments: | |
file The file path to encrypt | |
optional arguments: | |
-h, --help show this help message and exit | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-p PATH, --path PATH The path to put the decrypted file in the function | |
-s, --store Store encripted value to the configuration file | |
(default: .lamvery.secret.yml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery decrypt -h | |
usage: lamvery decrypt [-h] [-c CONF_FILE] [-n SECRET_NAME] | |
optional arguments: | |
-h, --help show this help message and exit | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-n SECRET_NAME, --secret-name SECRET_NAME | |
The name of the secret value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo " | |
[bintraybintray-willyworks-rpm] | |
name=bintray-willyworks-rpm | |
baseurl=https://dl.bintray.com/willyworks/rpm/centos/\$releaserver/\$basearch/ | |
gpgcheck=0 | |
enabled=1 | |
" | sudo tee -a /etc/yum.repos.d/bintray-willyworks-rpm.repo | |
sudo yum install lamvery | |
export PATH=/opt/lamvery/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamvery events [-k] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery invoke -h | |
usage: lamvery invoke [-h] [-a ALIAS] [-c CONF_FILE] [-v VERSION] json | |
positional arguments: | |
json The JSON string or file that pass to the function | |
optional arguments: | |
-h, --help show this help message and exit | |
-a ALIAS, --alias ALIAS | |
Alias for a version of the function | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-v VERSION, --version VERSION | |
Version of the function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery logs -h | |
usage: lamvery logs [-h] [-c CONF_FILE] [-f] [-F FILTER] [-i INTERVAL] | |
[-s START] | |
optional arguments: | |
-h, --help show this help message and exit | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-f, --follow Watch the log events and updates the display (like | |
`tail -f`) | |
-F FILTER, --filter FILTER | |
Filtering pattern for the log messages | |
-i INTERVAL, --interval INTERVAL | |
Intervals(seconds) to watch the log events | |
-s START, --start START | |
Time to start the log events watching |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lamvery api -h | |
usage: lamvery api [-h] [-c CONF_FILE] [-d] [-n] [-r] [-s STAGE] [-w] | |
optional arguments: | |
-h, --help show this help message and exit | |
-c CONF_FILE, --conf-file CONF_FILE | |
Configuration YAML file (default: .lamvery.yml) | |
-d, --dry-run Dry run | |
-n, --no-integrate Without automatic integration | |
-r, --remove Remove your API | |
-s STAGE, --stage STAGE | |
The name of the stage in API Gateway | |
-w, --write-id Write the id of your API to the configuration file | |
(default: .lamvery.api.yml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"kms:Decrypt" | |
], | |
"Resource": [ | |
"arn:aws:kms:us-east-1:<your-account-number>:key/<your-key-id>" | |
] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamvery init | |
lamvery generate -k function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamvery encrypt -s -n foo "This is a secret" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lambery invoke {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamvery init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
START RequestId: 13829c9c-9f13-11e5-921b-6f048cff3c2d Version: $LATEST | |
This is a secret | |
END RequestId: 13829c9c-9f13-11e5-921b-6f048cff3c2d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamvery deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lambery invoke {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
START RequestId: 13829c9c-9f13-11e5-921b-6f048cff3c2d Version: $LATEST | |
This is a secret | |
END RequestId: 13829c9c-9f13-11e5-921b-6f048cff3c2d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamvery deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamvery set-alias -a <alias> -v <alias-version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamvery archive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamvery deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamvery deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamvery configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lamvery = require('./lamvery.js'); | |
exports.lambda_handler = function(event, context) { | |
lamvery.secret.get('foo', function(err, data) { | |
console.log(data); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lamvery | |
def lambda_handler(event, context): | |
print(lamvery.secret.get('foo')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment