Aws lambda 如何获取引用“a”的堆栈;堆栈输出“;参数是否位于“serverless.yml”中?

Aws lambda 如何获取引用“a”的堆栈;堆栈输出“;参数是否位于“serverless.yml”中?,aws-lambda,serverless-framework,aws-serverless,Aws Lambda,Serverless Framework,Aws Serverless,如何获取引用serverless.yml中“堆栈输出”的堆栈 例如: 堆栈A输出资源A 堆栈B引用资源A 我知道如果我试图从堆栈A中排除资源A,我将收到一条错误消息,说堆栈B使用资源A 因此,应该有一种方法来列出他们(推荐人) 执行时: $serverless info--stage prod--verbose 返回堆栈输出。。但我想知道我是否也能得到推荐人 谢谢 根据,您可以将输出部分作为列表项放在参考资料下: resources: - Resources: ApiGat

如何获取引用
serverless.yml
中“堆栈输出”的堆栈

例如:

  • 堆栈A输出资源A
  • 堆栈B引用资源A
我知道如果我试图从堆栈A中排除资源A,我将收到一条错误消息,说堆栈B使用资源A

因此,应该有一种方法来列出他们(推荐人)

执行时:

$serverless info--stage prod--verbose
返回堆栈输出。。但我想知道我是否也能得到推荐人

谢谢

根据,您可以将输出部分作为列表项放在参考资料下:

resources:
  - Resources:
      ApiGatewayRestApi:
        Type: AWS::ApiGateway::RestApi

  - ${file(resources/first-cf-resources.yml)}
  - ${file(resources/second-cf-resources.yml)}

  - Outputs:
      CognitoUserPoolId:
        Value:
          Ref: CognitoUserPool
注意:文档中有一个小错误,请不要忘记在CognitoUserPoolId下缩进“Value”

更新:

这可能是另一个选项,每个部分都在一个单独的文件中。确保资源文件以资源开头,输出文件以输出开头

serverless.yml

...

resources:
  - ${file(resources.yml)}
  - ${file(outputs.yml)}
Resources:
  CognitoUserPool:
    Type: AWS::Cognito::UserPool
    Properties:
      UserPoolName: my-user-pool
      AutoVerifiedAttributes:
        - phone_number
Outputs:
  CognitoUserPoolId:
    Value:
      Ref: CognitoUserPool
resources.yml

...

resources:
  - ${file(resources.yml)}
  - ${file(outputs.yml)}
Resources:
  CognitoUserPool:
    Type: AWS::Cognito::UserPool
    Properties:
      UserPoolName: my-user-pool
      AutoVerifiedAttributes:
        - phone_number
Outputs:
  CognitoUserPoolId:
    Value:
      Ref: CognitoUserPool
输出.yml

...

resources:
  - ${file(resources.yml)}
  - ${file(outputs.yml)}
Resources:
  CognitoUserPool:
    Type: AWS::Cognito::UserPool
    Properties:
      UserPoolName: my-user-pool
      AutoVerifiedAttributes:
        - phone_number
Outputs:
  CognitoUserPoolId:
    Value:
      Ref: CognitoUserPool
根据,您可以将输出部分作为列表项放在参考资料下:

resources:
  - Resources:
      ApiGatewayRestApi:
        Type: AWS::ApiGateway::RestApi

  - ${file(resources/first-cf-resources.yml)}
  - ${file(resources/second-cf-resources.yml)}

  - Outputs:
      CognitoUserPoolId:
        Value:
          Ref: CognitoUserPool
注意:文档中有一个小错误,请不要忘记在CognitoUserPoolId下缩进“Value”

更新:

这可能是另一个选项,每个部分都在一个单独的文件中。确保资源文件以资源开头,输出文件以输出开头

serverless.yml

...

resources:
  - ${file(resources.yml)}
  - ${file(outputs.yml)}
Resources:
  CognitoUserPool:
    Type: AWS::Cognito::UserPool
    Properties:
      UserPoolName: my-user-pool
      AutoVerifiedAttributes:
        - phone_number
Outputs:
  CognitoUserPoolId:
    Value:
      Ref: CognitoUserPool
resources.yml

...

resources:
  - ${file(resources.yml)}
  - ${file(outputs.yml)}
Resources:
  CognitoUserPool:
    Type: AWS::Cognito::UserPool
    Properties:
      UserPoolName: my-user-pool
      AutoVerifiedAttributes:
        - phone_number
Outputs:
  CognitoUserPoolId:
    Value:
      Ref: CognitoUserPool
输出.yml

...

resources:
  - ${file(resources.yml)}
  - ${file(outputs.yml)}
Resources:
  CognitoUserPool:
    Type: AWS::Cognito::UserPool
    Properties:
      UserPoolName: my-user-pool
      AutoVerifiedAttributes:
        - phone_number
Outputs:
  CognitoUserPoolId:
    Value:
      Ref: CognitoUserPool

因此,我的问题是:我如何知道谁在引用
CognitoUserPoolId
?我不知道“谁”是什么意思,但CognitoUserPoolId逻辑资源名称在first-cf-resources.yml或second-cf-resources.yml中指定。这显然是一个示例,可能是在这些模板中指定的另一个资源。因此,我的问题是:如何知道谁引用了
CognitoUserPoolId
?我不知道“谁”是什么意思,但CognitoUserPoolId逻辑资源名称是在first-cf-resources.yml或second-cf-resources.yml中指定的。这显然是一个示例,可能是在这些模板中指定的另一个资源。