Selecione suas preferências de cookies

Usamos cookies essenciais e ferramentas semelhantes que são necessárias para fornecer nosso site e serviços. Usamos cookies de desempenho para coletar estatísticas anônimas, para que possamos entender como os clientes usam nosso site e fazer as devidas melhorias. Cookies essenciais não podem ser desativados, mas você pode clicar em “Personalizar” ou “Recusar” para recusar cookies de desempenho.

Se você concordar, a AWS e terceiros aprovados também usarão cookies para fornecer recursos úteis do site, lembrar suas preferências e exibir conteúdo relevante, incluindo publicidade relevante. Para aceitar ou recusar todos os cookies não essenciais, clique em “Aceitar” ou “Recusar”. Para fazer escolhas mais detalhadas, clique em “Personalizar”.

Use the Ruby SDK to generate a token in Aurora DSQL

Modo de foco
Use the Ruby SDK to generate a token in Aurora DSQL - Amazon Aurora DSQL
Esta página não foi traduzida para seu idioma. Solicitar tradução

Amazon Aurora DSQL is provided as a Preview service. To learn more, see Betas and Previews in the AWS Service Terms.

Amazon Aurora DSQL is provided as a Preview service. To learn more, see Betas and Previews in the AWS Service Terms.

Once your cluster is ACTIVE, you can generate an authentication token.

There are two ways to generate the token

  • If you are connecting as admin user, you use the generate_db_connect_admin_auth_token

  • If you are connecting with a custom database role, you use the generate_db_connect_auth_token

The following example uses the following attributes to generate an authentication token for the admin role.

  • your_cluster_endpoint – endpoint of the cluster. Follows the format your_cluster_identifier.dsql.AWS_REGION.on.aws

  • region – The AWS Region, such as us-east-2 or us-east-1

require 'aws-sdk-dsql' def generate_token(your_cluster_endpoint, region) credentials = Aws::SharedCredentials.new() begin token_generator = Aws::DSQL::AuthTokenGenerator.new({ :credentials => credentials }) # The token expiration time is optional, and the default value 900 seconds # if you are not using admin role, use generate_db_connect_auth_token instead token = token_generator.generate_db_connect_admin_auth_token({ :endpoint => your_cluster_endpoint, :region => region }) rescue => error puts error.full_message end end
PrivacidadeTermos do sitePreferências de cookies
© 2025, Amazon Web Services, Inc. ou suas afiliadas. Todos os direitos reservados.