简体   繁体   English

手动更改资源时如何修复 cloudformation 更新

[英]How can I fix cloudformation update when resource was changed manually

My cloudformation stack has a secret resource deployed to secret manager.我的 cloudformation 堆栈有一个秘密资源部署到秘密管理器。 But this secret was removed and recreate with the same name manually which happened outside cf stack update.但是这个秘密被删除并用相同的名称手动重新创建,这发生在 cf 堆栈更新之外。

Now when I update this stack, I got an error: Secrets Manager can't find the specified secret .现在,当我更新此堆栈时,出现错误: Secrets Manager can't find the specified secret The reason is that even the secret was recreated with the same name, the arn of this secret was changed which makes the logic ID in stack is different.原因是即使秘密是用相同的名字重新创建的,这个秘密的 arn 也被改变了,这使得堆栈中的逻辑 ID 不同。

I have tried to drift the stack but the secret is not showing in the result.我试图漂移堆栈,但结果中没有显示秘密。

So in this case, how can I make the stack in sync with existing resources?那么在这种情况下,如何让堆栈与现有资源同步呢?

Can you redeploy just the secret resource from your code?你能从你的代码中重新部署秘密资源吗? If yes, remove the manually created secret resource from the console, remove secret resource from code, deploy code.如果是,从控制台删除手动创建的秘密资源,从代码中删除秘密资源,部署代码。 Add resource to code, deploy code again.将资源添加到代码,再次部署代码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何检查资源是否由 CloudFormation 创建? - How can I check if a resource was created by CloudFormation? 我如何使用 cloudformation 创建和更新 WAF IPset - how can i create and update WAF IPset using cloudformation 如何在 cloudformation 中引用 ImportValue 中的变量? - How can I ref a variable in ImportValue in cloudformation? 如何在不重新创建 EC2 实例的情况下通过 Cloudformation 更新安全组 - How I can update security group through Cloudformation without recreating EC2 Instance 如何在 CfnInclude 期间将(可选)参数直接从 CloudFormation 模板传递到 CDK 资源而不对参数列表进行硬编码? - How can I pass (optional) parameters directly from CloudFormation template to CDK resource during CfnInclude without hardcoding the parameter list? 如何将“手动创建”的资源添加到 cloudformation 模板 - how to add "manually created" resources to the cloudformation template 无服务器错误,当自定义命名的资源需要替换时,CloudFormation 无法更新堆栈 - Serverless Error, CloudFormation cannot update a stack when a custom-named resource requires replacing 如何使用 CloudFormation 为 CloudWatch Logs 定义资源策略? - How to define Resource Policy for CloudWatch Logs with CloudFormation? 如何在 CloudFormation 中包含/引用多个资源文件? - How to Include/Reference Multiple Resource files in CloudFormation? 如何仅在资源存在时使用 Fn::GetAttr? - How can I use Fn::GetAttr only when the resource exist?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM