AWS::Serverless::Application
Embeds a serverless application from the AWS Serverless Application Repository
Syntax
To declare this entity in your AWS Serverless Application Model (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
orsam 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 anAWS::CloudFormation::Stack
resource. 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 anAWS::CloudFormation::Stack
resource. -
Parameters
-
Application parameter values.
Type: Map
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
Parameters
property of anAWS::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
AWS CloudFormation compatibility: This property is similar to the
Tags
property of anAWS::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 alambda: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 tagsserverlessrepo:applicationId:
andApplicationId
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 theCREATE_COMPLETE
state, it marks the nested stack resource asCREATE_COMPLETE
in the parent stack and resumes creating the parent stack. If the timeout period expires before the nested stack reachesCREATE_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 anAWS::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 AWS 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 AWS CloudFormation User Guide.
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