Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs6.10
Runtime: nodejs8.10
CodeUri: .
Description: Demonstrates a basic skill built with the Amazon Alexa Skills Kit.
MemorySize: 128
Expand Down
47 changes: 47 additions & 0 deletions examples/apps/alexa-skills-kit-color-expert/testEvent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"version": "1.0",
"session": {
"new": false,
"sessionId": "amzn1.echo-api.session.123456789012",
"application": {
"applicationId": "amzn1.ask.skill.987654321"
},
"attributes": {},
"user": {
"userId": "amzn1.ask.account.testUser"
}
},
"context": {
"AudioPlayer": {
"playerActivity": "IDLE"
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.987654321"
},
"user": {
"userId": "amzn1.ask.account.testUser"
},
"device": {
"supportedInterfaces": {
"AudioPlayer": {}
}
}
}
},
"request": {
"type": "IntentRequest",
"requestId": "amzn1.echo-api.request.1234",
"timestamp": "2016-10-27T21:06:28Z",
"locale": "en-US",
"intent": {
"name": "MyColorIsIntent",
"slots": {
"Color": {
"name": "Color",
"value": "blue"
}
}
}
}
}
2 changes: 1 addition & 1 deletion examples/apps/cloudfront-ab-test/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs6.10
Runtime: nodejs8.10
CodeUri: .
Description: 'Blueprint for CloudFront ab testing, implemented in NodeJS.'
MemorySize: 128
Expand Down
36 changes: 36 additions & 0 deletions examples/apps/cloudfront-ab-test/testEvent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"Records": [
{
"cf": {
"config": {
"distributionId": "EXAMPLE"
},
"request": {
"uri": "/experiment-pixel.jpg",
"method": "GET",
"clientIp": "2001:cdba::3257:9652",
"headers": {
"user-agent": [
{
"key": "User-Agent",
"value": "Test Agent"
}
],
"host": [
{
"key": "Host",
"value": "d123.cf.net"
}
],
"cookie": [
{
"key": "Cookie",
"value": "SomeCookie=1; AnotherOne=A;"
}
]
}
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs6.10
Runtime: nodejs8.10
CodeUri: .
Description: >-
Blueprint for setting CloudFront response header based on value in the request header implemented in NodeJS.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"Records": [
{
"cf": {
"config": {
"distributionId": "EXAMPLE"
},
"request": {
"headers": {
"host": [
{
"key": "Host",
"value": "d123.cf.net"
}
],
"user-name": [
{
"key": "User-Name",
"value": "CloudFront"
}
]
},
"clientIp": "2001:cdba::3257:9652",
"uri": "/test",
"method": "GET"
},
"response": {
"status": "200",
"statusDescription": "OK",
"headers": {
"x-cache": [
{
"key": "X-Cache",
"value": "Hello from Cloudfront"
}
]
}
}
}
}
]
}
2 changes: 1 addition & 1 deletion examples/apps/cloudfront-http-redirect/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs6.10
Runtime: nodejs8.10
CodeUri: .
Description: Blueprint for returning HTTP redirect implemented in NodeJS.
MemorySize: 128
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs6.10
Runtime: nodejs8.10
CodeUri: .
Description: >-
Blueprint to add a header based on the values in a key-value pair in a query string.
Expand Down
37 changes: 37 additions & 0 deletions examples/apps/cloudfront-modify-querystring/testEvent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"Records": [
{
"cf": {
"config": {
"distributionId": "EXAMPLE"
},
"request": {
"uri": "/test",
"querystring": "auth=test&foo=bar",
"method": "GET",
"clientIp": "2001:cdba::3257:9652",
"headers": {
"host": [
{
"key": "Host",
"value": "d123.cf.net"
}
],
"user-agent": [
{
"key": "User-Agent",
"value": "Test Agent"
}
],
"user-name": [
{
"key": "User-Name",
"value": "aws-cloudfront"
}
]
}
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs6.10
Runtime: nodejs8.10
CodeUri: .
Description: >-
Blueprint for modifying CloudFront response header implemented in NodeJS.
Expand Down
35 changes: 35 additions & 0 deletions examples/apps/cloudfront-modify-response-header/testEvent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"Records": [
{
"cf": {
"config": {
"distributionId": "EXAMPLE"
},
"response": {
"status": "200",
"statusDescription": "OK",
"headers": {
"vary": [
{
"key": "Vary",
"value": "*"
}
],
"last-modified": [
{
"key": "Last-Modified",
"value": "2016-11-25"
}
],
"x-amz-meta-last-modified": [
{
"key": "X-Amz-Meta-Last-Modified",
"value": "2016-01-01"
}
]
}
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs6.10
Runtime: nodejs8.10
CodeUri: .
Description: >-
Blueprint for generating aggregated response from multiple remote calls on origin-request trigger implemented in NodeJS.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"Records": [
{
"cf": {
"config": {
"distributionId": "EXAMPLE"
},
"request": {
"uri": "/forecast/Seattle:NewYork:Chicago:SanFrancisco",
"method": "GET",
"clientIp": "2001:cdba::3257:9652",
"headers": {
"host": [
{
"key": "Host",
"value": "d123.cf.net"
}
],
"user-agent": [
{
"key": "User-Agent",
"value": "Test Agent"
}
]
}
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs6.10
Runtime: nodejs8.10
CodeUri: .
Description: >-
Blueprint for generating a redirect response based on the viewer country. Triggered by an origin-request. Implemented in NodeJS.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"Records": [
{
"cf": {
"config": {
"distributionId": "EXAMPLE"
},
"request": {
"uri": "/test",
"method": "GET",
"clientIp": "2001:cdba::3257:9652",
"headers": {
"host": [
{
"key": "Host",
"value": "d123.cf.net"
}
],
"cloudfront-viewer-country": [
{
"key": "CloudFront-Viewer-Country",
"value": "TW"
}
]
}
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs6.10
Runtime: nodejs8.10
CodeUri: .
Description: >-
Blueprint for redirecting unauthenticated users to sign-in page; triggered by CloudFront viewer-request event.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"Records": [
{
"cf": {
"config": {
"distributionId": "EXAMPLE"
},
"request": {
"uri": "/test",
"method": "GET",
"querystring": "foo=bar",
"headers": {
"host": [
{
"key": "Host",
"value": "d123.cf.net"
}
]
}
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs6.10
Runtime: nodejs8.10
CodeUri: .
Description: >-
Blueprint for generating a response from viewer-request trigger implemented in NodeJS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs6.10
Runtime: nodejs8.10
CodeUri: .
Description: >-
Blueprint for generating a response from origin-request trigger
Expand Down
Loading