简体   繁体   English

如何在另一个堆栈参数中导入 cloudformation 堆栈 output?

[英]How to import cloudformation stack output inside another stack parameter?

We are trying to import the output value of the base stack into the new stack parameter rather than the resource itself.我们正在尝试将基本堆栈的 output 值导入新的堆栈参数而不是资源本身。 Please help us to achieve that.请帮助我们实现这一目标。

BASE STACK - Below is the output defined in the base stack BASE STACK - 下面是在 base stack 中定义的 output

Outputs:
    Asset:
        Value:
            Ref: Asset
        Export:
            Name:
                'Fn::Sub': '${AWS::StackName}-Asset'

We would like to import this value into the new stack but the CFN is throwing an error that Every Default member must be a string .我们想将此值导入新堆栈,但 CFN 抛出 Every Default member must be a string的错误。

NEW STACK新堆栈

Parameters:
    BaseStackNameParameter:
        Type: String
        Default: assetstack
        
    AssetVal:
        Type: String
        Default: !ImportValue
                  'Fn::Sub': '${BaseStackNameParameter}-Asset'

The error is correct.错误是正确的。 You can't do this .不能这样做 Such functionality is not supported by CloudFormation. CloudFormation 不支持此类功能。

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

相关问题 如何通过 CloudFormation 将堆栈导出的现有 S3 存储桶导入另一个堆栈 YAML - How to import an existing S3 bucket exported by a stack, into another stack via CloudFormation YAML Cloudformation如何将现有资源导入Stack? - Cloudformation how to import existing resources into Stack? AWS CloudFormation:如何在 AWS::IAM::Policy 中引用另一个堆栈中定义的角色 - AWS CloudFormation: How to refer a role defined in another stack inside AWS::IAM::Policy 访问由代码管道执行的 Cloudformation 堆栈 output - Access to Cloudformation stack output executed by code pipeline CloudFormation 将变量从一个堆栈传递到另一个堆栈 - CloudFormation passing variables from one stack to another 如何在 cloudformation 堆栈中为 lambda 配置 asynconfig? - how to configure asynconfig for lambda in cloudformation stack? CDK:如何使用/导入一个堆栈中定义的 s3 到另一个堆栈(在不同的文件中)? - CDK: How to use/import s3 defined in one stack to another stack (in a different file)? 使用 SAM 或 Cloudformation 将一个堆栈的输出用作其他堆栈中 lambda 的环境变量 - Use output of one stack as environment variable for lambda in other stack with SAM or Cloudformation 无法创建 AWS CloudFormation 堆栈 - Unable to create AWS CloudFormation stack 一个空的 Cloudformation Stack 会花钱吗? - Will an empty Cloudformation Stack cost money?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM