Glue / Client / test_connection

test_connection#

Glue.Client.test_connection(**kwargs)#

Tests a connection to a service to validate the service credentials that you provide.

You can either provide an existing connection name or a TestConnectionInput for testing a non-existing connection input. Providing both at the same time will cause an error.

If the action is successful, the service sends back an HTTP 200 response.

See also: AWS API Documentation

Request Syntax

response = client.test_connection(
    ConnectionName='string',
    CatalogId='string',
    TestConnectionInput={
        'ConnectionType': 'JDBC'|'SFTP'|'MONGODB'|'KAFKA'|'NETWORK'|'MARKETPLACE'|'CUSTOM'|'SALESFORCE'|'VIEW_VALIDATION_REDSHIFT'|'VIEW_VALIDATION_ATHENA'|'GOOGLEADS'|'GOOGLESHEETS'|'GOOGLEANALYTICS4'|'SERVICENOW'|'MARKETO'|'SAPODATA'|'ZENDESK'|'JIRACLOUD'|'NETSUITEERP'|'HUBSPOT'|'FACEBOOKADS'|'INSTAGRAMADS'|'ZOHOCRM'|'SALESFORCEPARDOT'|'SALESFORCEMARKETINGCLOUD'|'SLACK'|'STRIPE'|'INTERCOM'|'SNAPCHATADS',
        'ConnectionProperties': {
            'string': 'string'
        },
        'AuthenticationConfiguration': {
            'AuthenticationType': 'BASIC'|'OAUTH2'|'CUSTOM'|'IAM',
            'OAuth2Properties': {
                'OAuth2GrantType': 'AUTHORIZATION_CODE'|'CLIENT_CREDENTIALS'|'JWT_BEARER',
                'OAuth2ClientApplication': {
                    'UserManagedClientApplicationClientId': 'string',
                    'AWSManagedClientApplicationReference': 'string'
                },
                'TokenUrl': 'string',
                'TokenUrlParametersMap': {
                    'string': 'string'
                },
                'AuthorizationCodeProperties': {
                    'AuthorizationCode': 'string',
                    'RedirectUri': 'string'
                },
                'OAuth2Credentials': {
                    'UserManagedClientApplicationClientSecret': 'string',
                    'AccessToken': 'string',
                    'RefreshToken': 'string',
                    'JwtToken': 'string'
                }
            },
            'SecretArn': 'string',
            'KmsKeyArn': 'string',
            'BasicAuthenticationCredentials': {
                'Username': 'string',
                'Password': 'string'
            },
            'CustomAuthenticationCredentials': {
                'string': 'string'
            }
        }
    }
)
Parameters:
  • ConnectionName (string) – Optional. The name of the connection to test. If only name is provided, the operation will get the connection and use that for testing.

  • CatalogId (string) – The catalog ID where the connection resides.

  • TestConnectionInput (dict) –

    A structure that is used to specify testing a connection to a service.

    • ConnectionType (string) – [REQUIRED]

      The type of connection to test. This operation is only available for the JDBC or SALESFORCE connection types.

    • ConnectionProperties (dict) – [REQUIRED]

      The key-value pairs that define parameters for the connection.

      JDBC connections use the following connection properties:

      • Required: All of ( HOST, PORT, JDBC_ENGINE) or JDBC_CONNECTION_URL.

      • Required: All of ( USERNAME, PASSWORD) or SECRET_ID.

      • Optional: JDBC_ENFORCE_SSL, CUSTOM_JDBC_CERT, CUSTOM_JDBC_CERT_STRING, SKIP_CUSTOM_JDBC_CERT_VALIDATION. These parameters are used to configure SSL with JDBC.

      SALESFORCE connections require the AuthenticationConfiguration member to be configured.

      • (string) –

        • (string) –

    • AuthenticationConfiguration (dict) –

      A structure containing the authentication configuration in the TestConnection request. Required for a connection to Salesforce using OAuth authentication.

      • AuthenticationType (string) –

        A structure containing the authentication configuration in the CreateConnection request.

      • OAuth2Properties (dict) –

        The properties for OAuth2 authentication in the CreateConnection request.

        • OAuth2GrantType (string) –

          The OAuth2 grant type in the CreateConnection request. For example, AUTHORIZATION_CODE, JWT_BEARER, or CLIENT_CREDENTIALS.

        • OAuth2ClientApplication (dict) –

          The client application type in the CreateConnection request. For example, AWS_MANAGED or USER_MANAGED.

          • UserManagedClientApplicationClientId (string) –

            The client application clientID if the ClientAppType is USER_MANAGED.

          • AWSManagedClientApplicationReference (string) –

            The reference to the SaaS-side client app that is Amazon Web Services managed.

        • TokenUrl (string) –

          The URL of the provider’s authentication server, to exchange an authorization code for an access token.

        • TokenUrlParametersMap (dict) –

          A map of parameters that are added to the token GET request.

          • (string) –

            • (string) –

        • AuthorizationCodeProperties (dict) –

          The set of properties required for the the OAuth2 AUTHORIZATION_CODE grant type.

          • AuthorizationCode (string) –

            An authorization code to be used in the third leg of the AUTHORIZATION_CODE grant workflow. This is a single-use code which becomes invalid once exchanged for an access token, thus it is acceptable to have this value as a request parameter.

          • RedirectUri (string) –

            The redirect URI where the user gets redirected to by authorization server when issuing an authorization code. The URI is subsequently used when the authorization code is exchanged for an access token.

        • OAuth2Credentials (dict) –

          The credentials used when the authentication type is OAuth2 authentication.

          • UserManagedClientApplicationClientSecret (string) –

            The client application client secret if the client application is user managed.

          • AccessToken (string) –

            The access token used when the authentication type is OAuth2.

          • RefreshToken (string) –

            The refresh token used when the authentication type is OAuth2.

          • JwtToken (string) –

            The JSON Web Token (JWT) used when the authentication type is OAuth2.

      • SecretArn (string) –

        The secret manager ARN to store credentials in the CreateConnection request.

      • KmsKeyArn (string) –

        The ARN of the KMS key used to encrypt the connection. Only taken an as input in the request and stored in the Secret Manager.

      • BasicAuthenticationCredentials (dict) –

        The credentials used when the authentication type is basic authentication.

        • Username (string) –

          The username to connect to the data source.

        • Password (string) –

          The password to connect to the data source.

      • CustomAuthenticationCredentials (dict) –

        The credentials used when the authentication type is custom authentication.

        • (string) –

          • (string) –

Return type:

dict

Returns:

Response Syntax

{}

Response Structure

  • (dict) –

Exceptions

  • Glue.Client.exceptions.InvalidInputException

  • Glue.Client.exceptions.OperationTimeoutException

  • Glue.Client.exceptions.ResourceNumberLimitExceededException

  • Glue.Client.exceptions.GlueEncryptionException

  • Glue.Client.exceptions.FederationSourceException

  • Glue.Client.exceptions.AccessDeniedException

  • Glue.Client.exceptions.EntityNotFoundException

  • Glue.Client.exceptions.ConflictException

  • Glue.Client.exceptions.InternalServiceException