-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thijs de Vries
committed
Jan 3, 2017
1 parent
d25cd97
commit 4fe4053
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
get_container_cf.yml | ||
build.sh | ||
create-users.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Working steps | ||
1. Create bucket to put artifacts | ||
|
||
aws s3 mb s3://lambda-pipeline | ||
|
||
2. Transform the template-file an upload the artifacts | ||
|
||
aws cloudformation package --template-file get_container.yaml --output-template-file get_container_cf.yml --s3-bucket lambda-pipeline | ||
|
||
3. Deploy the function | ||
|
||
aws cloudformation deploy --template-file /Users/tdevries/GIT/lambda-pipeline/get_container_cf.yml --stack-name lambda-pipeline --capabilities CAPABILITY_IAM | ||
|
||
# Links | ||
- [Cloudformation package](http://docs.aws.amazon.com/cli/latest/reference/cloudformation/package.html) | ||
- [Cloudformation transform](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html) | ||
- [SAML intro](https://aws.amazon.com/blogs/compute/introducing-simplified-serverless-application-deplyoment-and-management/) | ||
- [Python-programming-model](http://docs.aws.amazon.com/lambda/latest/dg/python-programming-model-handler-types.html) | ||
- [API Gateway create](http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-from-example.html) | ||
- [Lambda-python-how-to-create-deployment](http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html) | ||
- [Deploying Lambda Functions](http://docs.aws.amazon.com/lambda/latest/dg/deploying-lambda-apps.html) | ||
- [CodePipeline Access Permissions](http://docs.aws.amazon.com/codepipeline/latest/userguide/access-permissions.html) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Transform: 'AWS::Serverless-2016-10-31' | ||
Description: A starter AWS Lambda function. | ||
Resources: | ||
getcontainer: | ||
Type: 'AWS::Serverless::Function' | ||
Properties: | ||
Handler: lambda_function.lambda_handler | ||
Runtime: python2.7 | ||
Environment: | ||
Variables: | ||
S3_BUCKET: lambda-pipeline | ||
CodeUri: ./get_container/ | ||
Description: A starter AWS Lambda function. | ||
MemorySize: 128 | ||
Timeout: 3 | ||
# Role: 'arn:aws:iam::925284441818:role/lambda_basic_execution' | ||
Events: | ||
Api1: | ||
Type: Api | ||
Properties: | ||
Path: /getcontainer | ||
Method: GET |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from __future__ import print_function | ||
|
||
import json | ||
import socket | ||
|
||
print('Loading function') | ||
|
||
|
||
def lambda_handler(event, context): | ||
return { 'statusCode': '200', | ||
'body': socket.gethostname(), | ||
'headers': { 'Content-Type': 'application/json' }, | ||
} # Echo back the first key value | ||
#raise Exception('Something went wrong') |