CreateApp - OpsWorks

CreateApp

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.

Request Syntax

{ "AppSource": { "Password": "string", "Revision": "string", "SshKey": "string", "Type": "string", "Url": "string", "Username": "string" }, "Attributes": { "string" : "string" }, "DataSources": [ { "Arn": "string", "DatabaseName": "string", "Type": "string" } ], "Description": "string", "Domains": [ "string" ], "EnableSsl": boolean, "Environment": [ { "Key": "string", "Secure": boolean, "Value": "string" } ], "Name": "string", "Shortname": "string", "SslConfiguration": { "Certificate": "string", "Chain": "string", "PrivateKey": "string" }, "StackId": "string", "Type": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

AppSource

A Source object that specifies the app repository.

Type: Source object

Required: No

Attributes

One or more user-defined key/value pairs to be added to the stack attributes.

Type: String to string map

Valid Keys: DocumentRoot | RailsEnv | AutoBundleOnDeploy | AwsFlowRubySettings

Required: No

DataSources

The app's data source.

Type: Array of DataSource objects

Required: No

Description

A description of the app.

Type: String

Required: No

Domains

The app virtual host settings, with multiple domains separated by commas. For example: 'www.example.com, example.com'

Type: Array of strings

Required: No

EnableSsl

Whether to enable SSL for the app.

Type: Boolean

Required: No

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.

Type: Array of EnvironmentVariable objects

Required: No

Name

The app name.

Type: String

Required: Yes

Shortname

The app's short name.

Type: String

Required: No

SslConfiguration

An SslConfiguration object with the SSL configuration.

Type: SslConfiguration object

Required: No

StackId

The stack ID.

Type: String

Required: Yes

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.

Type: String

Valid Values: aws-flow-ruby | java | rails | php | nodejs | static | other

Required: Yes

Response Syntax

{ "AppId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

AppId

The app ID.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

ResourceNotFoundException

Indicates that a resource was not found.

HTTP Status Code: 400

ValidationException

Indicates that a request was not valid.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: