Можно ли создать ресурс типа AWS :: Serverless :: Application и получить доступ к его атрибутам Outputs из шаблона в Localstack? - PullRequest
0 голосов
/ 23 февраля 2020

У меня есть serverless.yml со следующим содержимым. Я использую LocalStack для эмуляции aws stack

service: blah
provider:
  name: aws
  runtime: nodejs12.x
plugins:
  - serverless-localstack
custom:
  localstack:
    stages:
      # list of stages for which the plugin should be enabled
      - local
    host: http://localhost  # optional - LocalStack host to connect to
    autostart: true  # optional - start LocalStack in Docker on Serverless deploy
    endpoints:
      # This section is optional - can be used for customizing the target endpoints
      S3: http://localhost:4572
      DynamoDB: http://localhost:4570
      CloudFormation: http://localhost:4581
      Elasticsearch: http://localhost:4571
      ES: http://localhost:4578
      SNS: http://localhost:4575
      SQS: http://localhost:4576
      Lambda: http://localhost:4574
      Kinesis: http://localhost:4568
    lambda:
      # Enable this flag to improve performance
      mountCode: false
    docker:
      # Enable this flag to run "docker ..." commands as sudo
      sudo: false   
resources:
  Resources:
    MyLambdaEdgeProtectedSpaSetup:
      Type: AWS::Serverless::Application
      Properties:
        Location: "template.yaml"
          # ApplicationId: uri of the application id on aws app repository
          # SemanticVersion: blah blah
    AlanTuring:
      Type: AWS::Cognito::UserPoolUser
      Properties:
        Username: alan.turing@example.com
        UserPoolId: !GetAtt MyLambdaEdgeProtectedSpaSetup.Outputs.UserPoolId
    EdsgerDijkstra:
      Type: AWS::Cognito::UserPoolUser
      Properties:
        Username: edgser.dijkstra@example.com
        UserPoolId: !GetAtt MyLambdaEdgeProtectedSpaSetup.Outputs.UserPoolId

  Outputs:
    MySpaS3Bucket:
      Description: The S3 Bucket into which my SPA will be uploaded
      Value: !GetAtt MyLambdaEdgeProtectedSpaSetup.Outputs.S3Bucket

Здесь в журналах localstack отображается ошибка при доступе к атрибутам MyLambdaEdgeProtectedSpaSetup.Outputs.UserPoolId. Может ли localstack создать приложение из template.yaml, описывающего приложение на языке формирования SAM?

...