---
outputs:
    {% for _ in api_resources %}
    DeadLetterQueueArn{{loop.index}}:
        Description: Arn of dead letter queue
        Value:
          "Fn::GetAtt":
              - DeadLetterQueue{{loop.index}}
              - Arn

    LambdaArn{{loop.index}}:
        Description:
            The Arn of the backend Lambda function
        Value:
          "Fn::GetAtt":
              - Lambda{{loop.index}}
              - Arn
    {% endfor %}
    {% if not api_id %}
    RestApiRootResource:
        Description:
            The REST API root resource id
        Value:
          "Fn::GetAtt":
              - RestApi
              - RootResourceId
    RestApiId:
        Description:
            The REST API Id
        Value: {Ref: RestApi}
    {% endif %}
    RootResourceInvokeUrl:
        Description:
            The invoke URL for the root resource of the API
        Value:
            "Fn::Join":
                - ""
                - ["https://",
                  {% if api_id %}
                  {{api_id}}
                  {% else %}
                  {Ref: RestApi},
                  {% endif %}
                  ".execute-api.",
                  {Ref: "AWS::Region"},
                  ".amazonaws.com/",
                  "{{__context.stage.lower()}}"]

    ApiKey:
        Description:
            The key associated to the REST API {{__context.stage}} deployment
        Value: {Ref: ApiKey}
