Using application configuration objects to access secure data
You can use application configuration objects to access securely stored configuration data from your Teracloud® Streams environment.
About this task
- Database connection data
- Credentials that your applications need to use to access external systems
- Other data, such as the port number of a TCP sink or source operator
An application configuration object enables you to store this type of information in a central location, rather than storing configuration files on each host where a job might be deployed. However, the application developer must configure the operators in the application to call the appropriate application configuration objects.
You must determine which properties and values to include in your application configuration objects.
You can create an application configuration object at either the Teracloud® Streams domain or instance level. Before you create the application configuration object, consider the domains and instances that your users and applications have access to and ensure that your application configuration objects are created at the appropriate level.
To create an application configuration at the domain level, you must have domain administrator permissions. Instance users can create application configuration objects at the instance level.
Application configuration objects are encrypted and stored in Apache ZooKeeper.
Procedure
-
To use the interactive
streamtool
interface to create the application configuration object, run thestreamtool mkappconfig
command:mkappconfig [-d,--domain-id did] [-i,--instance-id instance] [--description description] [--property name=value] ... [--propfile property-file] [-U,--User user] [-h,--help] [--trace level] [-v,--verbose level] config-name
Replace the config-name variable with the name that you want to use for the application configuration object. This is the name that an application must use to retrieve the application configuration object.
You can specify the properties of the application configuration object by:- Pulling the values from a properties file by specifying the --propfile option.
- Specifying each name-value pair individually by specifying the --propertyoption for each property.
Tip: If you specify a value for both the --propfile option and the --property option, the values that are specified in the --property option override any values that are specified for the same property in the file that is specified by the --propfile option.If you specify each property manually from the interactivestreamtool
interface, your command might look something like this:mkappconfig --property userName=dbUserName --property password=dbPassword dbConnectConfig
-
To use the Teracloud® Streams
Console to create the application configuration object: