sls-helper-plugin-janis
Advanced tools
Comparing version 2.9.2 to 2.10.0-beta.0
@@ -8,2 +8,4 @@ # Changelog | ||
## [Unreleased] | ||
### Added | ||
- Custom IAM Role added to avoid hitting IAM Policy size limit | ||
@@ -10,0 +12,0 @@ ## [2.9.2] - 2020-03-26 |
@@ -32,2 +32,3 @@ 'use strict'; | ||
region: 'us-east-1', | ||
role: 'ServiceExecutionRole', | ||
endpointType: 'REGIONAL', | ||
@@ -47,13 +48,2 @@ apiName: 'JANIS ${self:custom.humanReadableStage.${self:custom.stage}} ${self:custom.serviceTitle} API', | ||
}, | ||
iamRoleStatements: [ | ||
{ | ||
Effect: 'Allow', | ||
Action: [ | ||
's3:PutObject' | ||
], | ||
Resource: [ | ||
'arn:aws:s3:::janis-trace-service-${self:custom.stage}/*' | ||
] | ||
} | ||
], | ||
...(provider || {}) | ||
@@ -153,2 +143,68 @@ }, | ||
ServiceExecutionRole: { | ||
Type: 'AWS::IAM::Role', | ||
Properties: { | ||
RoleName: 'Janis${self:custom.serviceName}Service-lambdaRole', | ||
Path: '/janis-service/', | ||
AssumeRolePolicyDocument: { | ||
Version: '2012-10-17', | ||
Statement: [ | ||
{ | ||
Effect: 'Allow', | ||
Principal: { | ||
Service: [ | ||
'lambda.amazonaws.com' | ||
] | ||
}, | ||
Action: 'sts:AssumeRole' | ||
} | ||
] | ||
}, | ||
// If VPC is configured, it must include this managed policy | ||
...(provider && provider.vpc ? { ManagedPolicyArns: ['arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole'] } : {}), | ||
Policies: [ | ||
{ | ||
PolicyName: 'janis-${self:custom.serviceCode}-logs-policy', | ||
PolicyDocument: { | ||
Version: '2012-10-17', | ||
Statement: [ | ||
{ | ||
Effect: 'Allow', | ||
Action: [ | ||
'logs:CreateLogGroup', | ||
'logs:CreateLogStream', | ||
'logs:PutLogEvents' | ||
], | ||
Resource: [ | ||
{ | ||
'Fn::Join': [ | ||
':', | ||
[ | ||
'arn:aws:logs', | ||
{ Ref: 'AWS::Region' }, | ||
{ Ref: 'AWS::AccountId' }, | ||
'log-group:/aws/lambda/*:*' | ||
] | ||
] | ||
}, | ||
{ | ||
'Fn::Join': [ | ||
':', | ||
[ | ||
'arn:aws:logs', | ||
{ Ref: 'AWS::Region' }, | ||
{ Ref: 'AWS::AccountId' }, | ||
'log-group:/aws/lambda/*:*:*' | ||
] | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
UnauthorizedResponse: { | ||
@@ -155,0 +211,0 @@ Type: 'AWS::ApiGateway::GatewayResponse', |
{ | ||
"name": "sls-helper-plugin-janis", | ||
"version": "2.9.2", | ||
"version": "2.10.0-beta.0", | ||
"description": "A Serverless Helper plugin to add custom helpers for JANIS Commerce", | ||
@@ -5,0 +5,0 @@ "main": "lib/plugin.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39672
922
1