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

Cant update the logical ID of DynamoDB table #1677

Closed
codepreneur opened this issue Jul 26, 2016 · 6 comments
Closed

Cant update the logical ID of DynamoDB table #1677

codepreneur opened this issue Jul 26, 2016 · 6 comments
Assignees
Labels
Milestone

Comments

@codepreneur
Copy link
Member

codepreneur commented Jul 26, 2016

Serverless Framework Version:
1.0.0-alpha.2
Operating System:

image

Expected Behavior:

Logical ID is changed inside cloud formation.

image

I have successfully deployed with logical ID (at the top) of PostsDynamo, but then I changed PostsDynamo -> LinksDynamo, saved and redeployed and everything fell apart.

Actual Behavior:

image

17:09:37 UTC+0100   CREATE_FAILED   AWS::DynamoDB::Table    LinksDynamo egamitv-links-dev already exists in stack arn:aws:cloudformation:us-west-2:12345678:stack/egamitv-dev/a43c123-4e7e-11e6-8a16-43a34a0e3228e
17:09:37 UTC+0100   CREATE_IN_PROGRESS  AWS::DynamoDB::Table    LinksDynamo 

so the only way really to change the logical ID of a DynamoDB table is to delete it and create it again

@codepreneur codepreneur changed the title Cant change the logical ID of DynamoDB table Cant update the logical ID of DynamoDB table Jul 26, 2016
@codepreneur
Copy link
Member Author

@pmuens @eahefnawy I think this issue is related/similar to #1684

@eahefnawy eahefnawy added the bug label Aug 1, 2016
@eahefnawy eahefnawy modified the milestones: v1.0.0-beta.1, v1.0.0-beta.2 Aug 1, 2016
@eahefnawy eahefnawy self-assigned this Aug 2, 2016
@eahefnawy
Copy link
Member

@codepreneur might be. Although #1684 is more related to APIG resources, while this issue seems like a traditional CF template issue. Any particular reason you think this might be related?

I think this issue is more of a CloudFormation usage issue, because we simply take the resources you defined and merge them with the template without any manipulation. Maybe it's because of the DeletionPolicy you have?

@svdgraaf
Copy link
Contributor

svdgraaf commented Aug 5, 2016

@codepreneur I can confirm that this is a CF issue.

On the first deploy, you created a DynamoDB table (with a resource name of PostsDynamo, and the table name egamitv-links-dev. Now on this second go, you changed the resource name. CF thinks you want to create another dynamotable, tries to create it, but fails, because a Dynamo table with that name already exists (your previous one).

CF will only start to cleanup old resources -after- a successful deployment of a stack.

In this case, you have 2 options:

  • Remove your custom resources (comment it out). Deploy, add the resource again, and deploy.
  • Change the name of your table from ${service}-links-${stage} to ${service}-posts-${stage} (and keep the new resource name), and deploy.

In both cases, you will lose the current table with it's data, so be aware of that.

@eahefnawy
Copy link
Member

eahefnawy commented Aug 10, 2016

@svdgraaf fantastic analysis! 👏

@flomotlik
Copy link
Contributor

@codepreneur is this also resolved with your finding or what @svdgraaf mentioned? As we're getting closer to beta release I'm currently going through open issues and closing them. I'm closing for now, in case this is still an issue let me know and we'll reopen

@codepreneur
Copy link
Member Author

@flomotlik yeap, its a CF issue not serverless.

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

No branches or pull requests

4 participants