more optimizations to reduce lambda size
This commit is contained in:
parent
1ba5b74eeb
commit
bfbb2e27a8
@ -1,7 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
import boto3
|
import boto3
|
||||||
from boto.dynamodb2.exceptions import ResourceInUseException
|
|
||||||
|
|
||||||
db = boto3.resource('dynamodb')
|
db = boto3.resource('dynamodb')
|
||||||
|
|
||||||
@ -47,7 +46,7 @@ def get_trade_table():
|
|||||||
'WriteCapacityUnits': 1
|
'WriteCapacityUnits': 1
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
except ResourceInUseException as e:
|
except Exception as e:
|
||||||
print("table already exist {}".format(e))
|
print("table already exist {}".format(e))
|
||||||
|
|
||||||
return db.Table(table_name)
|
return db.Table(table_name)
|
||||||
@ -93,7 +92,7 @@ def get_strategy_table():
|
|||||||
'WriteCapacityUnits': 1
|
'WriteCapacityUnits': 1
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
except ResourceInUseException as e:
|
except Exception as e:
|
||||||
print("table already exist {}".format(e))
|
print("table already exist {}".format(e))
|
||||||
|
|
||||||
return db.Table(table_name)
|
return db.Table(table_name)
|
||||||
|
@ -18,13 +18,8 @@ provider:
|
|||||||
iamRoleStatements:
|
iamRoleStatements:
|
||||||
- Effect: Allow
|
- Effect: Allow
|
||||||
Action:
|
Action:
|
||||||
- dynamodb:Query
|
- dynamodb:*
|
||||||
- dynamodb:Scan
|
Resource: "*"
|
||||||
- dynamodb:GetItem
|
|
||||||
- dynamodb:PutItem
|
|
||||||
- dynamodb:UpdateItem
|
|
||||||
- dynamodb:DeleteItem
|
|
||||||
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/*"
|
|
||||||
- Effect: Allow
|
- Effect: Allow
|
||||||
Action:
|
Action:
|
||||||
- SNS:*
|
- SNS:*
|
||||||
|
Loading…
Reference in New Issue
Block a user