Skip to main content

Secret values variables

When a job is running, you can view the startup logs, running logs, and exceptions of the job. This page describes how to view a job's startup logs, running logs, and exceptions.

Configure a Secret Value Variable​

After you configure a Secret Value Variable, you can reference the variable in SQL scripts, in deployment parameters, or in the Additional Flink Configuration section of the Deployment Defaults page for the job in the console of fully managed Flink. This page describes how to configure and reference a secret value variable.

Background Information​

Variables help solve the following issues:

  • You can delete and add variables multiple times to dynamically change the values of variables. This improves the efficiency of variable replacement.
  • You can use variables to avoid security risks that are caused by plaintext AccessKey pairs in DDL statements.

Limitations​

You can only add and delete variables. You cannot change or view the values of variables.

To configure a variable:

  1. Go to Security β†’ Secret Values.
  2. Click Add Secret Value.
  3. Fill in Secret Name and Secret Value. Note that they both are case-sensitive. Then click OK.

Limitations

Reference a variable​

After you configure a variable, you can reference the variable in SQL scripts, in the Deployment Parameters, or in the Additional Flink Configuration section of the Deployment Defaults page.

Wherever you use the variable, use the ${secret_values.Variable_name} format.

Reference the variable in the DDL statements in SQL scripts​

  1. Go to SQL Editor.
  2. Reference the variable in the SQL scripts.

Sample code:

    CREATE TEMPORARY table datahub_source(
Β  name VARCHAR
) WITH (
Β  'connector' = 'datagen'
);

CREATE TEMPORARY table datahub_sink(
Β  nameΒ  VARCHARΒ 
) WITH (
Β  'connector'='datahub',
Β  'endpoint'='<yourEndpoint>',
Β  'project'='<yourProject>',
Β  'topic'='<yourTopic>',
Β  'accessId'='<yourAccessId>',
Β  'accessKey'='${secret_values.test_ak}'
);

INSERT INTO datahub_sink
SELECT
Β  LOWER(name)
from datahub_source;

Reference the variable in Deployment Parameters​

  1. Go to Deployments
  2. Click on any deployment, and select the Configuration tab.
  3. Click edit at the row of Parameters, and specify the variable in Additional Flink Configuration. Example: accessKey: ${secret_values.test_ak}
  4. Click Save.
  1. In the left-side navigation pane, select Configurations -> Deployment Defaults.
  2. Reference variable in the Additional Flink Configuration section. Example: accessKey: ${secret_values.test_ak}
  3. Click Save Changes.

image