Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to manually set up the DDB #7

Open
johnemcbride opened this issue Jun 11, 2024 · 1 comment
Open

How to manually set up the DDB #7

johnemcbride opened this issue Jun 11, 2024 · 1 comment

Comments

@johnemcbride
Copy link

HI!

I am trying to use the sin the context of a Django app I am running inside lambda and the whole infra is configured through CDK.

As such I am trying to replicate your DDB Table Structure outside of the manage app...

I have set up as follows:

const sessionsTable = new dynamodb.Table(this, "sessions", {
  partitionKey: {
    name: "pk",
    type: dynamodb.AttributeType.STRING,
  },
});

However, I get

An error occurred (ValidationException) when calling the GetItem operation: The provided key element does not match the schema.

My settings:

DYSESSION = {
"DYNAMODB_TABLENAME": os.environ['DYNAMODB_SESSIONS_TABLE_NAME'],
"TTL_ATTRIBUTE_NAME": "ttl",
"CACHE_PERIOD": 3600,
"DYNAMODB_REGION": "eu-west-2",
"LOGGING": {
"TYPE": "CONSOLE",
},
}

What am I missing?

@johnemcbride
Copy link
Author

The internal error I get is
AttributeError: 'SessionStore' object has no attribute '_session_cache'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant