AWS::Serverless::Application - AWS Serverless Application Model

AWS::Serverless::Application

Embeds a serverless application from the AWS 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.

Syntax

To declare this entity in your AWS 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 AWS 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

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

NotificationARNs

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

Type: List

Required: No

AWS CloudFormation Compatibility: This property is passed directly to the NotificationARNs property of an AWS::CloudFormation::Stack.

Parameters

Application parameter values.

Type: Map

Required: No

AWS CloudFormation Compatibility: This property is passed directly to the Parameters property of an AWS::CloudFormation::Stack.

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

AWS CloudFormation Compatibility: This property is similar to the Tags property of an AWS::CloudFormation::Stack. 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 AWS 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 AWS CloudFormation waits for the nested stack to reach the CREATE_COMPLETE state. The default is no timeout. When AWS 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, AWS CloudFormation marks the nested stack as failed and rolls back both the nested stack and parent stack.

Type: Integer

Required: No

AWS CloudFormation Compatibility: This property is passed directly to the TimeoutInMinutes property of an AWS::CloudFormation::Stack.

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.

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.

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