由于 dynamodb 表而无法部署 sst 应用程序
我是 aws 和 React 的新手。我昨天有一些代码正在运行(我可以将数据从 React 页面放入 dynamodb 表中)。今天我尝试创建一个新表(称为“事件”),但我没有让它工作。然后,我使用 git 命令“git reset --hard”回滚所有本地更改,并从 aws 管理系统中删除了表“Events”。现在,当我运行“npx sst start”时,我无法部署该应用程序。错误消息如下所示:
C:\Users\nickl\padel\notes>npx sst start
Using stage: admin
Preparing your SST app
=======================
Deploying debug stack
=======================
Deploying stacks
✅ admin-notes-debug-stack (no changes)
Stack admin-notes-debug-stack
Status: no changes
Outputs:
BucketArn: arn:aws:s3:::admin-notes-debug-stack-bucket83908e77-1tywtvoiarr1e
BucketName: admin-notes-debug-stack-bucket83908e77-1tywtvoiarr1e
Endpoint: wss://8pi9mbv1qb.execute-api.us-east-1.amazonaws.com/admin
===============
Deploying app
===============
Deploying stacks
Checking deploy status...
admin-notes-storage | UPDATE_IN_PROGRESS | AWS::CloudFormation::Stack | admin-notes-storage | User Initiated
admin-notes-storage | UPDATE_ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack | admin-notes-storage | Export admin-notes-storage:ExportsOutputRefEventsTable4B7491D3C6BE5608 cannot be deleted as it is in use by admin-notes-api
Checking deploy status...
admin-notes-storage | UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS | AWS::CloudFormation::Stack | admin-notes-storage
admin-notes-storage | UPDATE_ROLLBACK_COMPLETE | AWS::CloudFormation::Stack | admin-notes-storage
❌ admin-notes-storage failed: Export admin-notes-storage:ExportsOutputRefEventsTable4B7491D3C6BE5608 cannot be deleted as it is in use by admin-notes-api
Stack admin-notes-storage
Status: failed
Error: Export admin-notes-storage:ExportsOutputRefEventsTable4B7491D3C6BE5608 cannot be deleted as it is in use by admin-notes-api
Stack admin-notes-api
Status: not deployed
Stack admin-notes-auth
Status: not deployed
Stack admin-notes-frontend
Status: not deployed
Failed to deploy the app
如果您需要代码中的其他内容,请告诉我。
谢谢
I am new to aws and react. I had some code working yesterday (I could put data into a dynamodb table from a React page). Today I tried to create a new table (called Events), but I did not get it to work. I then rolled back all local changes using the git command 'git reset --hard' and deleted the table 'Events' from aws management system. Now I am unable to deploy the app when I run 'npx sst start'. The error message can be seen below:
C:\Users\nickl\padel\notes>npx sst start
Using stage: admin
Preparing your SST app
=======================
Deploying debug stack
=======================
Deploying stacks
✅ admin-notes-debug-stack (no changes)
Stack admin-notes-debug-stack
Status: no changes
Outputs:
BucketArn: arn:aws:s3:::admin-notes-debug-stack-bucket83908e77-1tywtvoiarr1e
BucketName: admin-notes-debug-stack-bucket83908e77-1tywtvoiarr1e
Endpoint: wss://8pi9mbv1qb.execute-api.us-east-1.amazonaws.com/admin
===============
Deploying app
===============
Deploying stacks
Checking deploy status...
admin-notes-storage | UPDATE_IN_PROGRESS | AWS::CloudFormation::Stack | admin-notes-storage | User Initiated
admin-notes-storage | UPDATE_ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack | admin-notes-storage | Export admin-notes-storage:ExportsOutputRefEventsTable4B7491D3C6BE5608 cannot be deleted as it is in use by admin-notes-api
Checking deploy status...
admin-notes-storage | UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS | AWS::CloudFormation::Stack | admin-notes-storage
admin-notes-storage | UPDATE_ROLLBACK_COMPLETE | AWS::CloudFormation::Stack | admin-notes-storage
❌ admin-notes-storage failed: Export admin-notes-storage:ExportsOutputRefEventsTable4B7491D3C6BE5608 cannot be deleted as it is in use by admin-notes-api
Stack admin-notes-storage
Status: failed
Error: Export admin-notes-storage:ExportsOutputRefEventsTable4B7491D3C6BE5608 cannot be deleted as it is in use by admin-notes-api
Stack admin-notes-api
Status: not deployed
Stack admin-notes-auth
Status: not deployed
Stack admin-notes-frontend
Status: not deployed
Failed to deploy the app
Let me know if you need anything else from the code.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决方案是从 aws 管理系统中删除所有堆栈,然后重新创建它们。
Solution was to delete all stacks from the aws management system, and then recreating them.
一个好的做法是首先检查您正在创建的资源是否已经存在于您的阶段中,尤其是在开发过程中。
请注意,如果创建资源时发生任何失败,您将面临堆栈创建失败。
例如,此代码在创建 s3 存储桶之前检查它是否存在:
希望这对您将来有所帮助!
A good practice will be to check first if the resources that you are creating already exist in your stage especially while developing.
Note that if any failing occurs while creating a resource, you will face failures in stacks creation.
For example, this code checks if the s3 bucket exists before creating it:
Hope this helps you in the future!