public OrdersController() { string connectionString = LambdaConfiguration.GetDatabaseCreds(); var optionsBuilder = new DbContextOptionsBuilder <TagisDbContext>(); optionsBuilder.UseMySQL(connectionString); _context = new TagisDbContext(optionsBuilder.Options); }
internal LambdaStack(Construct scope, string id, IStackProps props = null) : base(scope, id, props) { var config = new LambdaConfiguration() { FunctionName = id, Resource = "./resources/function" }; var lambda = new LambdaFunction(this); lambda.Construct(config); }
public void Construct(LambdaConfiguration app) { var bucket = new Bucket(this.stack, "FunctionStore"); var handler = new Function(this.stack, "Function", new FunctionProps { Runtime = Runtime.NODEJS_12_X, FunctionName = app.FunctionName, Code = Code.FromAsset(app.Resource), Handler = "index.handler", Environment = new Dictionary <string, string> { { "BUCKET", bucket.BucketName } } }); bucket.GrantReadWrite(handler); }