CreateConnectionCommand

Creates a connection definition in the Data Catalog.

Connections used for creating federated resources require the IAM glue:PassConnection permission.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { GlueClient, CreateConnectionCommand } from "@aws-sdk/client-glue"; // ES Modules import
// const { GlueClient, CreateConnectionCommand } = require("@aws-sdk/client-glue"); // CommonJS import
const client = new GlueClient(config);
const input = { // CreateConnectionRequest
  CatalogId: "STRING_VALUE",
  ConnectionInput: { // ConnectionInput
    Name: "STRING_VALUE", // required
    Description: "STRING_VALUE",
    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", // required
    MatchCriteria: [ // MatchCriteria
      "STRING_VALUE",
    ],
    ConnectionProperties: { // ConnectionProperties // required
      "<keys>": "STRING_VALUE",
    },
    SparkProperties: { // PropertyMap
      "<keys>": "STRING_VALUE",
    },
    AthenaProperties: {
      "<keys>": "STRING_VALUE",
    },
    PythonProperties: {
      "<keys>": "STRING_VALUE",
    },
    PhysicalConnectionRequirements: { // PhysicalConnectionRequirements
      SubnetId: "STRING_VALUE",
      SecurityGroupIdList: [ // SecurityGroupIdList
        "STRING_VALUE",
      ],
      AvailabilityZone: "STRING_VALUE",
    },
    AuthenticationConfiguration: { // AuthenticationConfigurationInput
      AuthenticationType: "BASIC" || "OAUTH2" || "CUSTOM" || "IAM",
      OAuth2Properties: { // OAuth2PropertiesInput
        OAuth2GrantType: "AUTHORIZATION_CODE" || "CLIENT_CREDENTIALS" || "JWT_BEARER",
        OAuth2ClientApplication: { // OAuth2ClientApplication
          UserManagedClientApplicationClientId: "STRING_VALUE",
          AWSManagedClientApplicationReference: "STRING_VALUE",
        },
        TokenUrl: "STRING_VALUE",
        TokenUrlParametersMap: { // TokenUrlParametersMap
          "<keys>": "STRING_VALUE",
        },
        AuthorizationCodeProperties: { // AuthorizationCodeProperties
          AuthorizationCode: "STRING_VALUE",
          RedirectUri: "STRING_VALUE",
        },
        OAuth2Credentials: { // OAuth2Credentials
          UserManagedClientApplicationClientSecret: "STRING_VALUE",
          AccessToken: "STRING_VALUE",
          RefreshToken: "STRING_VALUE",
          JwtToken: "STRING_VALUE",
        },
      },
      SecretArn: "STRING_VALUE",
      KmsKeyArn: "STRING_VALUE",
      BasicAuthenticationCredentials: { // BasicAuthenticationCredentials
        Username: "STRING_VALUE",
        Password: "STRING_VALUE",
      },
      CustomAuthenticationCredentials: { // CredentialMap
        "<keys>": "STRING_VALUE",
      },
    },
    ValidateCredentials: true || false,
    ValidateForComputeEnvironments: [ // ComputeEnvironmentList
      "SPARK" || "ATHENA" || "PYTHON",
    ],
  },
  Tags: { // TagsMap
    "<keys>": "STRING_VALUE",
  },
};
const command = new CreateConnectionCommand(input);
const response = await client.send(command);
// { // CreateConnectionResponse
//   CreateConnectionStatus: "READY" || "IN_PROGRESS" || "FAILED",
// };

CreateConnectionCommand Input

See CreateConnectionCommandInput for more details

Parameter
Type
Description
ConnectionInput
Required
ConnectionInput | undefined

A ConnectionInput object defining the connection to create.

CatalogId
string | undefined

The ID of the Data Catalog in which to create the connection. If none is provided, the Amazon Web Services account ID is used by default.

Tags
Record<string, string> | undefined

The tags you assign to the connection.

CreateConnectionCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
CreateConnectionStatus
ConnectionStatus | undefined

The status of the connection creation request. The request can take some time for certain authentication types, for example when creating an OAuth connection with token exchange over VPC.

Throws

Name
Fault
Details
AlreadyExistsException
client

A resource to be created or added already exists.

GlueEncryptionException
client

An encryption operation failed.

InvalidInputException
client

The input provided was not valid.

OperationTimeoutException
client

The operation timed out.

ResourceNumberLimitExceededException
client

A resource numerical limit was exceeded.

GlueServiceException
Base exception class for all service exceptions from Glue service.