获取使用AWS CDK Amplify库的现有Amplify应用程序。

huangapple go评论56阅读模式
英文:

get an existing Amplify app with AWS CDK Amplify lib

问题

我想使用AWS CDK获取现有的Amplify应用程序,以便我可以为其添加自定义域名。
我在文档中看到可以创建整个Amplify应用程序并部署它,但无法获取已经部署的现有应用程序
我希望该库有一个类似于"getAppByName"之类的函数。
是否有一种方法可以实现这一点,最好使用CDK v2?

谢谢!

英文:

I would like to get hold of an existing Amplify app using the AWS CDK so I can add custom domains to it.
I see in the docs that it is possible to create a whole Amplify app and deploy it, but not getting an existing one that is already deployed.
I was hoping the lib to have a function like "getAppByName" or something.
Is there a way to achieve that, preferably using CDK v2?

Thanks!

答案1

得分: 1

The @aws-cdk/aws-amplify-alpha 模块的 App 构造具有 fromAppId 静态方法。它返回一个只读的 引用 到现有的 (外部) Amplify App。返回类型是 IApp,您可以在其他构造中使用它,但不能用于修改现有的 App。

注:这种只读模式适用于所有返回 ISomething 构造的 CDK fromSomethingId 类型方法。

英文:

The @aws-cdk/aws-amplify-alpha module's App construct has a fromAppId static method. It returns a read-only reference to an existing (external) Amplify App. The return type is IApp, which you can use in other constructs, but not use to modify your existing App.

N.B. This read-only pattern applies to all CDK fromSomethingId type methods that return an ISomething construct.

huangapple
  • 本文由 发表于 2023年4月20日 05:44:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76059029.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定