0.1.26 • Published 6 days ago

@hybridless/hybridless v0.1.26

Weekly downloads
-
License
GNU GPLv3
Repository
-
Last release
6 days ago

Hybridless Framework Node.js Package

⚠ WARNING: Plugin under initial development .
Exceptions, breaking changes and malfunctioning is expected til 0.1.0 is reach. \ Documentation is also not up to date.


Overall

Hybrid function driven development framework

Hybridless is a plug-in on top of serverless that allows you to have a hybrid platform defined on your serverless definition that shares the same code base and has minimal difference between the lambda and long-running functions.

It makes lambda functions and ECS tasks equivalents by managing the runtimes, container packing, deployment and configurations, allowing you to have applications that run on lambdas and ECS containers, within the same code base and without any differences. Additionally, it shortcuts SNS, SQS, dynamic streams and lambda containers so everything is managed in a similar manner and the developer can focus on the code.

Hybridless implement the Concept of runtimes/buildpacks to allow developers to quickly jump into code without worrying about how to deploy the code. All the complex application packing, runtimes, cluster configurations, load balancers and security rules can be handled for you.


Documentation

Human readable documentation will is available at hybridless.com


General Options Documentation

  [serverless.yml content]
  ....
  hybridless: 
    //Misc
    tags: {
      owner: Me
      Customer: You
    };
    disableWebpack?: boolean; //if using javascript, plugin will auto install and compile es6 code using webpack. You can optionally disable this.
    functions: { [key: string]: Function } | { [key: string]: Function }[];
      //--> means:
      - ${file(config/httpfuncs.yml)} //which containes multiple clusters or just one
      - ${file(config/asyncfuncs.yml)}
      // -- OR -- 
    functions: 
      ClusterName:
        //ECS cluster
        ecsClusterArn?: any;
        ecsIngressSecGroupId?: string;
        enableContainerInsights?: boolean; //default is respecting account settings
        //ALB
        albListenerArn?: any;
        albIsPrivate?: boolean;
        albAdditionalTimeout?: number; //defaults to 1 second
        //
        vpc?: { //this is a auto created VPC. Only one auto created VPC is allowed per project for now. 
          cidr: string;
          subnets: string[];
        } | { //Optional ivars to dictate if will use existing VPC and subnets specified
          vpcId: string;
          securityGroupIds: string[] | any;  //object allows intrinsict functions
          subnetIds: string[] | any;  //object allows intrinsict functions
          albSubnetIds?: string[] | object; //object allows intrinsict functions
        };
        //high order props (can be overwritten at event level)
        timeout?: number;
        handler: string; 
        memory?: number; //defaults to 1024
        //
        events?: {
          runtime: string; //Please, check runtime matrix based on the eventTypy you are using. If using custom runtimes use container runtime constant
          eventType: 'httpd', 'process', 'scheduledTask', 'launchableTask', 'lambda', 'lambdaContainer';
          handler?: string; //this, takes precende over function handler - Usefulll for multi-purpose clusters
          enabled?: boolean; //defaults to true
          memory?: number; //defaults to 1024 - takes precedence over OFunction.memory
          role?: string; //event execution role
          logsRetentionInDays?: number; //defaults to 365 days
          
          /* Container type specific */
          //Only allowed for httpd, process, scheduledTask and lambdaContainer - Please, if using custom docket file, read the how to customize section
          dockerFile?: string; //relative path to the project
          entrypoint?: string; //in case of using container runtimes, you can always make custom entrypoints
          additionalDockerFiles?: [{ from: string, to: string }?];
          dockerBuildArgs?: { [key: string]: string };

          /* Task type specific */
          //Only allowed for httpd, process and schdulerTask
            //Service
          ec2LaunchType?: boolean; //defaults to false, if true will laucnh task into EC2
          newRelicKey?: string;//activates new relic on the supported runtimes
          propagateTags?: 'OFF' | 'SERVICE' | 'TASK' | undefined; //defaults to undefined
          placementConstraints?: { expression: string, type: 'distinctInstance' | 'memberOf' }[];
          placementStrategies?: { field: string, type: 'binpack' | 'random' | 'spread' }[];
          capacityProviderStrategy?: { base: number, capacityProvider: string, weight: number }[];
            //Task
          concurrency?: number; //defaults to 1
          cpu?: number; //defaults to 512
          logsMultilinePattern?: string; //defaults to '(([a-zA-Z0-9\-]* \[[a-zA-Za-]*\] )|(\[[a-zA-Za -]*\] ))'
            //EC2 specific (when ec2LaunchType is true)
          daemonType?: boolean; //indicates if we shall we can one task on each instance of the cluster

          /* From here on, some keys might be duplicated, but are kept like that to improve the scope */

          /* httpd specific */
          runtime: 'nodejs10' | 'nodejs13' | 'php5' | 'php7' | 'container'
            //ALB listener layer
          routes?: {
              path: string;
              method?: string;
              priority?: number; //defaults to 1
          }[];
          cors?: {
              origin: string;
              headers: string[];
              allowCredentials: boolean;
          }
          hostname?: string | string[];
          limitSourceIPs?: string | string[];
          limitHeaders?: { name: string, value: string | string[] }[]; //optional limit headers on ALB
          port?: number; // HTTPD port (the port exposed on the container image) - If port is not specified, it will use 80 for non SSL and 443 for SSL
          certificateArns?: any[]; //certificateArn - if present it will use HTTPS
          cognitoAuthorizer?: {
              poolDomain: string;
              poolArn: any;
              clientId: string;
          };
            //health check
          healthCheckInterval?: number; //defaults to 15,
          healthCheckTimeout?: number; //defaults to 10
          healthCheckHealthyCount?: number; //defaults to 2
          healthCheckUnhealthyCount?: number; //defaults to 5
          healthCheckRoute?: string; //default will use auto generated health route
          //AS
          autoScale?: {
              min?: number; //default to 1
              max?: number; //default to 1
              metric: string;
              cooldown?: number; //defaults to 30
              cooldownIn?: number; //defaults to cooldown but has priority over it
              cooldownOut?: number; //defaults to cooldown but has priority over it
              targetValue: number;
              //step based auto scaling
              scaleIn?: {
                  //scaling
                  adjustmentType?: 'ChangeInCapacity' | 'ExactCapacity' | 'PercentChangeInCapacity'; //defaults to ChangeInCapacity
                  cooldown?: number; //default to 300
                  aggregation: 'Average' | 'Maximum' | 'Minimum';
                  minAdjustmentMagnitude?: number; //Should only be used with PercentChangeInCapacity
                  scaleBy?: number; //defaults to 1 or -1
                  //scaling metric
                  metricNamespace: string;
                  metricName: string;
                  metricDimension: string;
                  metricDimensionTarget: string;
                  metricPeriod?: number; //defaults to 120
                  metricEvaluationPeriod?: number; //defaults to 1
                  operator: 'GreaterThanOrEqualToThreshold' | 'GreaterThanThreshold' | 'LessThanThreshold' | 'LessThanOrEqualToThreshold' | 'LessThanLowerOrGreaterThanUpperThreshold' | 'LessThanLowerThreshold' | 'GreaterThanUpperThreshold';
                  targetValue: number;
                  //additional config (scaling metric)
                  metricDependsOn?: string | string[];
                  additionalDimension?: { dimension: string, target: string }[];
                  treatMissingData?: ' breaching' | 'notBreaching' | 'ignore' | 'missing'; //defaults to notBreaching
                  fillupMissingData?: any; //fillup value is used on absence of data. default to false, true uses '0', number can be specified instead if any other fillup values is needed.
              };
              scaleOut?: {
                  //scaling
                  adjustmentType?: 'ChangeInCapacity' | 'ExactCapacity' | 'PercentChangeInCapacity'; //defaults to ChangeInCapacity
                  cooldown?: number; //default to 300
                  aggregation: 'Average' | 'Maximum' | 'Minimum';
                  minAdjustmentMagnitude?: number; //Should only be used with PercentChangeInCapacity
                  scaleBy?: number; //defaults to 1 or -1
                  //scaling metric
                  metricNamespace: string;
                  metricName: string;
                  metricDimension: string;
                  metricDimensionTarget: string;
                  metricPeriod?: number; //defaults to 120
                  metricEvaluationPeriod?: number; //defaults to 1
                  operator: 'GreaterThanOrEqualToThreshold' | 'GreaterThanThreshold' | 'LessThanThreshold' | 'LessThanOrEqualToThreshold' | 'LessThanLowerOrGreaterThanUpperThreshold' | 'LessThanLowerThreshold' | 'GreaterThanUpperThreshold';
                  targetValue: number;
                  //additional config (scaling metric)
                  metricDependsOn?: string | string[];
                  additionalDimension?: { dimension: string, target: string }[];
                  treatMissingData?: ' breaching' | 'notBreaching' | 'ignore' | 'missing'; //defaults to notBreaching
                  fillupMissingData?: any; //fillup value is used on absence of data. default to false, true uses '0', number can be specified instead if any other fillup values is needed.
              };
          }

          /* process specific */
          /* NO ADDITIONAL PROPS FOR PROCESS */

          /* Scheduler Task specific */
          runtime: 'nodejs10' | 'nodejs13' | 'container';
          schedulerRate: string;
          schedulerInput?: string | object;

          
          
          /* Lambda type specific */
          //Only allowed for lambda and lambdaContainer
          reservedConcurrency?: number;
          disableTracing?: boolean; //XRay tracing is enabled by default
          protocol: 'http' ,'httpLoadBalancer' ,'dynamostreams' ,'sqs' ,'sns' ,'scheduler' ,'cloudWatch' ,'cloudWatchLogstream' ,'cognito' ,'s3' ,'none';
          onError?: string;

          /* Lambda specific */
          layers?: string[];

          /* Lambda container specific */
          runtime?: 'nodejs10' | 'nodejs12' | 'nodejs14' | 'container' | 'java8' | 'java8al12' | 'java11';

          /* Lambda protocols specific */
            //Protocol: cognito
          cognitoUserPoolArn: any;
          cognitoTrigger: string;
            //Protocol: cloudWatchLogstream
          cloudWatchLogGroup: string;
          cloudWatchLogFilter?: string;
            //Protocol: cloudWatch
          cloudWatchEventSource: string;
          cloudWatchDetailType: string;
          cloudWatchDetailState?: string;
          cloudWatchInput?: string | any;
            //Protocol: s3
          s3bucket: string;
          s3event?: string;
          s3bucketExisting?: boolean;
          s3rules?: { [key in ('prefix'|'suffix')]?: string }[];
            //Protocol: dynamostreams
          protocolArn?: any; 
          queueBatchSize?: number;
          maximumRetryAttempts?: number;
          filterPatterns?: {}[];
            //Protocol: scheduler
          schedulerRate?: string; 
          schedulerInput?: string | any; 
            //Protocol: sns
          protocolArn?: any; 
          filterPolicy?: object;
            //Protocol: sqs
          protocolArn?: any; 
          queueBatchSize?: number; 
          reportFailureResponse?: boolean;
            //Protocol: http (api gateway)
          routes: {
              path: string;
              method?: string;
          }[];
          cors?: {
              origin: string;
              headers: string[];
              allowCredentials: boolean;
          }
          cognitoAuthorizerArn?: any; //assumption
            //Protocol: httpLoadBalancer
          routes: {
              path: string;
              method?: string | string[];
              priority?: number; //default to 1
          }[];
          cors?: {
              origin: string;
              headers: string[];
              allowCredentials: boolean;
          }
          //ALB
          hostname?: string | string[];
          limitSourceIPs?: string | string[];
          limitHeader?: { name: string, value: string | string[] }; //optional limit headers on ALB
          cognitoAuthorizer?: {
              poolDomain: string;
              poolArn: any;
              clientId: string;
          };
          //health check
          healthCheckInterval?: number; //defaults to 15,
          healthCheckTimeout?: number; //defaults to 10
          healthCheckHealthyCount?: number; //defaults to 2
          healthCheckUnhealthyCount?: number; //defaults to 5
          healthCheckRoute?: string; //required to enable health checks
        }[];

}

Environment ivar resolutions

By default, hybridless will always attempt to resolve all enviroment ivars that starts with hybridless prefix. Support operations are listed below:

  • resolveContainerAddress
    • Usage: ${hybridless:resolveContainerAddress:FunctionName)} OR ${hybridless:resolveContainerAddress:FunctionName:optionalIndexOfEvent)}
    • Will attempt to resolve the specified function dynamic generated container image URL (with tag).
    • If no optionalIndexOfEvent is specified, plugin will loop into available events and return the first available container image.
    • Returns empty string if unable to resolve.

Roadmap

Roadmap is visible on our public project page

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Happy coding :)

License

GNU GPLv3

0.1.23

6 days ago

0.1.24

6 days ago

0.1.25

6 days ago

0.1.26

6 days ago

0.1.21-alpha

2 months ago

0.1.21

2 months ago

0.1.22

2 months ago

0.1.20

2 months ago

0.1.16

2 months ago

0.1.17

2 months ago

0.1.18

2 months ago

0.1.19

2 months ago

0.1.15-alpha16

3 months ago

0.1.15-alpha17

3 months ago

0.1.15-alpha18

3 months ago

0.1.15-alpha19

3 months ago

0.1.15-alpha20

3 months ago

0.1.15

3 months ago

0.1.15-alpha15

3 months ago

0.1.15-alpha11

3 months ago

0.1.15-alpha12

3 months ago

0.1.15-alpha13

3 months ago

0.1.15-alpha14

3 months ago

0.1.15-alpha10

3 months ago

0.1.13

3 months ago

0.1.14

3 months ago

0.1.15-alpha8

3 months ago

0.1.15-alpha9

3 months ago

0.1.15-alpha6

3 months ago

0.1.15-alpha7

3 months ago

0.1.15-alpha4

3 months ago

0.1.15-alpha5

3 months ago

0.1.15-alpha2

3 months ago

0.1.15-alpha1

3 months ago

0.1.10

3 months ago

0.1.11

3 months ago

0.1.12

3 months ago

0.1.8-alpha2

3 months ago

0.1.8-alpha1

3 months ago

0.1.7-alpha2

3 months ago

0.1.8

3 months ago

0.1.7

3 months ago

0.1.9

3 months ago

0.1.7-alpha

3 months ago

0.1.6

3 months ago

0.1.5

3 months ago

0.1.2

4 months ago

0.1.4

4 months ago

0.1.3

4 months ago

0.1.1

4 months ago

0.1.0-beta

6 months ago

0.1.0-alpha1

7 months ago

0.1.0-alpha2

7 months ago

0.1.0-alpha3

7 months ago

0.0.130-alpha

10 months ago

0.1.0-beta3

6 months ago

0.1.0-beta2

6 months ago

0.1.0-beta1

6 months ago

0.1.0-beta4

6 months ago

0.0.139

8 months ago

0.0.138

9 months ago

0.0.137

10 months ago

0.0.136

10 months ago

0.0.131

10 months ago

0.0.130

10 months ago

0.0.135

10 months ago

0.0.134

10 months ago

0.0.133

10 months ago

0.0.132

10 months ago

0.0.149

7 months ago

0.0.148

7 months ago

0.0.147

7 months ago

0.0.142

8 months ago

0.0.141

8 months ago

0.0.140

8 months ago

0.0.146

7 months ago

0.0.145

8 months ago

0.0.144

8 months ago

0.0.143

8 months ago

0.0.117

2 years ago

0.0.119

2 years ago

0.0.118

2 years ago

0.0.128

2 years ago

0.0.127

2 years ago

0.0.126

2 years ago

0.0.125

2 years ago

0.0.129

2 years ago

0.0.120

2 years ago

0.0.124

2 years ago

0.0.123

2 years ago

0.0.122

2 years ago

0.0.121

2 years ago

0.0.116

2 years ago

0.0.115

2 years ago

0.0.114

2 years ago

0.0.106

2 years ago

0.0.105

2 years ago

0.0.104

2 years ago

0.0.103

2 years ago

0.0.109

2 years ago

0.0.107

2 years ago

0.0.113-a

2 years ago

0.0.102

2 years ago

0.0.101

2 years ago

0.0.100

2 years ago

0.0.113

2 years ago

0.0.112

2 years ago

0.0.111

2 years ago

0.0.110

2 years ago

0.0.95

2 years ago

0.0.96

2 years ago

0.0.97

2 years ago

0.0.98

2 years ago

0.0.99

2 years ago

0.0.91

2 years ago

0.0.92

2 years ago

0.0.93

2 years ago

0.0.94

2 years ago

0.0.90

2 years ago

0.0.85

2 years ago

0.0.86

2 years ago

0.0.87

2 years ago

0.0.88

2 years ago

0.0.89

2 years ago

0.0.86-alpha

2 years ago

0.0.88-alpha

2 years ago

0.0.85-alpha5

2 years ago

0.0.85-alpha4

2 years ago

0.0.85-alpha3

2 years ago

0.0.85-alpha7

2 years ago

0.0.85-alpha6

2 years ago

0.0.84

2 years ago

0.0.84-alpha9

2 years ago

0.0.80

2 years ago

0.0.81

2 years ago

0.0.82

2 years ago

0.0.83

2 years ago

0.0.84-alpha5

2 years ago

0.0.84-alpha6

2 years ago

0.0.84-alpha7

2 years ago

0.0.84-alpha8

2 years ago

0.0.84-alpha1

2 years ago

0.0.84-alpha2

2 years ago

0.0.84-alpha3

2 years ago

0.0.84-alpha4

2 years ago

0.0.78-alpha2

2 years ago

0.0.78-alpha3

2 years ago

0.0.78-alpha4

2 years ago

0.0.78-alpha5

2 years ago

0.0.78-alpha1

2 years ago

0.0.78-alpha6

2 years ago

0.0.78-alpha7

2 years ago

0.0.78-alpha8

2 years ago

0.0.78-alpha9

2 years ago

0.0.84-alpha10

2 years ago

0.0.84-alpha11

2 years ago

0.0.84-alpha12

2 years ago

0.0.84-alpha14

2 years ago

0.0.84-alpha15

2 years ago

0.0.84-alpha16

2 years ago

0.0.84-alpha17

2 years ago

0.0.84-alpha18

2 years ago

0.0.84-alpha19

2 years ago

0.0.84-alpha21

2 years ago

0.0.84-alpha22

2 years ago

0.0.84-alpha23

2 years ago

0.0.84-alpha24

2 years ago

0.0.84-alpha20

2 years ago

0.0.85-alpha1

2 years ago

0.0.85-alpha2

2 years ago

0.0.77-alpha2

2 years ago

0.0.76

2 years ago

0.0.77-alpha

2 years ago

0.0.74

2 years ago

0.0.75

2 years ago

0.0.74-beta

2 years ago

0.0.74-alpha3

2 years ago

0.0.74-alpha2

2 years ago

0.0.74-alpha5

2 years ago

0.0.74-alpha4

2 years ago

0.0.74-alpha7

2 years ago

0.0.74-alpha6

2 years ago

0.0.74-alpha9

2 years ago

0.0.74-alpha8

2 years ago

0.0.74-beta12

2 years ago

0.0.74-beta11

2 years ago

0.0.74-beta10

2 years ago

0.0.74-alpha17

2 years ago

0.0.74-beta1

2 years ago

0.0.74-beta2

2 years ago

0.0.74-beta3

2 years ago

0.0.74-beta8

2 years ago

0.0.74-beta9

2 years ago

0.0.74-beta4

2 years ago

0.0.74-beta5

2 years ago

0.0.74-beta6

2 years ago

0.0.74-beta7

2 years ago

0.0.74-alpha11

2 years ago

0.0.74-alpha12

2 years ago

0.0.74-alpha10

2 years ago

0.0.74-alpha15

2 years ago

0.0.74-alpha16

2 years ago

0.0.74-alpha13

2 years ago

0.0.74-alpha14

2 years ago

0.0.74-alpha

2 years ago

0.0.73

3 years ago

0.0.71

3 years ago

0.0.72

3 years ago

0.0.70

3 years ago

0.0.70-alpha20

3 years ago

0.0.62

3 years ago

0.0.70-alpha21

3 years ago

0.0.63

3 years ago

0.0.64

3 years ago

0.0.65

3 years ago

0.0.70-alpha9

3 years ago

0.0.70-alpha6

3 years ago

0.0.70-alpha

3 years ago

0.0.70-alpha7

3 years ago

0.0.61

3 years ago

0.0.70-alpha4

3 years ago

0.0.70-alpha5

3 years ago

0.0.70-alpha2

3 years ago

0.0.70-alpha3

3 years ago

0.0.70-alpha10

3 years ago

0.0.70-alpha11

3 years ago

0.0.70-alpha12

3 years ago

0.0.70-alpha17

3 years ago

0.0.70-alpha18

3 years ago

0.0.70-alpha19

3 years ago

0.0.70-alpha13

3 years ago

0.0.70-alpha14

3 years ago

0.0.70-alpha15

3 years ago

0.0.70-alpha16

3 years ago

0.0.60

3 years ago

0.0.51

3 years ago

0.0.52

3 years ago

0.0.53

3 years ago

0.0.54

3 years ago

0.0.55

3 years ago

0.0.56

3 years ago

0.0.57

3 years ago

0.0.58

3 years ago

0.0.47

3 years ago

0.0.50

3 years ago

0.0.48

3 years ago

0.0.49

3 years ago

0.0.42

3 years ago

0.0.43

3 years ago

0.0.45

3 years ago

0.0.46

3 years ago

0.0.41

3 years ago

0.0.40

3 years ago

0.0.38

3 years ago

0.0.39

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.37

3 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.32

3 years ago

0.0.33

3 years ago

0.0.34

3 years ago

0.0.35

3 years ago

0.0.36

3 years ago

0.0.26

3 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.29

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago