1.2.4 • Published 3 years ago

@ikonintegration/serverless-ikcomponents-plugin v1.2.4

Weekly downloads
346
License
MIT
Repository
-
Last release
3 years ago

IKComponents Node.js Package

Overall

  • npm npm npm (tag) Libraries.io dependency status for latest release, scoped npm package
  • GitHub commit activity
  • GitHub last commit

installation:

in webpack.config.js

 const slsikcomponents = require('@ikonintegration/serverless-ikcomponents-plugin');
  // Important step for ikcomponents
  entry: {
    ...slsw.lib.entries,
    ...slsikcomponents.getWebpackEntries()
  },

serverless.yml

  • add the plugin into the list
  • install the module
  • write the component :)
  • plugin will output errors and not allow deployment if additional dependecies are required

    Now done automatically

  • add role '...-dev-us-west-2-lambdaRole' trust relation with 'ecs-tasks.amazonaws.com' -->

    Options

    custom:
      cognito: true || .... (This will enable cognito principal to be added to IAM role)
      apigateway: true || ... (This will enable api gateway principal to be added to IAM role)
    stepFunctions: true || .... (This will enable step functions principal to be added to IAM role)
    ....(your serverless.yml)
    ikcomponents:
      tags: Array<{
        key: value
      }>;
      functions?: Array<{
        handler?: string;
        vpc?: OVPCOptions;
        elbListenerArn?: string;
        //Indicates if the cluster will not be created and an shared ECS cluster should be used instead
        ecsClusterArn?: string; //ecs shared cluster ARN
        ecsIngressSecGroupId?: string; //ecs shared cluster ingress vpc group
        timeout?: number; //Only works with lambda based
        memory?: number; //defaults to 1024
        newRelicKey?: string;//
        events?: Array<{
          eventType: 'process' | 'httpd' | 'lambda;
          handler?: string; //this, takes precende over function handler - Usefulll for multi-purpose clusters
          enabled?: boolean; //defaults to true
          <!-- Only available for process and httpd types -->
          runtime?: 'nodejs10' | 'nodejs13' | 'php5' | 'php7';
          concurrency?: number; //defaults to 1
          shouldUseEC2?: boolean; //defaults to false, if true will laucnh task into EC2
          cpu?: number; //defaults to 512
          memory?: number; //defaults to 1024 - takes precedence over OFunction.memory
          role?: string;
          hostname?: string | string[];
          limitSourceIPs?: string | string[];
          <!-- Only available for httpd type -->
          port?: number; // HTTPD port (the port exposed on the container image) - if not specified random port will be used - usefull for busy private subnets - If port is not specified, it will use 80 for non SSL and 443 for SSL
          certificateArns?: string[]; //certificateArn - if present it will use HTTPS
          priority?: number; //Router priority, usefull for leaving wildcard routes to be the last resort
          cognitoAuthorizer? {
              poolDomain: string;
              poolArn: string;
              clientId: string;
          }
          //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;
          }
          //health check
          healthCheckInterval?: number; //defaults to 15,
          healthCheckTimeout?: number; //defaults to 10
          healthCheckHealthyCount?: number; //defaults to 2
          healthCheckUnhealthyCount?: number; //defaults to 5
          <!-- httpd or lambda -->
          routes?: Array<{ //required if on lambda (http) or httpd -- if sqs or other stream type this is desconsidered
            path: string;
            method: string;
          }>;
          cors?: {
            origin: string;
            headers: string[];
            allowCredentials: boolean;
          }
          <!-- Lambda only -->
          layers?: string[];
          protocol?: 'http | 'dynamostreams' | 'sqs' | 'sqs | 'scheduler'; //defaults to HTTP 
          prototocolArn?: any; //Only used when protocol is dynamostreams or sqs
          queueBatchSize?: number; //Only used when protocol is sqs
          schedulerRate?: string; //Only used when protocol is scheduler
          schedulerInput?: string; //Only used when protocol is scheduler
          reservedConcurrency?: number;
          filterPolicy?: object; //Only used when protocol is sns
        }>;
      }>

    Example

    ikcomponents:
      tags:
        workload: Sample
      functions:
        Proc: #CLUSTER
          handler: src/queue/PROCESS.handler
          vpc: ${self:custom.esvpc}
          events:
            - eventType: process
              runtime: nodejs13
              # memory: 1024 -- default/min for long running
        Httpd: #CLUSTER
          handler: src/router.handler
          vpc: ${self:custom.esvpc}
          events:
            - eventType: httpd
              runtime: nodejs13
              routes:
                - method: ANY
                  path: *
        MultiPurp: #CLUSTER
          vpc: ${self:custom.esvpc}
          events:
            - eventType: httpd
              runtime: nodejs13
              handler: src/router.handler
              routes:
                - method: ANY
                  path: *
            - eventType: httpd
              runtime: nodejs13
              handler: src/router.handler
              routes:
                - method: GET
                  path: /test
          - eventType: process
              runtime: nodejs13
              handler: src/queue/PROCESS.handler
1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.2

3 years ago

1.2.0-alpha20

3 years ago

1.2.0-alpha21

3 years ago

1.2.0-alpha28

3 years ago

1.2.0-alpha29

3 years ago

1.2.0-alpha26

3 years ago

1.2.0-alpha27

3 years ago

1.2.0-alpha24

3 years ago

1.2.0-alpha25

3 years ago

1.2.0-alpha22

3 years ago

1.2.0-alpha23

3 years ago

1.2.0-alpha30

3 years ago

1.2.0-alpha08

3 years ago

1.2.0-alpha09

3 years ago

1.2.0-alpha06

3 years ago

1.2.0-alpha07

3 years ago

1.2.0-alpha04

3 years ago

1.2.0-alpha05

3 years ago

1.2.0-alpha02

3 years ago

1.2.0-alpha03

3 years ago

1.2.0-alpha01

3 years ago

1.2.0-alpha19

3 years ago

1.2.0-alpha10

3 years ago

1.2.0-alpha17

3 years ago

1.2.0-alpha18

3 years ago

1.2.0-alpha15

3 years ago

1.2.0-alpha16

3 years ago

1.2.0-alpha13

3 years ago

1.2.0-alpha14

3 years ago

1.2.0-alpha11

3 years ago

1.2.0-alpha12

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.5-alpha02

3 years ago

1.0.5-alpha01

3 years ago

1.0.5-alpha03

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

0.9.9

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.9.8

3 years ago

0.9.7

3 years ago

0.9.4

3 years ago

0.9.6

3 years ago

0.9.5

3 years ago

0.9.3

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.1-beta1

3 years ago

0.9.0

3 years ago

0.9.0-beta2

3 years ago

0.9.0-beta1

3 years ago

0.9.0-alpha13

3 years ago

0.9.0-alpha12

3 years ago

0.9.0-alpha10

3 years ago

0.9.0-alpha11

3 years ago

0.9.0-alpha9

3 years ago

0.9.0-alpha8

3 years ago

0.9.0-alpha7

3 years ago

0.9.0-alpha6

3 years ago

0.9.0-alpha5

3 years ago

0.9.0-alpha4

3 years ago

0.9.0-alpha3

3 years ago

0.9.0-alpha2

3 years ago

0.9.0-alpha1

3 years ago

0.8.5

3 years ago

0.8.4

4 years ago

0.8.3

4 years ago

0.8.2

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.6-alpha3

4 years ago

0.7.6-alpha2

4 years ago

0.7.6-alpha1

4 years ago

0.7.5

4 years ago

0.7.4

4 years ago

0.6.7

4 years ago

0.6.6

4 years ago

0.6.9

4 years ago

0.6.8

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.3

4 years ago

0.7.0

4 years ago

0.6.5

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.4

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.9

4 years ago

0.5.8

4 years ago

0.5.7

4 years ago

0.5.4

4 years ago

0.5.3

4 years ago

0.5.6

4 years ago

0.5.5

4 years ago

0.5.2

4 years ago

0.4.9

4 years ago

0.5.0

4 years ago

0.5.1

4 years ago

0.4.8

4 years ago

0.4.7

4 years ago

0.4.6

4 years ago

0.4.5

4 years ago

0.3.9

4 years ago

0.4.4

4 years ago

0.3.8

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.4

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.3

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.2

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago