AWS::Serverless::Application - Amazon Serverless Application Model
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::Serverless::Application

Embeds a serverless application from the Amazon Serverless Application Repository or from an Amazon S3 bucket as a nested application. Nested applications are deployed as nested AWS::CloudFormation::Stack resources, which can contain multiple other resources including other AWS::Serverless::Application resources.

Note

When you deploy to Amazon CloudFormation, Amazon SAM transforms your Amazon SAM resources into Amazon CloudFormation resources. For more information, see Generated Amazon CloudFormation resources.

Syntax

To declare this entity in your Amazon Serverless Application Model (Amazon SAM) template, use the following syntax.

YAML

Type: AWS::Serverless::Application Properties: Location: String | ApplicationLocationObject NotificationARNs: List Parameters: Map Tags: Map TimeoutInMinutes: Integer

Properties

Location

Template URL, file path, or location object of a nested application.

If a template URL is provided, it must follow the format specified in the CloudFormation TemplateUrl documentation and contain a valid CloudFormation or SAM template. An ApplicationLocationObject can be used to specify an application that has been published to the Amazon Serverless Application Repository.

If a local file path is provided, the template must go through the workflow that includes the sam deploy or sam package command, in order for the application to be transformed properly.

Type: String | ApplicationLocationObject

Required: Yes

Amazon CloudFormation compatibility: This property is similar to the TemplateURL property of an AWS::CloudFormation::Stack resource. The CloudFormation version does not take an ApplicationLocationObject to retrieve an application from the Amazon Serverless Application Repository.

NotificationARNs

A list of existing Amazon SNS topics where notifications about stack events are sent.

Type: List

Required: No

Amazon CloudFormation compatibility: This property is passed directly to the NotificationARNs property of an AWS::CloudFormation::Stack resource.

Parameters

Application parameter values.

Type: Map

Required: No

Amazon CloudFormation compatibility: This property is passed directly to the Parameters property of an AWS::CloudFormation::Stack resource.

Tags

A map (string to string) that specifies the tags to be added to this application. Keys and values are limited to alphanumeric characters. Keys can be 1 to 127 Unicode characters in length and cannot be prefixed with aws:. Values can be 1 to 255 Unicode characters in length.

Type: Map

Required: No

Amazon CloudFormation compatibility: This property is similar to the Tags property of an AWS::CloudFormation::Stack resource. The Tags property in SAM consists of Key:Value pairs; in CloudFormation it consists of a list of Tag objects. When the stack is created, SAM will automatically add a lambda:createdBy:SAM tag to this application. In addition, if this application is from the Amazon Serverless Application Repository, then SAM will also automatically the two additional tags serverlessrepo:applicationId:ApplicationId and serverlessrepo:semanticVersion:SemanticVersion.

TimeoutInMinutes

The length of time, in minutes, that Amazon CloudFormation waits for the nested stack to reach the CREATE_COMPLETE state. The default is no timeout. When Amazon CloudFormation detects that the nested stack has reached the CREATE_COMPLETE state, it marks the nested stack resource as CREATE_COMPLETE in the parent stack and resumes creating the parent stack. If the timeout period expires before the nested stack reaches CREATE_COMPLETE, Amazon CloudFormation marks the nested stack as failed and rolls back both the nested stack and parent stack.

Type: Integer

Required: No

Amazon CloudFormation compatibility: This property is passed directly to the TimeoutInMinutes property of an AWS::CloudFormation::Stack resource.

Return Values

Ref

When the logical ID of this resource is provided to the Ref intrinsic function, it returns the resource name of the underlying AWS::CloudFormation::Stack resource.

For more information about using the Ref function, see Ref in the Amazon CloudFormation User Guide.

Fn::GetAtt

Fn::GetAtt returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using Fn::GetAtt, see Fn::GetAtt in the Amazon CloudFormation User Guide.

Outputs.ApplicationOutputName

The value of the stack output with name ApplicationOutputName.

Examples

SAR Application

Application that uses a template from the Serverless Application Repository

YAML

Type: AWS::Serverless::Application Properties: Location: ApplicationId: 'arn:aws:serverlessrepo:us-east-1:012345678901:applications/my-application' SemanticVersion: 1.0.0 Parameters: StringParameter: parameter-value IntegerParameter: 2

Normal-Application

Application from an S3 url

YAML

Type: AWS::Serverless::Application Properties: Location: https://s3.amazonaws.com/demo-bucket/template.yaml