Skip to content

Commit 16582cd

Browse files
carvantesbrettstack
authored andcommitted
docs: update example apps from nodejs6.10 to nodejs8.10 (#883)
Add sample test events
1 parent 7b16fbb commit 16582cd

File tree

41 files changed

+491
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+491
-22
lines changed

examples/apps/alexa-skills-kit-color-expert/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Resources:
99
Type: 'AWS::Serverless::Function'
1010
Properties:
1111
Handler: index.handler
12-
Runtime: nodejs6.10
12+
Runtime: nodejs8.10
1313
CodeUri: .
1414
Description: Demonstrates a basic skill built with the Amazon Alexa Skills Kit.
1515
MemorySize: 128
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"version": "1.0",
3+
"session": {
4+
"new": false,
5+
"sessionId": "amzn1.echo-api.session.123456789012",
6+
"application": {
7+
"applicationId": "amzn1.ask.skill.987654321"
8+
},
9+
"attributes": {},
10+
"user": {
11+
"userId": "amzn1.ask.account.testUser"
12+
}
13+
},
14+
"context": {
15+
"AudioPlayer": {
16+
"playerActivity": "IDLE"
17+
},
18+
"System": {
19+
"application": {
20+
"applicationId": "amzn1.ask.skill.987654321"
21+
},
22+
"user": {
23+
"userId": "amzn1.ask.account.testUser"
24+
},
25+
"device": {
26+
"supportedInterfaces": {
27+
"AudioPlayer": {}
28+
}
29+
}
30+
}
31+
},
32+
"request": {
33+
"type": "IntentRequest",
34+
"requestId": "amzn1.echo-api.request.1234",
35+
"timestamp": "2016-10-27T21:06:28Z",
36+
"locale": "en-US",
37+
"intent": {
38+
"name": "MyColorIsIntent",
39+
"slots": {
40+
"Color": {
41+
"name": "Color",
42+
"value": "blue"
43+
}
44+
}
45+
}
46+
}
47+
}

examples/apps/cloudfront-ab-test/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Resources:
99
Type: 'AWS::Serverless::Function'
1010
Properties:
1111
Handler: index.handler
12-
Runtime: nodejs6.10
12+
Runtime: nodejs8.10
1313
CodeUri: .
1414
Description: 'Blueprint for CloudFront ab testing, implemented in NodeJS.'
1515
MemorySize: 128
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"Records": [
3+
{
4+
"cf": {
5+
"config": {
6+
"distributionId": "EXAMPLE"
7+
},
8+
"request": {
9+
"uri": "/experiment-pixel.jpg",
10+
"method": "GET",
11+
"clientIp": "2001:cdba::3257:9652",
12+
"headers": {
13+
"user-agent": [
14+
{
15+
"key": "User-Agent",
16+
"value": "Test Agent"
17+
}
18+
],
19+
"host": [
20+
{
21+
"key": "Host",
22+
"value": "d123.cf.net"
23+
}
24+
],
25+
"cookie": [
26+
{
27+
"key": "Cookie",
28+
"value": "SomeCookie=1; AnotherOne=A;"
29+
}
30+
]
31+
}
32+
}
33+
}
34+
}
35+
]
36+
}

examples/apps/cloudfront-access-request-in-response/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Resources:
1010
Type: 'AWS::Serverless::Function'
1111
Properties:
1212
Handler: index.handler
13-
Runtime: nodejs6.10
13+
Runtime: nodejs8.10
1414
CodeUri: .
1515
Description: >-
1616
Blueprint for setting CloudFront response header based on value in the request header implemented in NodeJS.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"Records": [
3+
{
4+
"cf": {
5+
"config": {
6+
"distributionId": "EXAMPLE"
7+
},
8+
"request": {
9+
"headers": {
10+
"host": [
11+
{
12+
"key": "Host",
13+
"value": "d123.cf.net"
14+
}
15+
],
16+
"user-name": [
17+
{
18+
"key": "User-Name",
19+
"value": "CloudFront"
20+
}
21+
]
22+
},
23+
"clientIp": "2001:cdba::3257:9652",
24+
"uri": "/test",
25+
"method": "GET"
26+
},
27+
"response": {
28+
"status": "200",
29+
"statusDescription": "OK",
30+
"headers": {
31+
"x-cache": [
32+
{
33+
"key": "X-Cache",
34+
"value": "Hello from Cloudfront"
35+
}
36+
]
37+
}
38+
}
39+
}
40+
}
41+
]
42+
}

examples/apps/cloudfront-http-redirect/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Resources:
99
Type: 'AWS::Serverless::Function'
1010
Properties:
1111
Handler: index.handler
12-
Runtime: nodejs6.10
12+
Runtime: nodejs8.10
1313
CodeUri: .
1414
Description: Blueprint for returning HTTP redirect implemented in NodeJS.
1515
MemorySize: 128

examples/apps/cloudfront-modify-querystring/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Resources:
1010
Type: 'AWS::Serverless::Function'
1111
Properties:
1212
Handler: index.handler
13-
Runtime: nodejs6.10
13+
Runtime: nodejs8.10
1414
CodeUri: .
1515
Description: >-
1616
Blueprint to add a header based on the values in a key-value pair in a query string.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"Records": [
3+
{
4+
"cf": {
5+
"config": {
6+
"distributionId": "EXAMPLE"
7+
},
8+
"request": {
9+
"uri": "/test",
10+
"querystring": "auth=test&foo=bar",
11+
"method": "GET",
12+
"clientIp": "2001:cdba::3257:9652",
13+
"headers": {
14+
"host": [
15+
{
16+
"key": "Host",
17+
"value": "d123.cf.net"
18+
}
19+
],
20+
"user-agent": [
21+
{
22+
"key": "User-Agent",
23+
"value": "Test Agent"
24+
}
25+
],
26+
"user-name": [
27+
{
28+
"key": "User-Name",
29+
"value": "aws-cloudfront"
30+
}
31+
]
32+
}
33+
}
34+
}
35+
}
36+
]
37+
}

examples/apps/cloudfront-modify-response-header/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Resources:
99
Type: 'AWS::Serverless::Function'
1010
Properties:
1111
Handler: index.handler
12-
Runtime: nodejs6.10
12+
Runtime: nodejs8.10
1313
CodeUri: .
1414
Description: >-
1515
Blueprint for modifying CloudFront response header implemented in NodeJS.

0 commit comments

Comments
 (0)