|
| 1 | +include::attributes.txt[] |
| 2 | + |
| 3 | +// Attributes |
| 4 | +[.topic] |
| 5 | +[#cli-telemetry] |
| 6 | += Configure {aws} CDK CLI telemetry |
| 7 | +:info_titleabbrev: Configure CDK CLI telemetry |
| 8 | +:keywords: {aws} CDK CLI, reporting, usage data, telemetry |
| 9 | + |
| 10 | +[abstract] |
| 11 | +-- |
| 12 | +The {aws} Cloud Development Kit ({aws} CDK) will begin collecting anonymous telemetry data on CLI usage to gain insight into how the {aws} CDK CLI is being used. |
| 13 | +-- |
| 14 | + |
| 15 | +// Content start |
| 16 | + |
| 17 | +[#telemetry-intro] |
| 18 | +== What is CDK CLI telemetry? |
| 19 | + |
| 20 | +[IMPORTANT] |
| 21 | +==== |
| 22 | +{aws} CDK CLI telemetry has not been released. We are not collecting or reporting CDK CLI usage data. When the feature is released, this documentation will be updated with information about the data that is being collected. |
| 23 | +==== |
| 24 | + |
| 25 | +When {aws} CDK CLI telemetry is released, customers are opted in to CLI usage data collection and reporting by default. You can opt out of CDK CLI telemetry in advance of its release using the CDK CLI, context values, or an environment variable. |
| 26 | + |
| 27 | + |
| 28 | +[#telemetry-opt-out] |
| 29 | +== How to opt out of CDK CLI telemetry |
| 30 | + |
| 31 | +To view your current telemetry status based on context values and environment variables, run the following command: |
| 32 | + |
| 33 | +[source,none,subs="verbatim,attributes"] |
| 34 | +---- |
| 35 | +cdk cli-telemetry --status |
| 36 | +---- |
| 37 | +[#telemetry-context] |
| 38 | +=== Opt out using context values |
| 39 | +If there are conflicts in the context values from various sources, the CDK uses the following order of precedence. |
| 40 | + |
| 41 | +. Context values specified using a CDK CLI command with the `--context` option |
| 42 | +. Context values in cdk.json |
| 43 | +. Context values in cdk.context.json |
| 44 | +. Context values in ~/.cdk.json |
| 45 | + |
| 46 | +*To opt out using a CDK CLI command* |
| 47 | + |
| 48 | +Run the following CDK CLI command to disable telemetry: |
| 49 | + |
| 50 | +[source,none,subs="verbatim,attributes"] |
| 51 | +---- |
| 52 | +cdk cli-telemetry --disable |
| 53 | +---- |
| 54 | + |
| 55 | +Running this command records the action to your local `cdk.context.json` file and applies to the current CDK application only. |
| 56 | + |
| 57 | +*To opt out using the application configuration file* |
| 58 | + |
| 59 | +Set `cli-telemetry: false` in an application's `cdk.json` file. This disables telemetry for the application. |
| 60 | + |
| 61 | +*To opt out using the global configuration file* |
| 62 | + |
| 63 | +Set `cli-telemetry: false` in the `~/.cdk.json` file to disable telemetry for all CDK applications on the same computer. |
| 64 | + |
| 65 | +[#telemetry-environment-variable] |
| 66 | +=== Opt out using an environment variable |
| 67 | + |
| 68 | +Set the `CDK_DISABLE_CLI_TELEMETRY` environment variable to `true` to disable CLI telemetry in the that environment. |
| 69 | + |
| 70 | +[source,none,subs="verbatim,attributes"] |
| 71 | +---- |
| 72 | +CDK_DISABLE_CLI_TELEMETRY=true |
| 73 | +---- |
| 74 | +The value of this environment variable takes precendence over any context values that have been set. |
| 75 | + |
| 76 | +[TIP] |
| 77 | +==== |
| 78 | +Add this environment variable to your shell startup file, such as `.bashrc`, to disable telemetry every time you open a terminal window. |
| 79 | +==== |
| 80 | + |
| 81 | +[#telemetry-optout-all] |
| 82 | +=== Opt out of all usage data reporting |
| 83 | + |
| 84 | +To opt out of all usage data reporting for a single command, use the `--no-version-reporting` global CLI option. This option turns off both application usage data collection and CDK CLI telemetry. |
| 85 | + |
| 86 | +If you are currently opting out of application usage data collection using the `--no-version-reporting` option, you are automatically opted out of CDK CLI telemetry for that specific command execution, regardless of context values. |
| 87 | + |
| 88 | +[NOTE] |
| 89 | +==== |
| 90 | +If you set `analyticsReporting` at the stack level, it takes precedence over the `--no-version-reporting` option for application usage data collection only. |
| 91 | +==== |
| 92 | + |
| 93 | +[#telemetry-data-file] |
| 94 | +== Send telemetry data to a local file |
| 95 | + |
| 96 | +If you choose to stay opted in to CDK CLI telemetry, you can choose to send your telemetry data to a local file. You can then review the file to audit the telemetry data we are collecting. |
| 97 | + |
| 98 | +Use the following option to send telemetry data to a local file: |
| 99 | +[source,none,subs="verbatim,attributes"] |
| 100 | +---- |
| 101 | + --telemetry-file='path/to/local/file' |
| 102 | +---- |
| 103 | +
|
| 104 | +[NOTE] |
| 105 | +==== |
| 106 | +The `--telemetry-file` option is being released prior to the launch of the telemetry feature. It is considered production-ready and safe to use. However, you must opt in by providing the `--unstable` option. The `--unstable` flag will be ignored after launch. |
| 107 | +==== |
| 108 | +
|
| 109 | +The following command sends telemetry data to a local file: |
| 110 | +[source,none,subs="verbatim,attributes"] |
| 111 | +---- |
| 112 | +cdk deploy --unstable=telemetry --telemetry-file='path/to/local/file' |
| 113 | +---- |
0 commit comments