2

Here is readme about serverless-plugin-nested-stacks plugin. It makes possible to include nested stacks into main one. But how to pass values between stacks? For example I create a resouce in one nested stack - how to path it arn to another stack (nested or main one)?

Cherry
  • 31,309
  • 66
  • 224
  • 364

1 Answers1

3

First you will need to export the resources from the corresponding nested stack like this:

AWSTemplateFormatVersion: '2010-09-09'
Parameters:
  ...
Resources:
  ...
Outputs:
  o1:
    Description: ...
    Value: <your_resource_arn>
    Export:
      Name: <your_export_name>

To import the resource in other stack, you will need to use the intrinsic function Fn::ImportValue, like this:

Fn::ImportValue: <your_export_name>

For more information check the AWS documentation

Kristijan Iliev
  • 4,901
  • 10
  • 28
  • 47