Skip to content
v2.278.0

ConnectionOptions Struct ​

Base Connection Options.

Example ​

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

declare const connectionNetwork: glue.ConnectionNetwork;
declare const secretRef: interfaces_secretsmanager.ISecretRef;
declare const securityGroup: ec2.SecurityGroup;
const connectionOptions: glue.ConnectionOptions = {
  connectionName: 'connectionName',
  description: 'description',
  matchCriteria: ['matchCriteria'],
  network: connectionNetwork,
  properties: {
    propertiesKey: 'properties',
  },
  secret: secretRef,
  securityGroups: [securityGroup],
};
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_ec2 as ec2
from aws_cdk import aws_glue as glue
from aws_cdk.interfaces import aws_secretsmanager as interfaces_secretsmanager

# connection_network: glue.ConnectionNetwork
# secret_ref: interfaces_secretsmanager.ISecretRef
# security_group: ec2.SecurityGroup

connection_options = glue.ConnectionOptions(
    connection_name="connectionName",
    description="description",
    match_criteria=["matchCriteria"],
    network=connection_network,
    properties={
        "properties_key": "properties"
    },
    secret=secret_ref,
    security_groups=[security_group]
)
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.ec2.*;
import software.amazon.awscdk.services.glue.*;
import software.amazon.awscdk.interfaces.secretsmanager.*;

ConnectionNetwork connectionNetwork;
ISecretRef secretRef;
SecurityGroup securityGroup;

ConnectionOptions connectionOptions = ConnectionOptions.builder()
        .connectionName("connectionName")
        .description("description")
        .matchCriteria(List.of("matchCriteria"))
        .network(connectionNetwork)
        .properties(Map.of(
                "propertiesKey", "properties"))
        .secret(secretRef)
        .securityGroups(List.of(securityGroup))
        .build();
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.EC2;
using Amazon.CDK.AWS.Glue;
using Amazon.CDK.Interfaces.SecretsManager;

ConnectionNetwork connectionNetwork;
ISecretRef secretRef;
SecurityGroup securityGroup;

var connectionOptions = new ConnectionOptions {
    ConnectionName = "connectionName",
    Description = "description",
    MatchCriteria = new [] { "matchCriteria" },
    Network = connectionNetwork,
    Properties = new Dictionary<string, string> {
        { "propertiesKey", "properties" }
    },
    Secret = secretRef,
    SecurityGroups = new [] { securityGroup }
};
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"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var connectionNetwork ConnectionNetwork
var secretRef ISecretRef
var securityGroup SecurityGroup

connectionOptions := &ConnectionOptions{
	ConnectionName: jsii.String("connectionName"),
	Description: jsii.String("description"),
	MatchCriteria: []*string{
		jsii.String("matchCriteria"),
	},
	Network: connectionNetwork,
	Properties: map[string]*string{
		"propertiesKey": jsii.String("properties"),
	},
	Secret: secretRef,
	SecurityGroups: []ISecurityGroup{
		securityGroup,
	},
}

Properties ​

connectionNameoptionalstringconnection_nameoptionalstrconnectionNameoptionalStringConnectionNameoptionalstringConnectionNameoptional*string #
The name of the connection.

Default: cloudformation generated name

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
The description of the connection.

Default: no description

matchCriteriaoptionalstring[]match_criteriaoptionaltyping.List[str]matchCriteriaoptionalList<String>MatchCriteriaoptionalstring[]MatchCriteriaoptional*[]*string #
A list of criteria that can be used in selecting this connection.

Default: no match criteria

This is useful for filtering the results of https://awscli.amazonaws.com/v2/documentation/api/latest/reference/glue/get-connections.html

networkoptionalConnectionNetworknetworkoptionalConnectionNetworknetworkoptionalConnectionNetworkNetworkoptionalConnectionNetworkNetworkoptionalConnectionNetwork #
The VPC network placement for this connection, so it can reach resources inside a VPC. See more at https://docs.aws.amazon.com/glue/latest/dg/start-connecting.html.

Default: no VPC network placement

Build it with ConnectionNetwork.subnet(subnet) to pin a specific subnet, or ConnectionNetwork.vpc(vpc, vpcSubnets?) to let the CDK select one.

propertiesoptional{ [key: string]: string }propertiesoptionaltyping.Mapping[str, str]propertiesoptionalMap<String, String>PropertiesoptionalIDictionary<string, string>Propertiesoptional*map[string]*string #
Key-Value pairs that define parameters for the connection.

Default: empty properties

secretoptionalISecretRefsecretoptionalISecretRefsecretoptionalISecretRefSecretoptionalISecretRefSecretoptionalISecretRef #
A reference to a Secrets Manager secret holding the credentials for this connection.

Default: no secret; any credentials must be supplied via properties

notes

The secret is referenced through the connection's SECRET_ID property, so Glue reads the credentials at runtime and the secret value never appears in the synthesized template. Prefer this over placing credentials directly in properties. Accepts any secretsmanager.ISecret.

securityGroupsoptionalISecurityGroup[]security_groupsoptionaltyping.List[ISecurityGroup]securityGroupsoptionalList<ISecurityGroup>SecurityGroupsoptionalISecurityGroup[]SecurityGroupsoptional*[]ISecurityGroup #
The list of security groups needed to successfully make this connection e.g. to successfully connect to VPC.

Default: no security group