有没有办法使用 cloudformation 修改 AWS 现有资源?

Is there a way to modify AWS existing resource using cloudformation?

我正在尝试修改现有 AWS IAM 角色中的信任关系。 有没有办法使用 cloudformation 来做到这一点?

你必须先 import it to CFN and then you will be able to modify it. Alternatively, you can develop a custom resource 这样你就可以做任何你想做的事(毕竟这是习惯)。

添加到@Marcin 的回复中,将资源导入 CFN 后,请使用以下文档执行 CFN Stack Updates, specifically it is considered best practice (1) to update using CFN Change Sets 方法

(1) - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/best-practices.html#cfn-best-practices-changesets