Skip to content

Latest commit

 

History

History
1373 lines (859 loc) · 23.2 KB

resources-9e34487.md

File metadata and controls

1373 lines (859 loc) · 23.2 KB

Resources

The application modules defined in the “modules” section of the deployment descriptor may depend on resources.

The resources may be used as:

  • platform services managed by the deployer or only used by the applications
  • configuration entries used by the applications and services

In the resources section, the following elements are mandatory:

  • name - Must be unique within the MTA it identifies

Optional resource attributes include:

  • type - the resource type is one of a reserved list of resource types supported by the MTA-aware deployment tools, for example: com.sap.xs.uaa, com.sap.xs.hdi-container, com.sap.xs.job-scheduler; the type indicates to the deployer how to discover, allocate, or provision the resource, for example, a managed service such as a database, or a user-provided service. When type is not defined, resource is used for configurations only for other modules and resources.

  • description - non-translatable, free-text string; the string is not meant to be presented on application user interfaces (UI)

  • properties - a structured set of name-value pairs

  • parameters - reserved variables that affect the behavior of the MTA-aware tools, such as the deployer

  • active - its value can be true or false and the default value is true. If set to false, the resource is not processed and it is ignored in the requires list of the application that requires it.

  • processed-after - the attribute is used to create an order, in which resources should be processed. If a resource has this attribute, it will be processed after the other resources in a higher position are processed. The attribute value is a structured set of a list comprised of other resource names of the same MTA.

    Tip:

    By default recourses process in parallel, but if you want to enable an order of resources, see Sequential Resource Processing.

  • optional- its value can be true or false and the default value is false. If set to true, the resource processing is fail-safe.

If you deploy an application with a resource type attribute active set to false, the resource is not provisioned and no binding is created. If you have already deployed the application with the resource type attribute active set to true, the binding to the resource is removed.

Deployment with managed-service, existing-service and user-provided service

No binding is created and in case of managed-service, no service is created.

**Deployment with org.cloudfoundry.existing-service-key **

No binding to an application environment will be done in the following cases:

  • If the org.cloudfoundry.existing-service-key resource itself is set to active: false
  • If the org.cloudfoundry.existing-service-key resource is set to active: true, but refers to a resource, which is set to active: false

Deployment with configuration resources (cross MTA dependencies)

If the configuration resource is set to active: false, then:

  • If the requires section of the module type expects a list, then the environment variable assigned to this list is empty and subscriptions between the modules is not created
  • If the requires section does not expect a list, then no environment variable is created

See section “Optional resources” below for more information.

Restriction:

System-specific parameters for the deployment descriptor must be included in a so-called MTA deployment extension descriptor.

To describe resources that are not mission-critical for the operation of your Multitarget Application, proceed as described below.

Note:

This option is available with schema version 3.1.

You can declare some resources as optional, which mitigates the cases when they are not listed, not available, or have failed to be created or updated. This means that when the deployer cannot allocate the required resource due to any of these reasons, it generates a warning and continues processing. Alternatively, if a resource is not declared as optional, the deployer generates an error and stops processing.

The following excerpt is a code example for the MANIFEST.MF file.

Sample Code:

...
resources:
...
- name: log
  type: com.sap.xs.auditlog
  optional: true
...

In the above example:

  • If the log managed resource is not provided by the platform or landscape, a warning is logged and traced and the MTA deployment continues while ignoring the error.
  • The available values for the optional parameter are true and false, with the latter being the default.
  • org.cloudfoundry.managed-service

    In cases you have to choose a managed service and/or service plan that is not listed in Predefined MTA Resource Types, you define it using the org.cloudfoundry.managed-service resource type with the following parameters:

    • (Required) service - Name of the service to create.

    • (Optional) service-name - Service instance name. Default value is the resource name.

      Note:

      Service names that do not comply with the Cloud Foundry limitation of 50 symbols are automatically corrected. In such cases, the name is shortened and its end is replaced with a hash code.

    • (Required) service-plan - Name of the service plan.

    For example:

    Sample Code:

    resources:
      - name: my-postgre-service
        type: org.cloudfoundry.managed-service
        parameters:
          service: postgresql
          service-plan: v9.6-dev
    
    

    Note:

    To choose a different service plan for a predefined MTA resource type, for example to change the service plan for PostgreSQL service, you define it using:

    Sample Code:

    resources:
      - name: my-postgre-service
        type: org.postgresql
        parameters:
          service-plan: v9.6-dev
    
    
  • org.cloudfoundry.existing-service

    То indicate that the (named) service exists, without managing its lifecycle, you define the service name by using the org.cloudfoundry.existing-service resource type with the following parameters:

    • (Optional) service-name - Service instance name. Default value is the resource name.
  • org.cloudfoundry.existing-service-key

    Existing service keys can be modeled as a resource of type org.cloudfoundry.existing-service-key, which checks and uses their credentials. For more information, see Service Keys.

  • org.cloudfoundry.user-provided-service

    Create or update a user-provided service configured with the following resource parameters:

    • (Optional) service-name - Name of the service to create. Default value is the resource name.

      Note:

      Service names that do not comply with the Cloud Foundry limitation of 50 symbols are automatically corrected. In such cases, the name is shortened and its end is replaced with a hash code.

    • (Required) config - Map value, containing the service creation configuration, for example url and user credentials (user and password)

    Example:

    Sample Code:

    resources:
      - name: my-destination-service
        type: org.cloudfoundry.user-provided-service
        parameters:
          config:
            <credential1>: <value1>
            <credential2>: <value2>
    
    
  • configuration

    For more information, see Cross-MTA Dependencies.

Modify the default MTA resource types by providing specific properties or parameters in the MTA deployment descriptor.

Predefined MTA Resource Types and Mapped Services

Resource Type

Service

Service Plan

Created Service

com.sap.xs.hana-schema

Example:

Sample Code:

name: hcsp-sch
type: com.sap.xs.hana-schema
parameters:
service-name: HCSP_SCH
config:
database_id: 9bf1f23a-123c-456e-b789-ff12ea34a5dc
schema: HCSP_DB

hana

schema

Plain schema

com.sap.xs.hana-securestore

hana

securestore

SAP HANA secure store

com.sap.xs.hdi-container

Note:

When using а free trial subaccount, modify the default service:

Sample Code:

resources:
	- name: my-hdi-service 
	  type: com.sap.xs.hdi-container 
	  parameters: 
		service: hanatrial

hana

hdi-shared

HDI container

com.sap.xs.jobscheduler

jobscheduler

lite

Job Scheduler

com.sap.xs.uaa

xsuaa

applicaton

Application UAA

com.sap.xs.uaa-application

xsuaa

application

Application UAA

com.sap.xs.uaa-devuser

xsuaa

application

Application UAA

com.sap.xs.uaa-space

xsuaa

application

Application UAA

com.sap.xs.application-logs

Restriction:

This resource type is now deprecated. Use application-logs instead.

application-logs

lite

Streams logs of bound applications to a central application logging stack

com.sap.portal.site-content

Restriction:

Use only with the SAP Node.js module @sap/site-content-deployer

portal-services

site-content

Portal services

com.sap.portal.site-host

Restriction:

Only for use with the SAP Node.js module @sap/site-entry

portal-services

site-host

Portal services

com.sap.xs.auditlog

auditlog

standard

Audit log service

auditlog

auditlog

standard

Audit log service

autoscaler

autoscaler

standard

Automatically increase or decrease the number of application instances based on a policy you define.

application-logs

application-logs

lite

Streams logs of bound applications to a central application logging stack

connectivity

connectivity

lite

Establishes a secure and reliable connectivity between cloud applications and on-premise systems

destination

destination

lite

Provides a secure and a reliable access to destination configurations

feature-flags

feature-flags

lite

Feature Flags service for controlling feature rollout

ml-foundation-services

ml-foundation-services

lite

 

objectstore

objectstore

s3-standard

Highly available and distributed consistent object store

org.mongodb

Restriction:

This resource type is now deprecated. Use mongodb instead.

mongodb

v3.0-container

MongoDB document-oriented database system.

mongodb

mongodb

v3.0-container

MongoDB document-oriented database system

org.postgresql

Restriction:

This resource type is now deprecated. Use postgresql instead.

postgresql

v9.4-container

PostgreSQL object-relational database system

postgresql

postgresql

v9.4-container

PostgreSQL object-relational database system

com.rabbitmq

Restriction:

This resource type is now deprecated. Use rabbitmq instead.

rabbitmq

v3.6-container

RabbitMQ messaging

rabbitmq

rabbitmq

v3.6-container

RabbitMQ messaging

io.redis

Restriction:

This resource type is now deprecated. Use redis instead.

redis

v3.0-container

Redis in-memory data structure store

redis

redis

v3.0-container

Redis in-memory data structure store

Resource parameters have platform-specific semantics. To reference a parameter value, use the placeholder notation ${<parameter>}, for example, ${default-host}.

Tip:

It is also possible to declare metadata for parameters and properties defined in the MTA deployment descriptor; the mapping is based on the parameter or property keys. For example, you can specify if a parameter is required (optional: false) or can be modified (overwritable: true).

The following parameters are supported:

Note:

If you can't find a specific parameter from the native Cloud Foundry manifest here, refer to Prerequisites and Restrictions to see which Cloud Foundry features are currently not supported.

MTA Development and Deployment Parameters

Parameter

Read-Only (System)

Description

Default Value

Example

apply-namespace

Write

Applies namespace to the service name. If the namespace value is not provided in the CLI options, it is not applied. For more information, see Fine-Grained Configuration.

 

resources:
- name: java
     ...
  parameters:
	apply-namespace: true 
   

config

Write

Defines service creation parameters. More information in Service Creation Parameters.

n/a

See Service Creation Parameters.

syslog-drain-url

Write

The URL to which logs for bound applications are streamed.

Note:

This feature only works for user-provided services.

n/a

resources: 
  - name: service-name 
    type: org.cloudfoundry.user-provided-service 
    parameters: 
      syslog-drain-url: syslog://example.log-aggregator.com

default-container-name

Yes

Default value for the container-name parameter that is used during HDI creation. It is based on the organization, space and resource name, which are combined in a way that conforms to the container-name restrictions for length and legal characters. All dash (-) symbols are replaced with an underscore (_).

Note:

It is highly recommended to avoid using this parameter with HANA services because in some cases the generated name cannot comply with the HANA naming limitations' requirements. Forward compatability is not guaranteed.

Generated as described in the description.

<org_name>_<space_name>_<resource_name>

default-service-name

Yes

The name of the service in the Cloud Foundry environment to be created for this resource, based on the resource name with or without a name-space prefix.

The resource name with or without a name-space prefix

nodejs-hdi-container

com.sap.xs2.samples.xsjshelloworld.nodejs-hdi-container

default-xsappname

Yes

Default value for the xsappname parameter that is used during UAA creation. It is based on the service name, which is modified in a way that conforms to the xsappname restrictions for length and legal characters.

Generated as described in the description.

xs_-deploy-service-database (if the service name is “xs@-deploy-service-database”)

service

 

The type of the created service

Empty, or as specified in resource-type

service: hana

service-key-name

Write

Used when consuming an existing service key. Specifies the name of the service key. See Consumption of Service Keys for more information.

The name of the resource.

service-key-name: my-service-key

service-name

 

The name of the service in the Cloud Foundry environment to be created for this resource, based on the resource name with or without a name-space prefix.

Note:

Service names that do not comply with the Cloud Foundry limitation of 50 symbols are automatically corrected. In such cases, the name is shortened and its end is replaced with a hash code.

${default-service-name}

nodejs-hdi-container

com.sap.xs2.samples.xsjshelloworld.nodejs-hdi-container

service-plan

 

The plan of the created service

Empty, or as specified in resource-type

service-plan: hdi-shared

service-tags

Write

Some services employ a list of custom tags, which provide an easier way for applications to parse <VCAP_SERVICES> for credentials. You can provide custom tags when creating a service instance. For more information, see Service Tags.

n/a

resources: 
  - name: nodejs-uaa 
    type: com.sap.xs.uaa 
    parameters: 
      service-tags: ["custom-tag-A", "custom-tag-B"] 

service-broker

 

Use this parameter to specify the service broker you want to employ when you create your service. This can be useful for testing purposes, among others.

Name of service broker you want to be used.

resources: 
  - name: test-service
    type: org.cloudfoundry.managed-service
    parameters: 
      service: foo
      service-plan: bar-a
      service-broker: test-broker-1

skip-service-updates

 

This parameter allows you to specify the service configuration changes to ignore, when deciding if you want to update a service instance – in particular changes of service parameters, plan, or tags.

The default value for all is false. The service instance would be updated on change in any of the configurations.


resources:
  - name: service-name
    type: org.cloudfoundry.managed-service
    parameters:
      skip-service-updates:
          plan: true
          parameters: true
          tags: true

In the example above, skip-service-updates modifies the update strategy as follows:

  • allows users to specify which configurations should not be updated

Note that these 3 key-value pairs can be in any order.

Tip:

For a better understanding of the interactions among the service, service broker, and service instances, see Provisioning and integrating service instances.

Related Information

Services Overview

Provisioning and integrating service instances