Esempio n. 1
0
        public OrdersController()
        {
            string connectionString = LambdaConfiguration.GetDatabaseCreds();

            var optionsBuilder = new DbContextOptionsBuilder <TagisDbContext>();

            optionsBuilder.UseMySQL(connectionString);

            _context = new TagisDbContext(optionsBuilder.Options);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }