tmp dev
tmp dev

Reputation: 9193

AWS Cloudformation dynamodb tablename has characters at the end

I'm creating a Dynamodb table though serverless SAM and this is what I have

  MyTable:
    Type: AWS::DynamoDB::Table
    Properties: 
      AttributeDefinitions: 
        - AttributeName: Id
          AttributeType: S        
      KeySchema: 
        - AttributeName: Id
          KeyType: HASH   
      ProvisionedThroughput: 
        ReadCapacityUnits: 5
        WriteCapacityUnits: 5             
      StreamSpecification:
        StreamViewType: KEYS_ONLY

The problem is that when the table is created it has a random set of characters at the end, so for example my table after being created in DynamoDB will look like this

stackname-Stores-10H9IHDFESTE0

Why are these random characters added at the end and how do I get rid of them? Plus my code needs to read from this table and everytime I deploy something if these characters are added to the end, how do I solve this? The same is true for the lambda function being deployed as well, it adds this weird characters at the end for eample my Lambda function once deployed looks like this

stakcname-StoresFunction-1D1J4W48RVDUR

Upvotes: 1

Views: 700

Answers (1)

smcstewart
smcstewart

Reputation: 2085

I think you're missing the name of the table and the name of the Lambda function in your SAM - under the Properties key in the respective resources:

TableName: String

FunctionName : String

Upvotes: 1

Related Questions