//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _logic = new Logic(this); // read configuration settings var tableName = config.ReadDynamoDBTableName("RegistrationTable"); // initialize clients var dynamoClient = new AmazonDynamoDBClient(); _registrations = new RegistrationTable(dynamoClient, tableName); _cachedRegistrations = new Dictionary <string, OwnerMetaData>(); _rollbarClient = new RollbarClient( httpClient: null, accountReadAccessToken: null, accountWriteAccessToken: null, message => LogInfo(message) ); _eventsClient = new AmazonCloudWatchEventsClient(); _firehoseClient = new AmazonKinesisFirehoseClient(); _selfMetaData = new OwnerMetaData { ModuleInfo = Info.ModuleInfo, Module = Info.ModuleFullName, ModuleId = Info.ModuleId, FunctionId = Info.FunctionId, FunctionName = Info.FunctionName, FunctionLogGroupName = CurrentContext.LogGroupName, FunctionPlatform = "AWS Lambda", FunctionFramework = Info.FunctionFramework, FunctionLanguage = "csharp" }; }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _connections = new ConnectionsTable( config.ReadDynamoDBTableName("ConnectionsTable"), new AmazonDynamoDBClient() ); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _table = new DynamoTable( config.ReadDynamoDBTableName("RobotStateTable"), new AmazonDynamoDBClient() ); }
public override async Task InitializeAsync(LambdaConfig config) { // initialize AWS clients _dynamoDbClient = new AmazonDynamoDBClient(); // read settings _table = Table.LoadTable(_dynamoDbClient, config.ReadDynamoDBTableName("BookmarksTable")); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _transcribe = new AmazonTranscribeServiceClient(); _table = new IndexingStatusTable( config.ReadDynamoDBTableName("IndexingStatusTable"), new AmazonDynamoDBClient() ); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { // read configuration settings var dataTableName = config.ReadDynamoDBTableName("DataTable"); // initialize AWS clients _dataTable = new DataTable(dataTableName, new AmazonDynamoDBClient()); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { // read configuration settings var tableName = config.ReadDynamoDBTableName("DataTable"); // initialize clients _dataAccessClient = new ThriftBooksDataAccessClient(tableName); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { // read function settings _tableName = config.ReadDynamoDBTableName("Table"); _priceRetentionInMinutes = config.ReadInt("PriceRetentionInMinutes"); // initialize clients _dynamoClient = new AmazonDynamoDBClient(); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _amaClient = new AmazonApiGatewayManagementApiClient(new AmazonApiGatewayManagementApiConfig { ServiceURL = config.ReadText("Module::WebSocket::Url") }); _connections = new ConnectionsTable( config.ReadDynamoDBTableName("ConnectionsTable"), new AmazonDynamoDBClient() ); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _table = new DynamoTable( config.ReadDynamoDBTableName("GameTable"), new AmazonDynamoDBClient() ); _gameStateMachine = config.ReadText("GameLoopStateMachine"); _stepFunctionsClient = new AmazonStepFunctionsClient(); _lambdaClient = new AmazonLambdaClient(); _gameTurnFunctionArn = config.ReadText("GameTurnFunction"); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { // read configuration settings var dataTableName = config.ReadDynamoDBTableName("DataTable"); _notifyQueueUrl = config.ReadSqsQueueUrl("NotifyQueue"); // initialize AWS clients _sqsClient = new AmazonSQSClient(); _dataTable = new DataTable(dataTableName, new AmazonDynamoDBClient()); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _s3Client = new AmazonS3Client(); _destinationBucketName = config.ReadS3BucketName("ExtractedAudioBucket"); _table = new IndexingStatusTable( config.ReadDynamoDBTableName("IndexingStatusTable"), new AmazonDynamoDBClient() ); // show contents of /opt folder; the 'ffmpeg' file must have execution permissions to be invocable LogInfo(Exec("/bin/bash", "-c \"ls -al /opt\"").Output); }
//--- Methods --- public async override Task InitializeAsync(LambdaConfig config) { var tableName = config.ReadDynamoDBTableName("RegistrationTable"); _registrations = new RegistrationTable(new AmazonDynamoDBClient(), tableName); _rollbarClient = new RollbarClient( config.ReadText("RollbarReadAccessToken", defaultValue: null), config.ReadText("RollbarWriteAccessToken", defaultValue: null), message => LogInfo(message) ); _rollbarProjectPrefix = config.ReadText("RollbarProjectPrefix"); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { // read configuration settings var dataTableName = config.ReadDynamoDBTableName("DataTable"); var webSocketUrl = config.ReadText("Module::WebSocket::Url"); // initialize AWS clients _amaClient = new AmazonApiGatewayManagementApiClient(new AmazonApiGatewayManagementApiConfig { ServiceURL = webSocketUrl }); _dataTable = new DataTable(dataTableName, new AmazonDynamoDBClient()); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { // initialize Lambda function _lambdaClient = new AmazonLambdaClient(); _amaClient = new AmazonApiGatewayManagementApiClient(new AmazonApiGatewayManagementApiConfig { ServiceURL = config.ReadText("Module::WebSocket::Url") }); _table = new DynamoTable( config.ReadDynamoDBTableName("GameTable"), new AmazonDynamoDBClient() ); _gameApiUrl = config.ReadText("RestApiUrl"); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _logic = new Logic(this); _snsClient = new AmazonSimpleNotificationServiceClient(); _errorTopic = config.ReadText("ErrorReportTopic"); _usageTopic = config.ReadText("UsageReportTopic"); var tableName = config.ReadDynamoDBTableName("RegistrationTable"); var dynamoClient = new AmazonDynamoDBClient(); _registrations = new RegistrationTable(dynamoClient, tableName); _cachedRegistrations = new Dictionary <string, OwnerMetaData>(); _rollbarClient = new RollbarClient(null, null, message => LogInfo(message)); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { // read configuration settings var dataTableName = config.ReadDynamoDBTableName("DataTable"); _eventTopicArn = config.ReadText("EventTopic"); _broadcastApiUrl = config.ReadText("EventBroadcastApiUrl"); _httpApiToken = config.ReadText("HttpApiInvocationToken"); _clientApiKey = config.ReadText("ClientApiKey"); // initialize AWS clients _snsClient = new AmazonSimpleNotificationServiceClient(); _dataTable = new DataTable(dataTableName, new AmazonDynamoDBClient()); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { // read configuration settings var dataTableName = config.ReadDynamoDBTableName("DataTable"); var webSocketUrl = config.ReadText("Module::WebSocket::Url"); _eventTopicArn = config.ReadText("EventTopic"); _keepAliveRuleArn = config.ReadText("KeepAliveRuleArn"); _httpApiToken = config.ReadText("HttpApiInvocationToken"); // initialize AWS clients _amaClient = new AmazonApiGatewayManagementApiClient(new AmazonApiGatewayManagementApiConfig { ServiceURL = webSocketUrl }); _dataTable = new DataTable(dataTableName, new AmazonDynamoDBClient()); }
//--- Methods --- public async override Task InitializeAsync(LambdaConfig config) { var tableName = config.ReadDynamoDBTableName("RegistrationTable"); _registrations = new RegistrationTable(new AmazonDynamoDBClient(), tableName); _rollbarClient = new RollbarClient( config.ReadText("RollbarReadAccessToken", defaultValue: null), config.ReadText("RollbarWriteAccessToken", defaultValue: null), message => LogInfo(message) ); _rollbarProjectPattern = config.ReadText("RollbarProjectPattern"); _coreSecretsKey = config.ReadText("CoreSecretsKey"); // set default project pattern if none is specified if (string.IsNullOrEmpty(_rollbarProjectPattern)) { var rollbarProjectPrefix = config.ReadText("RollbarProjectPrefix"); _rollbarProjectPattern = $"{rollbarProjectPrefix}{{ModuleFullName}}"; } }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _xmlNamespaces = new XmlNamespaceManager(new NameTable()); _xmlNamespaces.AddNamespace("sns", "http://sns.amazonaws.com/doc/2010-03-31/"); // read configuration settings var dataTableName = config.ReadDynamoDBTableName("DataTable"); var webSocketUrl = config.ReadText("Module::WebSocket::Url"); _eventTopicArn = config.ReadText("EventTopic"); _keepAliveRuleArn = config.ReadText("KeepAliveRuleArn"); _httpApiToken = config.ReadText("HttpApiInvocationToken"); // initialize clients _snsClient = new AmazonSimpleNotificationServiceClient(); _amaClient = new AmazonApiGatewayManagementApiClient(new AmazonApiGatewayManagementApiConfig { ServiceURL = webSocketUrl }); _dataTable = new DataTable(dataTableName, new AmazonDynamoDBClient()); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { // initialize twitter client Auth.SetApplicationOnlyCredentials( config.ReadText("TwitterApiKey"), config.ReadText("TwitterApiSecretKey"), true ); _twitterSearchQuery = config.ReadText("TwitterQuery"); _twitterLanguageFilter = new HashSet <string>(config.ReadCommaDelimitedList("TwitterLanguageFilter")); _twitterSentimentFilter = config.ReadText("TwitterSentimentFilter"); // initialize Comprehend client _comprehendClient = new AmazonComprehendClient(); // initialize DynamoDB table _dynamoClient = new AmazonDynamoDBClient(); _table = Table.LoadTable(_dynamoClient, config.ReadDynamoDBTableName("Table")); // initialize SNS client _snsClient = new AmazonSimpleNotificationServiceClient(); _notificationTopic = config.ReadText("TweetTopic"); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _dataClient = new DataAccessClient(config.ReadDynamoDBTableName("GameTable")); _gameLoopFunctionArn = config.ReadText("GameLoopFunction"); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _table = new TaskTable(config.ReadDynamoDBTableName("TaskTable")); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _dataClient = new DataAccessClient(config.ReadDynamoDBTableName("GameTable")); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _dynamoDbClient = new AmazonDynamoDBClient(); _table = Table.LoadTable(_dynamoDbClient, config.ReadDynamoDBTableName("Table")); _encryptionKeyArn = config.ReadText("EncryptionKey"); }