aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.52k stars 1.17k forks source link

Deploying nested application gives false error message #2689

Closed lvlattanzio closed 3 years ago

lvlattanzio commented 3 years ago

Description:

Prior to updating my aws-sam-cli to version 1.20.0 I had a stack with several nested stacks from the local filesystem. This was done primarily to break up my template into more manageable chunks. Now that I upgraded to v1.20.0 I am receiving the following error upon running sam deploy: Nested application 'Application' has specified S3 location for Location which is unsupported. Skipping resources inside this nested application.

Steps to reproduce:

  1. sam init
    
    Which template source would you like to use?
        1 - AWS Quick Start Templates
        2 - Custom Template Location
    Choice: 1
    What package type would you like to use?
        1 - Zip (artifact is a zip uploaded to S3)
        2 - Image (artifact is an image uploaded to an ECR image repository)
    Package type: 1

Which runtime would you like to use? 1 - nodejs14.x 2 - python3.8 3 - ruby2.7 4 - go1.x 5 - java11 6 - dotnetcore3.1 7 - nodejs12.x 8 - nodejs10.x 9 - python3.7 10 - python3.6 11 - python2.7 12 - ruby2.5 13 - java8.al2 14 - java8 15 - dotnetcore2.1 Runtime: 7

Project name [sam-app]:

Cloning app templates from https://github.com/aws/aws-sam-cli-app-templates

AWS quick start application templates: 1 - Hello World Example 2 - Step Functions Sample App (Stock Trader) 3 - Quick Start: From Scratch 4 - Quick Start: Scheduled Events 5 - Quick Start: S3 6 - Quick Start: SNS 7 - Quick Start: SQS 8 - Quick Start: Web Backend Template selection: 1

-----------------------
Generating application:
-----------------------
Name: sam-app
Runtime: nodejs12.x
Dependency Manager: npm
Application Template: hello-world
Output Directory: .

Next steps can be found in the README file at ./sam-app/README.md
2. clone template.yaml (e.g., template.1.yaml) and point to it in template.yaml:

AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > sam-app

Sample SAM Template for sam-app

Resources: Application: Type: AWS::Serverless::Application Properties: Location: ./template.1.yaml

3. ```sam build && sam deploy --debug```

### Observed result:

Initiating deployment

2021-03-05 19:22:22,385 | No Parameters detected in the template 2021-03-05 19:22:22,433 | 1 stacks found in the template 2021-03-05 19:22:22,434 | Nested application 'Application' has specified S3 location for Location which is unsupported. Skipping resources inside this nested application. 2021-03-05 19:22:22,434 | No Parameters detected in the template 2021-03-05 19:22:22,461 | 1 resources found in the stack 2021-03-05 19:22:22,461 | No Parameters detected in the template 2021-03-05 19:22:22,680 | File with same data is already exists at sam-app/18d8616c5d6c8d1b9a943f9a23304210.template. Skipping upload

Waiting for changeset to be created..


### Expected result:
I expect to be able to reference local templates for nested stacks as I was able to before upgrading my CLI version.  It appears that the resources in the nested stack were created, so this error message might just be noise.

### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

1. OS:

NAME="Amazon Linux AMI" VERSION="2018.03" ID="amzn" ID_LIKE="rhel fedora" VERSION_ID="2018.03" PRETTY_NAME="Amazon Linux AMI 2018.03" ANSI_COLOR="0;33" CPE_NAME="cpe:/o:amazon:linux:2018.03:ga" HOME_URL="http://aws.amazon.com/amazon-linux-ami/"


2. `sam --version`: 1.20.0
3. AWS region: us-east-1

`Add --debug flag to command you are running`
aahung commented 3 years ago

Thanks for reporting, yes, as build/deploy works as expected, this message is only meant to be output during building. A fix is coming soon to avoid confusion.

brysontyrrell commented 3 years ago

Just came across this too running sam deploy and found it very confusing.

mndeveci commented 3 years ago

The fix for the issue have been released with SAM CLI v1.21.0, resolving.

github-actions[bot] commented 3 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.