# CfnConnectionProps

Properties for defining a `CfnConnection`.

Used as props by: [CfnConnection](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.CfnConnection.html)

- Source: Generated at build time
- Type last changed: v2.268.0 · 2 Sep 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_glue as glue } from 'aws-cdk-lib';

declare const athenaProperties: any;
declare const connectionProperties: any;
declare const customAuthenticationCredentials: any;
declare const pythonProperties: any;
declare const sparkProperties: any;
declare const tags: any;
declare const tokenUrlParametersMap: any;
const cfnConnectionProps: glue.CfnConnectionProps = {
  catalogId: 'catalogId',
  connectionInput: {
    connectionType: 'connectionType',

    // the properties below are optional
    athenaProperties: athenaProperties,
    authenticationConfiguration: {
      authenticationType: 'authenticationType',

      // the properties below are optional
      basicAuthenticationCredentials: {
        password: 'password',
        username: 'username',
      },
      customAuthenticationCredentials: customAuthenticationCredentials,
      kmsKeyArn: 'kmsKeyArn',
      oAuth2Properties: {
        authorizationCodeProperties: {
          authorizationCode: 'authorizationCode',
          redirectUri: 'redirectUri',
        },
        oAuth2ClientApplication: {
          awsManagedClientApplicationReference: 'awsManagedClientApplicationReference',
          userManagedClientApplicationClientId: 'userManagedClientApplicationClientId',
        },
        oAuth2Credentials: {
          accessToken: 'accessToken',
          jwtToken: 'jwtToken',
          refreshToken: 'refreshToken',
          userManagedClientApplicationClientSecret: 'userManagedClientApplicationClientSecret',
        },
        oAuth2GrantType: 'oAuth2GrantType',
        tokenUrl: 'tokenUrl',
        tokenUrlParametersMap: tokenUrlParametersMap,
      },
      secretArn: 'secretArn',
    },
    connectionProperties: connectionProperties,
    description: 'description',
    matchCriteria: ['matchCriteria'],
    name: 'name',
    physicalConnectionRequirements: {
      availabilityZone: 'availabilityZone',
      securityGroupIdList: ['securityGroupIdList'],
      subnetId: 'subnetId',
    },
    pythonProperties: pythonProperties,
    sparkProperties: sparkProperties,
    validateCredentials: false,
    validateForComputeEnvironments: ['validateForComputeEnvironments'],
  },

  // the properties below are optional
  tags: tags,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_glue as glue

# athena_properties: Any
# connection_properties: Any
# custom_authentication_credentials: Any
# python_properties: Any
# spark_properties: Any
# tags: Any
# token_url_parameters_map: Any

cfn_connection_props = glue.CfnConnectionProps(
    catalog_id="catalogId",
    connection_input=glue.CfnConnection.ConnectionInputProperty(
        connection_type="connectionType",

        # the properties below are optional
        athena_properties=athena_properties,
        authentication_configuration=glue.CfnConnection.AuthenticationConfigurationProperty(
            authentication_type="authenticationType",

            # the properties below are optional
            basic_authentication_credentials=glue.CfnConnection.BasicAuthenticationCredentialsProperty(
                password="password",
                username="username"
            ),
            custom_authentication_credentials=custom_authentication_credentials,
            kms_key_arn="kmsKeyArn",
            o_auth2_properties=glue.CfnConnection.OAuth2PropertiesProperty(
                authorization_code_properties=glue.CfnConnection.AuthorizationCodePropertiesProperty(
                    authorization_code="authorizationCode",
                    redirect_uri="redirectUri"
                ),
                o_auth2_client_application=glue.CfnConnection.OAuth2ClientApplicationProperty(
                    aws_managed_client_application_reference="awsManagedClientApplicationReference",
                    user_managed_client_application_client_id="userManagedClientApplicationClientId"
                ),
                o_auth2_credentials=glue.CfnConnection.OAuth2CredentialsProperty(
                    access_token="accessToken",
                    jwt_token="jwtToken",
                    refresh_token="refreshToken",
                    user_managed_client_application_client_secret="userManagedClientApplicationClientSecret"
                ),
                o_auth2_grant_type="oAuth2GrantType",
                token_url="tokenUrl",
                token_url_parameters_map=token_url_parameters_map
            ),
            secret_arn="secretArn"
        ),
        connection_properties=connection_properties,
        description="description",
        match_criteria=["matchCriteria"],
        name="name",
        physical_connection_requirements=glue.CfnConnection.PhysicalConnectionRequirementsProperty(
            availability_zone="availabilityZone",
            security_group_id_list=["securityGroupIdList"],
            subnet_id="subnetId"
        ),
        python_properties=python_properties,
        spark_properties=spark_properties,
        validate_credentials=False,
        validate_for_compute_environments=["validateForComputeEnvironments"]
    ),

    # the properties below are optional
    tags=tags
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.glue.*;

Object athenaProperties;
Object connectionProperties;
Object customAuthenticationCredentials;
Object pythonProperties;
Object sparkProperties;
Object tags;
Object tokenUrlParametersMap;

CfnConnectionProps cfnConnectionProps = CfnConnectionProps.builder()
        .catalogId("catalogId")
        .connectionInput(ConnectionInputProperty.builder()
                .connectionType("connectionType")

                // the properties below are optional
                .athenaProperties(athenaProperties)
                .authenticationConfiguration(AuthenticationConfigurationProperty.builder()
                        .authenticationType("authenticationType")

                        // the properties below are optional
                        .basicAuthenticationCredentials(BasicAuthenticationCredentialsProperty.builder()
                                .password("password")
                                .username("username")
                                .build())
                        .customAuthenticationCredentials(customAuthenticationCredentials)
                        .kmsKeyArn("kmsKeyArn")
                        .oAuth2Properties(OAuth2PropertiesProperty.builder()
                                .authorizationCodeProperties(AuthorizationCodePropertiesProperty.builder()
                                        .authorizationCode("authorizationCode")
                                        .redirectUri("redirectUri")
                                        .build())
                                .oAuth2ClientApplication(OAuth2ClientApplicationProperty.builder()
                                        .awsManagedClientApplicationReference("awsManagedClientApplicationReference")
                                        .userManagedClientApplicationClientId("userManagedClientApplicationClientId")
                                        .build())
                                .oAuth2Credentials(OAuth2CredentialsProperty.builder()
                                        .accessToken("accessToken")
                                        .jwtToken("jwtToken")
                                        .refreshToken("refreshToken")
                                        .userManagedClientApplicationClientSecret("userManagedClientApplicationClientSecret")
                                        .build())
                                .oAuth2GrantType("oAuth2GrantType")
                                .tokenUrl("tokenUrl")
                                .tokenUrlParametersMap(tokenUrlParametersMap)
                                .build())
                        .secretArn("secretArn")
                        .build())
                .connectionProperties(connectionProperties)
                .description("description")
                .matchCriteria(List.of("matchCriteria"))
                .name("name")
                .physicalConnectionRequirements(PhysicalConnectionRequirementsProperty.builder()
                        .availabilityZone("availabilityZone")
                        .securityGroupIdList(List.of("securityGroupIdList"))
                        .subnetId("subnetId")
                        .build())
                .pythonProperties(pythonProperties)
                .sparkProperties(sparkProperties)
                .validateCredentials(false)
                .validateForComputeEnvironments(List.of("validateForComputeEnvironments"))
                .build())

        // the properties below are optional
        .tags(tags)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Glue;

var athenaProperties;
var connectionProperties;
var customAuthenticationCredentials;
var pythonProperties;
var sparkProperties;
var tags;
var tokenUrlParametersMap;

var cfnConnectionProps = new CfnConnectionProps {
    CatalogId = "catalogId",
    ConnectionInput = new ConnectionInputProperty {
        ConnectionType = "connectionType",

        // the properties below are optional
        AthenaProperties = athenaProperties,
        AuthenticationConfiguration = new AuthenticationConfigurationProperty {
            AuthenticationType = "authenticationType",

            // the properties below are optional
            BasicAuthenticationCredentials = new BasicAuthenticationCredentialsProperty {
                Password = "password",
                Username = "username"
            },
            CustomAuthenticationCredentials = customAuthenticationCredentials,
            KmsKeyArn = "kmsKeyArn",
            OAuth2Properties = new OAuth2PropertiesProperty {
                AuthorizationCodeProperties = new AuthorizationCodePropertiesProperty {
                    AuthorizationCode = "authorizationCode",
                    RedirectUri = "redirectUri"
                },
                OAuth2ClientApplication = new OAuth2ClientApplicationProperty {
                    AwsManagedClientApplicationReference = "awsManagedClientApplicationReference",
                    UserManagedClientApplicationClientId = "userManagedClientApplicationClientId"
                },
                OAuth2Credentials = new OAuth2CredentialsProperty {
                    AccessToken = "accessToken",
                    JwtToken = "jwtToken",
                    RefreshToken = "refreshToken",
                    UserManagedClientApplicationClientSecret = "userManagedClientApplicationClientSecret"
                },
                OAuth2GrantType = "oAuth2GrantType",
                TokenUrl = "tokenUrl",
                TokenUrlParametersMap = tokenUrlParametersMap
            },
            SecretArn = "secretArn"
        },
        ConnectionProperties = connectionProperties,
        Description = "description",
        MatchCriteria = new [] { "matchCriteria" },
        Name = "name",
        PhysicalConnectionRequirements = new PhysicalConnectionRequirementsProperty {
            AvailabilityZone = "availabilityZone",
            SecurityGroupIdList = new [] { "securityGroupIdList" },
            SubnetId = "subnetId"
        },
        PythonProperties = pythonProperties,
        SparkProperties = sparkProperties,
        ValidateCredentials = false,
        ValidateForComputeEnvironments = new [] { "validateForComputeEnvironments" }
    },

    // the properties below are optional
    Tags = tags
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var athenaProperties interface{}
var connectionProperties interface{}
var customAuthenticationCredentials interface{}
var pythonProperties interface{}
var sparkProperties interface{}
var tags interface{}
var tokenUrlParametersMap interface{}

cfnConnectionProps := &CfnConnectionProps{
	CatalogId: jsii.String("catalogId"),
	ConnectionInput: &ConnectionInputProperty{
		ConnectionType: jsii.String("connectionType"),

		// the properties below are optional
		AthenaProperties: athenaProperties,
		AuthenticationConfiguration: &AuthenticationConfigurationProperty{
			AuthenticationType: jsii.String("authenticationType"),

			// the properties below are optional
			BasicAuthenticationCredentials: &BasicAuthenticationCredentialsProperty{
				Password: jsii.String("password"),
				Username: jsii.String("username"),
			},
			CustomAuthenticationCredentials: customAuthenticationCredentials,
			KmsKeyArn: jsii.String("kmsKeyArn"),
			OAuth2Properties: &OAuth2PropertiesProperty{
				AuthorizationCodeProperties: &AuthorizationCodePropertiesProperty{
					AuthorizationCode: jsii.String("authorizationCode"),
					RedirectUri: jsii.String("redirectUri"),
				},
				OAuth2ClientApplication: &OAuth2ClientApplicationProperty{
					AwsManagedClientApplicationReference: jsii.String("awsManagedClientApplicationReference"),
					UserManagedClientApplicationClientId: jsii.String("userManagedClientApplicationClientId"),
				},
				OAuth2Credentials: &OAuth2CredentialsProperty{
					AccessToken: jsii.String("accessToken"),
					JwtToken: jsii.String("jwtToken"),
					RefreshToken: jsii.String("refreshToken"),
					UserManagedClientApplicationClientSecret: jsii.String("userManagedClientApplicationClientSecret"),
				},
				OAuth2GrantType: jsii.String("oAuth2GrantType"),
				TokenUrl: jsii.String("tokenUrl"),
				TokenUrlParametersMap: tokenUrlParametersMap,
			},
			SecretArn: jsii.String("secretArn"),
		},
		ConnectionProperties: connectionProperties,
		Description: jsii.String("description"),
		MatchCriteria: []*string{
			jsii.String("matchCriteria"),
		},
		Name: jsii.String("name"),
		PhysicalConnectionRequirements: &PhysicalConnectionRequirementsProperty{
			AvailabilityZone: jsii.String("availabilityZone"),
			SecurityGroupIdList: []*string{
				jsii.String("securityGroupIdList"),
			},
			SubnetId: jsii.String("subnetId"),
		},
		PythonProperties: pythonProperties,
		SparkProperties: sparkProperties,
		ValidateCredentials: jsii.Boolean(false),
		ValidateForComputeEnvironments: []*string{
			jsii.String("validateForComputeEnvironments"),
		},
	},

	// the properties below are optional
	Tags: tags,
}
```

## Properties

- `catalogId`: string (required) — The ID of the data catalog to create the catalog object in.

  Currently, this should be the AWS account ID.

  > To specify the account ID, you can use the `Ref` intrinsic function with the `AWS::AccountId` pseudo parameter. For example: `!Ref AWS::AccountId` .

- `connectionInput`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnConnection.ConnectionInputProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.CfnConnection.ConnectionInputProperty.html) (required) — The connection that you want to create.

- `tags`: any — The collection of tags.

  Each tag element is associated with a given resource.
