awslabs / dynamodb-continuous-backup

Continuous backup automation for Amazon DynamoDB
Apache License 2.0
185 stars 32 forks source link

Unable to import module 'index': No module named index #26

Closed grayaii closed 7 years ago

grayaii commented 7 years ago

I am trying this out for the first time. Here is what I did (after setting up all the IAM roles):

src/build.sh src/alex_02.hjson
python src/deploy.py --config-file src/alex_02.hjson --redeploy

I then go and create a table like so:

aws dynamodb create-table --region us-west-2 \
  --attribute-definitions AttributeName=MyHashKey,AttributeType=S \
  --key-schema AttributeName=MyHashKey,KeyType=HASH \
  --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1 \
  --table-name alex02_foobar5

After first the error was "bucket does not exist", so I created the bucket. Now that I manually created the bucket, I get this error:

Unable to import module 'index': No module named index

Any idea what could the problem? Maybe it's the way I'm building it? Does it matter which directory I build it from?

grayaii commented 7 years ago

OK. I figured it out. You have to cd in to src and do everything from there. The conf file cannot live outside of src, otherwise, the lambda function cannot find it. I'll create a PR to update the documentation.

satya-narayan87 commented 2 years ago

I believe , if this function has been created from cloud formation, then in handler you might have given index.lambda_handler so either change the lambda_function.py to index.py or change vice versa in cloudformation.