Skip to content

E1010 false positive: GetAtt <app>.Outputs.* on AWS::Serverless::Application rejected since 1.54.0 (only StackId allowed) #4659

Description

@jpinsolle-bc

CloudFormation Lint Version

1.55.1

What operating system are you using?

macOS 26.6, Ubuntu

Describe the bug

#Problem
!GetAtt <SomeApplication>.Outputs.<OutputName> on an AWS::Serverless::Application resource is reported as invalid:

E1010 'Outputs.TopicName' is not one of ['StackId'] in ['us-east-1']
template.yaml:12:7

This is the documented way to consume a nested application's outputs, and it works at deploy time: SAM transforms AWS::Serverless::Application into AWS::CloudFormation::Stack, whose outputs are reachable via Outputs.<name>.

Bisection points at the removal of the SAM translator in #4491:

version result
1.53.3 clean
1.54.0 E1010
1.55.1 E1010

Root cause, as far as I can tell: GetAtts.__init__ in cfnlint/schema/_getatts.py grants the Outputs\..* wildcard to exactly two type names — AWS::CloudFormation::Stack and AWS::ServiceCatalog::CloudFormationProvisionedProduct:

if schema.type_name == "AWS::CloudFormation::Stack":
    self._attrs["Outputs\\..*"] = "/properties/CfnLintStringType"
    return

if schema.type_name == "AWS::ServiceCatalog::CloudFormationProvisionedProduct":
    ...

Before #4491 the translator rewrote the resource to AWS::CloudFormation::Stack, so the first branch applied. Now the resource keeps its SAM type, and the SAM schema for it declares a single GetAtt-able attribute:

typeName: AWS::Serverless::Application
readOnlyProperties: ['/properties/StackId']

so _attrs ends up as ['StackId'] and any Outputs.* lookup fails.

Expected behavior

No E1010.
Outputs.<anything> should be accepted on AWS::Serverless::Application, as it is on AWS::CloudFormation::Stack.

Reproduction template

AWSTemplateFormatVersion: "2010-09-09"
Transform: "AWS::Serverless-2016-10-31"
Resources:
  ChildApplication:
    Type: AWS::Serverless::Application
    Properties:
      Location: ./child.yaml

  TopicPolicy:
    Type: AWS::SNS::TopicPolicy
    Properties:
      Topics:
        - !GetAtt ChildApplication.Outputs.TopicArn
      PolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: Allow
            Principal:
              Service: events.amazonaws.com
            Action: "sns:Publish"
            Resource: "*"

child.yaml — declares the output referenced above:

AWSTemplateFormatVersion: "2010-09-09"
Resources:
  Topic:
    Type: AWS::SNS::Topic
Outputs:
  TopicArn:
    Value: !Ref Topic

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions