Incorporate existing AWS resources into a cloudformation stack

后端 未结 6 1804
余生分开走
余生分开走 2020-12-10 10:45

Is there a way to incorporate existing AWS resources that were created outside of cloudformation into an existing cloudformation stack? I\'d like to do this without having t

6条回答
  •  半阙折子戏
    2020-12-10 11:37

    Amazons CDK (currently in the stage of developer preview as of writing) offers a way to do that:

    If you need to reference a resource, such as an Amazon S3 bucket or VPC, that's defined outside of your CDK app, you can use the Xxxx.import(...) static methods that are available on AWS constructs. For example, you can use the Bucket.import() method to obtain a BucketRef object, which can be used in most places where a bucket is required. This pattern enables treating resources defined outside of your app as if they are part of your app.

    Source: https://docs.aws.amazon.com/CDK/latest/userguide/aws_construct_lib.html

    It also allows to import existing CloudFormation templates: https://docs.aws.amazon.com/CDK/latest/userguide/use_cfn_template.html

提交回复
热议问题