Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update example apps to use policy templates and parameters #554

Merged
merged 6 commits into from
Sep 4, 2018
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
11 changes: 5 additions & 6 deletions examples/apps/alexa-skill-kit-sdk-factskill/template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Demonstrate a basic fact skill built with the ASK NodeJS SDK
Parameters:
TopicNameParameter:
Type: String
Resources:
alexaskillkitsdkfactskill:
Type: 'AWS::Serverless::Function'
Expand All @@ -12,9 +15,5 @@ Resources:
MemorySize: 128
Timeout: 7
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'sns:Publish'
Resource: 'arn:aws:sns:*:*:*'
- SNSPublishMessagePolicy:
TopicName: !Ref TopicNameParameter
11 changes: 5 additions & 6 deletions examples/apps/alexa-skill-kit-sdk-howtoskill/template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Demonstrate a basic How-to skill built with the ASK NodeJS SDK
Parameters:
TopicNameParameter:
Type: String
Resources:
alexaskillkitsdkhowtoskill:
Type: 'AWS::Serverless::Function'
Expand All @@ -12,9 +15,5 @@ Resources:
MemorySize: 128
Timeout: 7
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'sns:Publish'
Resource: 'arn:aws:sns:*:*:*'
- SNSPublishMessagePolicy:
TopicName: !Ref TopicNameParameter
11 changes: 5 additions & 6 deletions examples/apps/alexa-skill-kit-sdk-triviaskill/template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Demonstrate a basic trivia skill built with the ASK NodeJS SDK
Parameters:
TopicNameParameter:
Type: String
Resources:
alexaskillkitsdktriviaskill:
Type: 'AWS::Serverless::Function'
Expand All @@ -12,9 +15,5 @@ Resources:
MemorySize: 128
Timeout: 7
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'sns:Publish'
Resource: 'arn:aws:sns:*:*:*'
- SNSPublishMessagePolicy:
TopicName: !Ref TopicNameParameter
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Demonstrates a basic skill built with the Amazon Alexa Skills Kit.
Parameters:
TopicNameParameter:
Type: String
Resources:
alexaskillskitcolorexpertpython:
Type: 'AWS::Serverless::Function'
Expand All @@ -12,12 +15,8 @@ Resources:
MemorySize: 128
Timeout: 3
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'sns:Publish'
Resource: 'arn:aws:sns:*:*:*'
- SNSPublishMessagePolicy:
TopicName: !Ref TopicNameParameter
Events:
AlexaSkillEvent:
Type: AlexaSkill
11 changes: 5 additions & 6 deletions examples/apps/alexa-skills-kit-color-expert/template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Demonstrates a basic skill built with the Amazon Alexa Skills Kit.
Parameters:
TopicNameParameter:
Type: String
Resources:
alexaskillskitcolorexpert:
Type: 'AWS::Serverless::Function'
Expand All @@ -12,12 +15,8 @@ Resources:
MemorySize: 128
Timeout: 3
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'sns:Publish'
Resource: 'arn:aws:sns:*:*:*'
- SNSPublishMessagePolicy:
TopicName: !Ref TopicNameParameter
Events:
AlexaSkillEvent:
Type: AlexaSkill
13 changes: 6 additions & 7 deletions examples/apps/alexa-smart-home-skill-adapter/template.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Provides the basic framework for a skill adapter for a smart home skill.
Parameters:
TopicNameParameter:
Type: String
Resources:
alexasmarthomeskilladapter:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs4.3
Runtime: nodejs8.10
CodeUri: .
Description: Provides the basic framework for a skill adapter for a smart home skill.
MemorySize: 128
Timeout: 7
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'sns:Publish'
Resource: 'arn:aws:sns:*:*:*'
- SNSPublishMessagePolicy:
TopicName: !Ref TopicNameParameter
13 changes: 6 additions & 7 deletions examples/apps/algorithmia/template.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Run any algorithm in the Algorithmia marketplace.
Parameters:
TopicNameParameter:
Type: String
Resources:
algorithmia:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs4.3
Runtime: nodejs8.10
CodeUri: .
Description: Run any algorithm in the Algorithmia marketplace.
MemorySize: 256
Timeout: 60
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'sns:Publish'
Resource: 'arn:aws:sns:*:*:*'
- SNSPublishMessagePolicy:
TopicName: !Ref TopicNameParameter
Events:
BucketEvent1:
Type: S3
Expand Down
13 changes: 6 additions & 7 deletions examples/apps/api-gateway-authorizer-nodejs/template.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: 'Blueprint for API Gateway custom authorizers, implemented in NodeJS.'
Parameters:
TopicNameParameter:
Type: String
Resources:
apigatewayauthorizernodejs:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs4.3
Runtime: nodejs8.10
CodeUri: .
Description: 'Blueprint for API Gateway custom authorizers, implemented in NodeJS.'
MemorySize: 256
Timeout: 5
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'sns:Publish'
Resource: 'arn:aws:sns:*:*:*'
- SNSPublishMessagePolicy:
TopicName: !Ref TopicNameParameter
11 changes: 5 additions & 6 deletions examples/apps/api-gateway-authorizer-python/template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: 'Blueprint for API Gateway custom authorizers, implemented in Python 2.7.'
Parameters:
TopicNameParameter:
Type: String
Resources:
apigatewayauthorizerpython:
Type: 'AWS::Serverless::Function'
Expand All @@ -12,9 +15,5 @@ Resources:
MemorySize: 256
Timeout: 5
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'sns:Publish'
Resource: 'arn:aws:sns:*:*:*'
- SNSPublishMessagePolicy:
TopicName: !Ref TopicNameParameter
30 changes: 15 additions & 15 deletions examples/apps/api-gateway-multiple-origin-cors/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ Resources:
Method: 'options'

Outputs:
ExampleApi:
Description: "API Gateway endpoint URL for Prod stage for API Gateway Multi-Origin CORS function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/"
ExampleRoot:
Description: "API Gateway Multi-Origin CORS Lambda Function (Root) ARN"
Value: !GetAtt ExampleRoot.Arn
ExampleRootIamRole:
Description: "Implicit IAM Role created for API Gateway Multi-Origin CORS function (Root)"
Value: !GetAtt ExampleRootRole.Arn
ExampleTest:
Description: "API Gateway Multi-Origin CORS Lambda Function (Test) ARN"
Value: !GetAtt ExampleTest.Arn
ExampleTestIamRole:
Description: "Implicit IAM Role created for API Gateway Multi-Origin CORS function (Test)"
Value: !GetAtt ExampleTestRole.Arn
ExampleApi:
Description: "API Gateway endpoint URL for Prod stage for API Gateway Multi-Origin CORS function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/"
ExampleRoot:
Description: "API Gateway Multi-Origin CORS Lambda Function (Root) ARN"
Value: !GetAtt ExampleRoot.Arn
ExampleRootIamRole:
Description: "Implicit IAM Role created for API Gateway Multi-Origin CORS function (Root)"
Value: !GetAtt ExampleRootRole.Arn
ExampleTest:
Description: "API Gateway Multi-Origin CORS Lambda Function (Test) ARN"
Value: !GetAtt ExampleTest.Arn
ExampleTestIamRole:
Description: "Implicit IAM Role created for API Gateway Multi-Origin CORS function (Test)"
Value: !GetAtt ExampleTestRole.Arn
9 changes: 2 additions & 7 deletions examples/apps/cfn-look-up-ami-ids/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs4.3
Runtime: nodejs8.10
CodeUri: .
Description: Looks up the latest AMI ID for a given region and architecture.
MemorySize: 128
Timeout: 3
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'ec2:DescribeImages'
Resource: '*'
- AMIDescribePolicy: {}
9 changes: 2 additions & 7 deletions examples/apps/cfn-stack-outputs/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: index.handler
Runtime: nodejs4.3
Runtime: nodejs8.10
CodeUri: .
Description: >-
Takes an AWS CloudFormation stack name and returns the outputs from that
stack.
MemorySize: 128
Timeout: 3
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'cloudformation:DescribeStacks'
Resource: '*'
- CloudFormationDescribeStacksPolicy: {}
11 changes: 5 additions & 6 deletions examples/apps/cloudfront-ab-test/template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: 'Blueprint for CloudFront ab testing, implemented in NodeJS.'
Parameters:
KeyIdParameter:
Type: String
Resources:
cloudfrontabtest:
Type: 'AWS::Serverless::Function'
Expand All @@ -12,9 +15,5 @@ Resources:
MemorySize: 128
Timeout: 1
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'kms:Decrypt'
Resource: '*'
- KMSDecryptPolicy:
KeyId: !Ref KeyIdParameter
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: >-
Blueprint for setting CloudFront response header based on value in the request
header implemented in NodeJS.
Blueprint for setting CloudFront response header based on value in the request header implemented in NodeJS.
Parameters:
KeyIdParameter:
Type: String
Resources:
cloudfrontaccessrequestinresponse:
Type: 'AWS::Serverless::Function'
Expand All @@ -11,14 +13,9 @@ Resources:
Runtime: nodejs6.10
CodeUri: .
Description: >-
Blueprint for setting CloudFront response header based on value in the
request header implemented in NodeJS.
Blueprint for setting CloudFront response header based on value in the request header implemented in NodeJS.
MemorySize: 128
Timeout: 1
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'kms:Decrypt'
Resource: '*'
- KMSDecryptPolicy:
KeyId: !Ref KeyIdParameter
11 changes: 5 additions & 6 deletions examples/apps/cloudfront-http-redirect/template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Blueprint for returning HTTP redirect implemented in NodeJS.
Parameters:
KeyIdParameter:
Type: String
Resources:
cloudfronthttpredirect:
Type: 'AWS::Serverless::Function'
Expand All @@ -12,9 +15,5 @@ Resources:
MemorySize: 128
Timeout: 1
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'kms:Decrypt'
Resource: '*'
- KMSDecryptPolicy:
KeyId: !Ref KeyIdParameter
Loading