Skip to content

Commit

Permalink
added support for PAY_PER_REQUEST billing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Tulsian committed Nov 1, 2019
1 parent 032bfa4 commit 0f3ed2a
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 29 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ _NOTE_: When creating global tables with `createStack: false`, any update the so
- Updated the package to deploy the service stack in the new region(s) by default
- Added support to setup auto-scaling on global tables when not using create stack feature.
- Added unit-tests
* 2.1.0
- Added support for PAY_PER_REQUEST billing mode for `createStack: true` mode

25 changes: 10 additions & 15 deletions examples/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"serverless-attach-managed-policy": "0.0.7",
"serverless-create-global-dynamodb-table": "git+https://github.com/rrahul963/serverless-create-global-dynamodb-table.git#refactor"
"serverless-create-global-dynamodb-table": "^2.0.0"
},
"dependencies": {
"lodash.get": "^4.4.2"
Expand Down
15 changes: 7 additions & 8 deletions examples/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@
service: test-global-table-creation
frameworkVersion: '>=1.1.0 <2.0.0'
plugins:
- serverless-attach-managed-policy
- serverless-create-global-dynamodb-table

provider:
name: aws
runtime: nodejs8.10
region: ${opt:region, 'us-west-2'}
region: ${opt:region, 'us-east-1'}
stage: ${opt:stage, 'dev'}
tracing: true
deploymentBucket:
name: das-deployment-packages-dev-us-west-2
managedPolicyArns: arn:aws:iam::403481480537:policy/appteam/fff000-iam-nonprod-wcm-01-TeamManagedPolicy-IP1WSES0IVD7
name: aws-deployment-packages-dev-us-east-1

custom:
globalTables:
regions:
- us-east-2
createStack: false
createStack: true

resources:
Resources:
Expand All @@ -36,9 +34,10 @@ resources:
KeyType: 'HASH'
PointInTimeRecoverySpecification:
PointInTimeRecoveryEnabled: true
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
# ProvisionedThroughput:
# ReadCapacityUnits: 5
# WriteCapacityUnits: 5
BillingMode: PAY_PER_REQUEST
StreamSpecification:
StreamViewType: NEW_AND_OLD_IMAGES
TableName: Test-Dynamodb-Table
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-create-global-dynamodb-table",
"version": "2.0.0",
"version": "2.0.1",
"description": "serverless plugin that would create global dynamodb tables for specified tables",
"main": "src/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const createUpdateCfnStack = async function createUpdateCfnStack(cfn, template,
const createStackParams = {
StackName: stackName,
TemplateBody: JSON.stringify(template),
Capabilities: ['CAPABILITY_IAM']
Capabilities: ['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM']
};
await cfn.createStack(createStackParams).promise();
} catch (err) {
Expand All @@ -88,7 +88,7 @@ const createUpdateCfnStack = async function createUpdateCfnStack(cfn, template,
const updateStackParams = {
StackName: stackName,
TemplateBody: JSON.stringify(template),
Capabilities: ['CAPABILITY_IAM']
Capabilities: ['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM']
};
await cfn.updateStack(updateStackParams).promise();
} catch (err) {
Expand Down

0 comments on commit 0f3ed2a

Please sign in to comment.