AWS::OpsWorks::App
Creates an app for a specified stack. For more information, see Creating Apps.
Required Permissions: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.
Syntax
To declare this entity in your Amazon CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::OpsWorks::App", "Properties" : { "AppSource" :Source, "Attributes" :{, "DataSources" :Key:Value, ...}[ DataSource, ... ], "Description" :String, "Domains" :[ String, ... ], "EnableSsl" :Boolean, "Environment" :[ EnvironmentVariable, ... ], "Name" :String, "Shortname" :String, "SslConfiguration" :SslConfiguration, "StackId" :String, "Type" :String} }
YAML
Type: AWS::OpsWorks::App Properties: AppSource:SourceAttributes:DataSources:Key:Value- DataSourceDescription:StringDomains:- StringEnableSsl:BooleanEnvironment:- EnvironmentVariableName:StringShortname:StringSslConfiguration:SslConfigurationStackId:StringType:String
Properties
AppSource-
A
Sourceobject that specifies the app repository.Required: No
Type: Source
Update requires: No interruption
Attributes-
One or more user-defined key/value pairs to be added to the stack attributes.
Required: No
Type: Map of String
Update requires: No interruption
DataSources-
The app's data source.
Required: No
Type: List of DataSource
Update requires: No interruption
Description-
A description of the app.
Required: No
Type: String
Update requires: No interruption
Domains-
The app virtual host settings, with multiple domains separated by commas. For example:
'www.example.com, example.com'Required: No
Type: List of String
Update requires: No interruption
EnableSsl-
Whether to enable SSL for the app.
Required: No
Type: Boolean
Update requires: No interruption
Environment-
An array of
EnvironmentVariableobjects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instance. For more information, see Environment Variables.There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 20KB)."
Note
If you have specified one or more environment variables, you cannot modify the stack's Chef version.
Required: No
Type: List of EnvironmentVariable
Update requires: No interruption
Name-
The app name.
Required: Yes
Type: String
Update requires: No interruption
Shortname-
The app's short name.
Required: No
Type: String
Update requires: Replacement
SslConfiguration-
An
SslConfigurationobject with the SSL configuration.Required: No
Type: SslConfiguration
Update requires: No interruption
StackId-
The stack ID.
Required: Yes
Type: String
Update requires: Replacement
Type-
The app type. Each supported type is associated with a particular layer. For example, PHP applications are associated with a PHP layer. Amazon OpsWorks Stacks deploys an application to those instances that are members of the corresponding layer. If your app isn't one of the standard types, or you prefer to implement your own Deploy recipes, specify
other.Required: Yes
Type: String
Allowed values:
aws-flow-ruby | java | nodejs | other | php | rails | staticUpdate requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Reffunction, Refreturns the resource name. For example:
{ "Ref": "myApp" }
For the Amazon OpsWorks stack myApp, Ref returns the ID of the
Amazon OpsWorks app.
For more information about using the Reffunction, see Ref.
Examples
Template Snippet
The following snippet creates an Amazon OpsWorks app that uses a PHP application in a Git repository:
JSON
"myApp" : { "Type" : "AWS::OpsWorks::App", "Properties" : { "StackId" : {"Ref":"myStack"}, "Type" : "php", "Name" : "myPHPapp", "AppSource" : { "Type" : "git", "Url" : "git://github.com/amazonwebservices/opsworks-demo-php-simple-app.git", "Revision" : "version1" } } }
YAML
myApp: Type: "AWS::OpsWorks::App" Properties: StackId: Ref: "myStack" Type: "php" Name: "myPHPapp" AppSource: Type: "git" Url: "git://github.com/amazonwebservices/opsworks-demo-php-simple-app.git" Revision: "version1"
See also
-
CreateApp in the Amazon OpsWorks API Reference.
-
Adding Apps in the Amazon OpsWorks User Guide.