Create the deployment.json File

The deployment.json file specifies how much memory to allocate to the application, how many application instances to create initially, additional environment variables, and service bindings to other Oracle Cloud services. You can specify these same options from the user interface, or you can upload this file using the REST API. If no values are specified or the file is omitted, then memory and instance defaults are used. This file is optional.

deployment.json Syntax

  • memory – The amount of memory in gigabytes made available to the application. Values range from 1G to 20G. The default is 2G.

  • instances – Number of application instances. The default is 2. The maximum is 64.

  • notes – Free-form comment field. It can be used, for example, to describe the deployment plan.

  • environment  – Environment variables used by the application. This element can contain any number of name-value pairs.

    • name – Environment variable name.

    • value – Environment variable value.

  • secureEnvironment – List of environment variables marked as secured on the user interface. The environment variables to be secured must be present in the environment property.

  • java_system_properties  – Java EE system properties used by the application. This element can contain any number of name-value pairs.

    • name – Property name.

    • value – Property value.

  • services  – Service bindings for connections to other Oracle Cloud services. This element can contain more than one block of sub-elements. Each block specifies one service binding.

    • identifier – User-specified identifier.

    • type – Type of the service: JAAS for Oracle Java Cloud Service, DBAAS for Oracle Database Cloud Service, MYSQLCS for MySQL Cloud Service, OEHCS for an Oracle Event Hub Cloud Service topic, OEHPCS for an Oracle Event Hub Cloud Service cluster, DHCS for Oracle Data Hub Cloud Service, or caching for a cache.

    • name – Name of the service, the name of an existing Oracle Java Cloud Service instance, Oracle Database Cloud Service database, MySQL Cloud Service database, Oracle Event Hub Cloud Service topic or cluster, Oracle Data Hub Cloud Service instance, or cache name.

    • username – Username used to access the service.

    • password – Password for the username.

Note:

The username and password are not automatically used to authenticate against the target service. The values are placed in the SERVICE_USER_NAME and SERVICE_USER_PASSWORD environment variables, which your application can access. If the target service requires authentication, then your application must handle it. If the target service doesn’t require authentication, you can’t omit the username and password from the services element, but you can specify any values.

Note:

If you download a deployment.json file from a deployed application that has a service binding, then you see an additional id element under services. The value of this element is system-generated. For a new application, do not upload a deployment.json file that includes this element. For an existing application, do not change the value of this element.

Example 3-15 deployment.json

{
    "memory": "2G",
    "instances": "2",  
    "environment": {
        "NO_OF_CONNECTIONS":"25",
        "TWITTER_ID":"JAVA",
        "user": "joe.smith@example.com"
    },
    "secureEnvironment": [ 
        "user"
    ],    
    "services": [{
        "identifier": "ProdService",
        "type": "JAAS",
        "name": "Jaas Service",
        "username": "username",
        "password": "password"
    },
    {
        "identifier": "DBService",
        "type": "DBAAS",
        "name": "MyDB",
        "username": "username",
        "password": "password"
    }]
}