From 2d1e657fa4952cda4259f81838a54157c60b1fbc Mon Sep 17 00:00:00 2001 From: Gavin Frazar Date: Thu, 20 Jun 2024 21:09:12 -0700 Subject: [PATCH] [docs] generalize tctl token partial * use --format=text for discovery guide join token * generalize the tctl join token include * remove default tokenFile from partial --- docs/pages/database-access/getting-started.mdx | 2 +- .../database-access/guides/aws-cassandra-keyspaces.mdx | 2 +- docs/pages/database-access/guides/aws-discovery.mdx | 10 +--------- docs/pages/database-access/guides/aws-dynamodb.mdx | 2 +- docs/pages/database-access/guides/aws-opensearch.mdx | 2 +- .../database-access/guides/azure-postgres-mysql.mdx | 2 +- .../database-access/guides/cassandra-self-hosted.mdx | 2 +- .../database-access/guides/clickhouse-self-hosted.mdx | 2 +- .../database-access/guides/cockroachdb-self-hosted.mdx | 2 +- docs/pages/database-access/guides/elastic.mdx | 2 +- docs/pages/database-access/guides/mongodb-atlas.mdx | 2 +- .../database-access/guides/mongodb-self-hosted.mdx | 2 +- docs/pages/database-access/guides/mysql-cloudsql.mdx | 2 +- .../pages/database-access/guides/mysql-self-hosted.mdx | 2 +- .../database-access/guides/oracle-self-hosted.mdx | 2 +- .../pages/database-access/guides/postgres-cloudsql.mdx | 2 +- .../pages/database-access/guides/postgres-redshift.mdx | 2 +- .../database-access/guides/postgres-self-hosted.mdx | 2 +- docs/pages/database-access/guides/redis-aws.mdx | 2 +- docs/pages/database-access/guides/redis-cluster.mdx | 2 +- docs/pages/database-access/guides/redis.mdx | 2 +- .../database-access/guides/redshift-serverless.mdx | 2 +- docs/pages/database-access/guides/snowflake.mdx | 2 +- .../database-access/guides/sql-server-ad-pkinit.mdx | 2 +- docs/pages/database-access/guides/sql-server-ad.mdx | 2 +- docs/pages/database-access/guides/vitess.mdx | 2 +- docs/pages/includes/database-access/rds-proxy.mdx | 2 +- docs/pages/includes/database-access/token.mdx | 9 --------- docs/pages/includes/tctl-token.mdx | 8 ++++++++ 29 files changed, 35 insertions(+), 44 deletions(-) delete mode 100644 docs/pages/includes/database-access/token.mdx create mode 100644 docs/pages/includes/tctl-token.mdx diff --git a/docs/pages/database-access/getting-started.mdx b/docs/pages/database-access/getting-started.mdx index 66ca7062d2396..49e45e2d1b281 100644 --- a/docs/pages/database-access/getting-started.mdx +++ b/docs/pages/database-access/getting-started.mdx @@ -87,7 +87,7 @@ See the [Automatic User Provisioning](./rbac/configuring-access.mdx) guide for h ## Step 2/5. Configure the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) (!docs/pages/includes/database-access/alternative-methods-join.mdx!) diff --git a/docs/pages/database-access/guides/aws-cassandra-keyspaces.mdx b/docs/pages/database-access/guides/aws-cassandra-keyspaces.mdx index a74abd6f72024..04a86f21cb8b4 100644 --- a/docs/pages/database-access/guides/aws-cassandra-keyspaces.mdx +++ b/docs/pages/database-access/guides/aws-cassandra-keyspaces.mdx @@ -29,7 +29,7 @@ Teleport `v11.0`. ## Step 1/5. Set up the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) (!docs/pages/includes/database-access/alternative-methods-join.mdx!) diff --git a/docs/pages/database-access/guides/aws-discovery.mdx b/docs/pages/database-access/guides/aws-discovery.mdx index f69db8ed41057..3bd9ecd29c87b 100644 --- a/docs/pages/database-access/guides/aws-discovery.mdx +++ b/docs/pages/database-access/guides/aws-discovery.mdx @@ -15,15 +15,7 @@ description: How to configure Teleport to discover AWS-hosted databases. ## Step 1/4. Generate a join token -The Discovery Service requires a valid join token to connect to the cluster. - -Generate a join token by running the following command against your Teleport -Auth Service and save it in `/tmp/token` on the host that will run the -Discovery Service. - -```code -$ tctl tokens add --type=discovery -``` +(!docs/pages/includes/tctl-token.mdx serviceName="Discovery" tokenType="discovery" tokenFile="/tmp/token" !) (!docs/pages/includes/database-access/alternative-methods-join.mdx!) diff --git a/docs/pages/database-access/guides/aws-dynamodb.mdx b/docs/pages/database-access/guides/aws-dynamodb.mdx index c452d77230bcd..23bea2f6e2f06 100644 --- a/docs/pages/database-access/guides/aws-dynamodb.mdx +++ b/docs/pages/database-access/guides/aws-dynamodb.mdx @@ -148,7 +148,7 @@ the correct STS endpoint. (!docs/pages/includes/database-access/alternative-methods-join.mdx!) -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) ### Install and start Teleport diff --git a/docs/pages/database-access/guides/aws-opensearch.mdx b/docs/pages/database-access/guides/aws-opensearch.mdx index 86de1a3ea823d..f49bcd17abe70 100644 --- a/docs/pages/database-access/guides/aws-opensearch.mdx +++ b/docs/pages/database-access/guides/aws-opensearch.mdx @@ -150,7 +150,7 @@ $ tctl create -f aws-opensearch-access.yaml ## Step 3/4. Install the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) (!docs/pages/includes/database-access/alternative-methods-join.mdx!) diff --git a/docs/pages/database-access/guides/azure-postgres-mysql.mdx b/docs/pages/database-access/guides/azure-postgres-mysql.mdx index d48f5e616c8c1..b4af54739970c 100644 --- a/docs/pages/database-access/guides/azure-postgres-mysql.mdx +++ b/docs/pages/database-access/guides/azure-postgres-mysql.mdx @@ -29,7 +29,7 @@ Teleport `12.0`. ## Step 1/5. Install the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) Install Teleport on the host where you will run the Teleport Database Service: diff --git a/docs/pages/database-access/guides/cassandra-self-hosted.mdx b/docs/pages/database-access/guides/cassandra-self-hosted.mdx index 598380a9a12f7..40221c8e72701 100644 --- a/docs/pages/database-access/guides/cassandra-self-hosted.mdx +++ b/docs/pages/database-access/guides/cassandra-self-hosted.mdx @@ -28,7 +28,7 @@ Database access for Cassandra & ScyllaDB is available starting from Teleport ## Step 1/5. Set up the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) Install and configure Teleport where you will run the Teleport Database Service: diff --git a/docs/pages/database-access/guides/clickhouse-self-hosted.mdx b/docs/pages/database-access/guides/clickhouse-self-hosted.mdx index 4bb2cea6f1b0b..812bdc9ece589 100644 --- a/docs/pages/database-access/guides/clickhouse-self-hosted.mdx +++ b/docs/pages/database-access/guides/clickhouse-self-hosted.mdx @@ -53,7 +53,7 @@ choose: ## Step 1/5. Create a Teleport token and user -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) (!docs/pages/includes/database-access/create-user.mdx!) diff --git a/docs/pages/database-access/guides/cockroachdb-self-hosted.mdx b/docs/pages/database-access/guides/cockroachdb-self-hosted.mdx index 6ef1b8729525f..c02bdd862daf1 100644 --- a/docs/pages/database-access/guides/cockroachdb-self-hosted.mdx +++ b/docs/pages/database-access/guides/cockroachdb-self-hosted.mdx @@ -33,7 +33,7 @@ description: How to configure Teleport database access with self-hosted Cockroac ## Step 1/4. Set up the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) Install and configure Teleport where you will run the Teleport Database Service: diff --git a/docs/pages/database-access/guides/elastic.mdx b/docs/pages/database-access/guides/elastic.mdx index f2ffee93a65ff..b0fb8c345dcaf 100644 --- a/docs/pages/database-access/guides/elastic.mdx +++ b/docs/pages/database-access/guides/elastic.mdx @@ -19,7 +19,7 @@ description: How to configure Teleport database access with Elasticsearch. ## Step 1/5. Set up the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) Install and configure Teleport where you will run the Teleport Database Service: diff --git a/docs/pages/database-access/guides/mongodb-atlas.mdx b/docs/pages/database-access/guides/mongodb-atlas.mdx index f48f8209550df..fec64b6d0118c 100644 --- a/docs/pages/database-access/guides/mongodb-atlas.mdx +++ b/docs/pages/database-access/guides/mongodb-atlas.mdx @@ -27,7 +27,7 @@ videoBanner: mu_ZKTjnFJ8 ## Step 1/4. Set up the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) Install Teleport on the host where you will run the Teleport Database Service: diff --git a/docs/pages/database-access/guides/mongodb-self-hosted.mdx b/docs/pages/database-access/guides/mongodb-self-hosted.mdx index e193fafe11f11..ddf8a7001d850 100644 --- a/docs/pages/database-access/guides/mongodb-self-hosted.mdx +++ b/docs/pages/database-access/guides/mongodb-self-hosted.mdx @@ -39,7 +39,7 @@ videoBanner: 6lgVObxoLkc ### Set up the Teleport Database service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) Install and configure Teleport where you will run the Teleport Database Service: diff --git a/docs/pages/database-access/guides/mysql-cloudsql.mdx b/docs/pages/database-access/guides/mysql-cloudsql.mdx index e38df8c7bb394..750b6db501447 100644 --- a/docs/pages/database-access/guides/mysql-cloudsql.mdx +++ b/docs/pages/database-access/guides/mysql-cloudsql.mdx @@ -118,7 +118,7 @@ Cloud documentation for more info. ### Create a join token -(!docs/pages/includes/database-access/token.mdx tokenFile="/tmp/token" !) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token" !) ### (Optional) Download the Cloud SQL CA certificate diff --git a/docs/pages/database-access/guides/mysql-self-hosted.mdx b/docs/pages/database-access/guides/mysql-self-hosted.mdx index 9542ab1e5e7d0..64b44596aedd3 100644 --- a/docs/pages/database-access/guides/mysql-self-hosted.mdx +++ b/docs/pages/database-access/guides/mysql-self-hosted.mdx @@ -26,7 +26,7 @@ description: How to configure Teleport database access with self-hosted MySQL/Ma ## Step 1/4. Create the Teleport Database Token -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) ## Step 2/4. Create a certificate/key pair diff --git a/docs/pages/database-access/guides/oracle-self-hosted.mdx b/docs/pages/database-access/guides/oracle-self-hosted.mdx index 3ac2c80a5fb68..7e1641bc39343 100644 --- a/docs/pages/database-access/guides/oracle-self-hosted.mdx +++ b/docs/pages/database-access/guides/oracle-self-hosted.mdx @@ -24,7 +24,7 @@ description: How to configure Teleport database access with Oracle. ## Step 1/6. Create a Teleport token and user -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) diff --git a/docs/pages/database-access/guides/postgres-cloudsql.mdx b/docs/pages/database-access/guides/postgres-cloudsql.mdx index 29195703b6810..a7a2ccb6b8c4d 100644 --- a/docs/pages/database-access/guides/postgres-cloudsql.mdx +++ b/docs/pages/database-access/guides/postgres-cloudsql.mdx @@ -74,7 +74,7 @@ in Google Cloud documentation for more info. ### Create a join token -(!docs/pages/includes/database-access/token.mdx tokenFile="/tmp/token"!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) ### (Optional) Download the Cloud SQL CA certificate diff --git a/docs/pages/database-access/guides/postgres-redshift.mdx b/docs/pages/database-access/guides/postgres-redshift.mdx index 53f9f2298789a..64a5cd9e1b0ba 100644 --- a/docs/pages/database-access/guides/postgres-redshift.mdx +++ b/docs/pages/database-access/guides/postgres-redshift.mdx @@ -34,7 +34,7 @@ videoBanner: UFhT52d5bYg ## Step 2/5. Create a Database Service configuration -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) (!docs/pages/includes/database-access/alternative-methods-join.mdx!) diff --git a/docs/pages/database-access/guides/postgres-self-hosted.mdx b/docs/pages/database-access/guides/postgres-self-hosted.mdx index d09cdf91839b8..733edde08bdf6 100644 --- a/docs/pages/database-access/guides/postgres-self-hosted.mdx +++ b/docs/pages/database-access/guides/postgres-self-hosted.mdx @@ -27,7 +27,7 @@ description: How to configure Teleport database access with self-hosted PostgreS ## Step 1/5. Create a Teleport token and user -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) ### Create a Teleport user diff --git a/docs/pages/database-access/guides/redis-aws.mdx b/docs/pages/database-access/guides/redis-aws.mdx index c620b4c06ff22..13181e8b95ca2 100644 --- a/docs/pages/database-access/guides/redis-aws.mdx +++ b/docs/pages/database-access/guides/redis-aws.mdx @@ -34,7 +34,7 @@ description: How to configure Teleport database access with AWS ElastiCache and ## Step 2/7. Create a Database Service configuration -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) (!docs/pages/includes/database-access/alternative-methods-join.mdx!) diff --git a/docs/pages/database-access/guides/redis-cluster.mdx b/docs/pages/database-access/guides/redis-cluster.mdx index 0ad09febe31cf..070344e5a74ff 100644 --- a/docs/pages/database-access/guides/redis-cluster.mdx +++ b/docs/pages/database-access/guides/redis-cluster.mdx @@ -40,7 +40,7 @@ If you want to configure Redis Standalone, please read [Database Access with Red ## Step 1/6. Set up the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) Install and configure Teleport where you will run the Teleport Database Service: diff --git a/docs/pages/database-access/guides/redis.mdx b/docs/pages/database-access/guides/redis.mdx index a6f50feff7856..1a9f0c8501df5 100644 --- a/docs/pages/database-access/guides/redis.mdx +++ b/docs/pages/database-access/guides/redis.mdx @@ -37,7 +37,7 @@ If you want to configure Redis Cluster, please read [Database Access with Redis ## Step 1/5. Set up the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) Install and configure Teleport where you will run the Teleport Database Service: diff --git a/docs/pages/database-access/guides/redshift-serverless.mdx b/docs/pages/database-access/guides/redshift-serverless.mdx index 41e7c61f80002..31108854c4508 100644 --- a/docs/pages/database-access/guides/redshift-serverless.mdx +++ b/docs/pages/database-access/guides/redshift-serverless.mdx @@ -125,7 +125,7 @@ role 'redshift-serverless-access' has been created ## Step 3/4. Install and start the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) (!docs/pages/includes/database-access/alternative-methods-join.mdx!) diff --git a/docs/pages/database-access/guides/snowflake.mdx b/docs/pages/database-access/guides/snowflake.mdx index 652a997fd5b7e..060f962eda9eb 100644 --- a/docs/pages/database-access/guides/snowflake.mdx +++ b/docs/pages/database-access/guides/snowflake.mdx @@ -31,7 +31,7 @@ description: How to configure Teleport database access with Snowflake. ## Step 1/5. Set up the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) Install and configure Teleport where you will run the Teleport Database Service: diff --git a/docs/pages/database-access/guides/sql-server-ad-pkinit.mdx b/docs/pages/database-access/guides/sql-server-ad-pkinit.mdx index 37fc32341a0a7..6418552b49daf 100644 --- a/docs/pages/database-access/guides/sql-server-ad-pkinit.mdx +++ b/docs/pages/database-access/guides/sql-server-ad-pkinit.mdx @@ -198,7 +198,7 @@ from there, you can copy and use it on your database configuration. ## Step 4/7. Set up the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) Install Teleport on the host where you will run the Teleport Database Service: diff --git a/docs/pages/database-access/guides/sql-server-ad.mdx b/docs/pages/database-access/guides/sql-server-ad.mdx index 4ac6cf8fe3ac6..be1b2f88c614f 100644 --- a/docs/pages/database-access/guides/sql-server-ad.mdx +++ b/docs/pages/database-access/guides/sql-server-ad.mdx @@ -196,7 +196,7 @@ KVNO Principal ## Step 4/7. Set up the Teleport Database Service -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) Install Teleport on the host where you will run the Teleport Database Service: diff --git a/docs/pages/database-access/guides/vitess.mdx b/docs/pages/database-access/guides/vitess.mdx index 4a1c9ec69f259..d154bf4379ca7 100644 --- a/docs/pages/database-access/guides/vitess.mdx +++ b/docs/pages/database-access/guides/vitess.mdx @@ -31,7 +31,7 @@ description: How to configure Teleport database access for Vitess (MySQL protoco ## Step 1/4. Create the Teleport Database Token -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) ## Step 2/4. Create a certificate/key pair diff --git a/docs/pages/includes/database-access/rds-proxy.mdx b/docs/pages/includes/database-access/rds-proxy.mdx index e9e15f078c257..92123a7d585bf 100644 --- a/docs/pages/includes/database-access/rds-proxy.mdx +++ b/docs/pages/includes/database-access/rds-proxy.mdx @@ -28,7 +28,7 @@ Teleport currently supports RDS Proxy instances with engine family ## Step 1/5. Create a Database Service configuration -(!docs/pages/includes/database-access/token.mdx!) +(!docs/pages/includes/tctl-token.mdx serviceName="Database" tokenType="db" tokenFile="/tmp/token"!) (!docs/pages/includes/database-access/alternative-methods-join.mdx!) diff --git a/docs/pages/includes/database-access/token.mdx b/docs/pages/includes/database-access/token.mdx deleted file mode 100644 index 294564661f3f6..0000000000000 --- a/docs/pages/includes/database-access/token.mdx +++ /dev/null @@ -1,9 +0,0 @@ -{{ tokenFile="/tmp/token" }} - -The Database Service requires a valid join token to join your Teleport cluster. -Run the following `tctl` command and save the token output in `{{ tokenFile }}` -on the server that will run the Database Service: - -```code -$ tctl tokens add --type=db --format=text -``` diff --git a/docs/pages/includes/tctl-token.mdx b/docs/pages/includes/tctl-token.mdx new file mode 100644 index 0000000000000..a2f1ad05eee6f --- /dev/null +++ b/docs/pages/includes/tctl-token.mdx @@ -0,0 +1,8 @@ +The {{ serviceName }} Service requires a valid join token to join your Teleport cluster. +Run the following `tctl` command and save the token output in `{{ tokenFile }}` +on the server that will run the {{ serviceName }} Service: + +```code +$ tctl tokens add --type={{ tokenType }} --format=text +(=presets.tokens.first=) +```