AWS::OpsWorks::App
Syntax
To declare this entity in your AWS 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:
Source
Attributes:DataSources:
Key
:Value
- DataSource
Description:String
Domains:- String
EnableSsl:Boolean
Environment:- EnvironmentVariable
Name:String
Shortname:String
SslConfiguration:SslConfiguration
StackId:String
Type:String
Properties
AppSource
-
A
Source
object 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: Object of String
Pattern:
[a-zA-Z0-9]+
Update requires: No interruption
DataSources
-
The app's data source.
Required: No
Type: Array 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: Array 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
EnvironmentVariable
objects 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: Array 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
SslConfiguration
object 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. AWS 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 | rails | php | nodejs | static | other
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref
returns the resource name. For example:
{ "Ref": "myApp" }
For the AWS OpsWorks stack myApp
, Ref
returns the ID of the
AWS OpsWorks app.
For more information about using the Ref
function, see Ref
.
Fn::GetAtt
Examples
Template Snippet
The following snippet creates an AWS 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 AWS OpsWorks API Reference.
-
Adding Apps in the AWS OpsWorks User Guide.