-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add AWS::Serverless::LayerVersion and AWS::Serverless::Applicat…
…ion (#688)
- Loading branch information
Showing
81 changed files
with
3,984 additions
and
98 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
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
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,8 @@ | ||
## Nested App Example | ||
|
||
This app uses the [twitter event source app](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:077246666028:applications~aws-serverless-twitter-event-source) as a nested app and logs the tweets received from the nested app. | ||
|
||
All you need to do is supply the desired parameters for this app and deploy. SAM will create a nested stack for any nested app inside of your template with all of the parameters that are passed to it. | ||
|
||
## Installation Instructions | ||
Please refer to the Installation Steps section of the [twitter-event-source application](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:077246666028:applications~aws-serverless-twitter-event-source) for detailed information regarding how to obtain and use the tokens and secrets for this application. |
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,7 @@ | ||
import logging | ||
|
||
LOGGER = logging.getLogger() | ||
LOGGER.setLevel(logging.INFO) | ||
|
||
def process_tweets(tweets, context): | ||
LOGGER.info("Received tweets: {}".format(tweets)) |
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,56 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Transform: 'AWS::Serverless-2016-10-31' | ||
Description: This example imports the aws-serverless-twitter-event-source serverless app as a nested app in this serverless application and connects it to a function that will log the tweets sent for the given Twitter search text. | ||
Parameters: | ||
EncryptedAccessToken: | ||
Type: String | ||
Description: Twitter API Access Token encrypted ciphertext blob as a base64-encoded string. | ||
EncryptedAccessTokenSecret: | ||
Type: String | ||
Description: Twitter API Access Token Secret ciphertext blob as a base64-encoded string. | ||
EncryptedConsumerKey: | ||
Type: String | ||
Description: Twitter API Consumer Key encrypted ciphertext blob as a base64-encoded string. | ||
EncryptedConsumerSecret: | ||
Type: String | ||
Description: Twitter API Consumer Secret encrypted ciphertext blob as a base64-encoded string. | ||
DecryptionKeyName: | ||
Type: String | ||
Description: KMS key name of the key used to encrypt the Twitter API parameters. Note, this must be just the key name (UUID), not the full key ARN. It's assumed the key is owned by the same account, in the same region as the app. | ||
SearchText: | ||
Type: String | ||
Description: Non-URL-encoded search text poller should use when querying Twitter Search API. | ||
Default: AWS | ||
|
||
Resources: | ||
TweetLogger: | ||
Type: 'AWS::Serverless::Function' | ||
Properties: | ||
Handler: app.process_tweets | ||
Runtime: python3.6 | ||
MemorySize: 128 | ||
Timeout: 10 | ||
CodeUri: src/ | ||
TwitterEventSourceApp: | ||
Type: 'AWS::Serverless::Application' | ||
Properties: | ||
Location: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/aws-serverless-twitter-event-source | ||
SemanticVersion: 1.1.0 | ||
Parameters: # Using default value for PollingFrequencyInMinutes (1) | ||
TweetProcessorFunctionName: !Ref TweetLogger | ||
BatchSize: 20 | ||
DecryptionKeyName: !Ref DecryptionKeyName | ||
EncryptedAccessToken: !Ref EncryptedAccessToken | ||
EncryptedAccessTokenSecret: !Ref EncryptedAccessTokenSecret | ||
EncryptedConsumerKey: !Ref EncryptedConsumerKey | ||
EncryptedConsumerSecret: !Ref EncryptedConsumerSecret | ||
SearchText: !Sub '${SearchText} -filter:nativeretweets' # filter out retweet records from search results | ||
TimeoutInMinutes: 20 | ||
|
||
Outputs: | ||
TweetProcessorFunctionArn: | ||
Value: !GetAtt TweetProcessorFunction.Arn | ||
TwitterSearchPollerFunctionArn: | ||
# Reference an output from the nested stack: | ||
Value: !GetAtt TwitterEventSourceApp.Outputs.TwitterSearchPollerFunctionArn |
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.8.0' | ||
__version__ = '1.9.0' |
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
Oops, something went wrong.