@ikonintegration/serverless-ikcomponents-plugin

1.2.4 • Public • Published

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

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.41latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.41
1.2.31
1.2.21
1.2.11
1.2.0-alpha301
1.2.0-alpha291
1.2.0-alpha281
1.2.0-alpha270
1.2.0-alpha261
1.2.0-alpha251
1.2.0-alpha241
1.2.0-alpha230
1.2.0-alpha220
1.2.0-alpha210
1.2.0-alpha203
1.2.0-alpha191
1.2.0-alpha180
1.2.0-alpha171
1.2.0-alpha160
1.2.0-alpha150
1.2.0-alpha140
1.2.0-alpha130
1.2.0-alpha120
1.2.0-alpha111
1.2.0-alpha100
1.2.0-alpha091
1.2.0-alpha081
1.2.0-alpha071
1.2.0-alpha060
1.2.0-alpha051
1.2.0-alpha041
1.2.0-alpha031
1.2.0-alpha020
1.2.0-alpha011
1.1.21
1.1.11
1.1.00
1.0.91
1.0.80
1.0.71
1.0.60
1.0.5-alpha030
1.0.5-alpha021
1.0.5-alpha011
1.0.41
1.0.30
1.0.21
1.0.10
1.0.01
0.9.90
0.9.80
0.9.71
0.9.61
0.9.50
0.9.40
0.9.31
0.9.20
0.9.10
0.9.1-beta11
0.9.00
0.9.0-beta21
0.9.0-beta11
0.9.0-alpha131
0.9.0-alpha121
0.9.0-alpha110
0.9.0-alpha101
0.9.0-alpha90
0.9.0-alpha81
0.9.0-alpha71
0.9.0-alpha60
0.9.0-alpha50
0.9.0-alpha41
0.9.0-alpha30
0.9.0-alpha21
0.9.0-alpha11
0.8.51
0.8.41
0.8.30
0.8.21
0.8.11
0.8.00
0.7.6-alpha31
0.7.6-alpha21
0.7.6-alpha10
0.7.51
0.7.41
0.7.31
0.7.21
0.7.10
0.7.01
0.6.90
0.6.81
0.6.70
0.6.61
0.6.51
0.6.41
0.6.30
0.6.20
0.6.10
0.6.01
0.5.90
0.5.81
0.5.71
0.5.61
0.5.51
0.5.41
0.5.30
0.5.21
0.5.11
0.5.01
0.4.90
0.4.80
0.4.71
0.4.60
0.4.51
0.4.41
0.4.31
0.4.21
0.4.10
0.4.01
0.3.90
0.3.82
0.3.71
0.3.61
0.3.41
0.3.30
0.3.21
0.3.11
0.3.01
0.2.11
0.2.00
0.1.61
0.1.51
0.1.41
0.1.31
0.1.20
0.1.10
0.1.01
0.0.91
0.0.80
0.0.71
0.0.61
0.0.50
0.0.41
0.0.33
0.0.21
0.0.11

Package Sidebar

Install

npm i @ikonintegration/serverless-ikcomponents-plugin

Weekly Downloads

8

Version

1.2.4

License

MIT

Unpacked Size

133 kB

Total Files

41

Last publish

Collaborators

  • vitor-ikon
  • mateus.ikon
  • gwdebes
  • rescio