class Connection (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Glue.Alpha.Connection |
Go | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#Connection |
Java | software.amazon.awscdk.services.glue.alpha.Connection |
Python | aws_cdk.aws_glue_alpha.Connection |
TypeScript (source) | @aws-cdk/aws-glue-alpha » Connection |
⚠️ Deprecated: undefined
Implements
IConstruct, IDependable, IResource, IEnvironment, IConnection
An AWS Glue connection to a data source.
Example
import * as cdk from 'aws-cdk-lib';
import * as iam from 'aws-cdk-lib/aws-iam';
declare const stack: cdk.Stack;
declare const role: iam.IRole;
declare const script: glue.Code;
new glue.PySparkEtlJob(stack, 'PySparkETLJob', {
jobName: 'PySparkETLJobCustomName',
description: 'This is a description',
role,
script,
glueVersion: glue.GlueVersion.V5_1,
continuousLogging: { enabled: false },
workerConfiguration: {
workerType: glue.WorkerType.G_2X,
numberOfWorkers: 2,
},
maxConcurrentRuns: 100,
timeout: cdk.Duration.hours(2),
connections: [glue.Connection.fromConnectionName(stack, 'Connection', 'connectionName')],
securityConfiguration: glue.SecurityConfiguration.fromSecurityConfigurationName(stack, 'SecurityConfig', 'securityConfigName'),
tags: {
FirstTagName: 'FirstTagValue',
SecondTagName: 'SecondTagValue',
XTagName: 'XTagValue',
},
maxRetries: 2,
});
Initializer
new Connection(scope: Construct, id: string, props: ConnectionProps)
⚠️ Deprecated: undefined
Parameters
- scope
Construct - id
string - props
ConnectionProps
Construct Props
| Name | Type | Description |
|---|---|---|
| type | Connection | The type of the connection. |
| connection | string | The name of the connection. |
| description? | string | The description of the connection. |
| match | string[] | A list of criteria that can be used in selecting this connection. |
| network? | Connection | 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. |
| properties? | { [string]: string } | Key-Value pairs that define parameters for the connection. |
| secret? | ISecret | A reference to a Secrets Manager secret holding the credentials for this connection. |
| security | ISecurity[] | The list of security groups needed to successfully make this connection e.g. to successfully connect to VPC. |
type
⚠️ Deprecated: undefined
Type:
Connection
The type of the connection.
connectionName?
⚠️ Deprecated: undefined
Type:
string
(optional, default: cloudformation generated name)
The name of the connection.
description?
⚠️ Deprecated: undefined
Type:
string
(optional, default: no description)
The description of the connection.
matchCriteria?
⚠️ Deprecated: undefined
Type:
string[]
(optional, default: no match criteria)
A list of criteria that can be used in selecting this connection.
This is useful for filtering the results of https://awscli.amazonaws.com/v2/documentation/api/latest/reference/glue/get-connections.html
network?
⚠️ Deprecated: undefined
Type:
Connection
(optional, default: no VPC network placement)
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.
Build it with ConnectionNetwork.subnet(subnet) to pin a specific subnet,
or ConnectionNetwork.vpc(vpc, vpcSubnets?) to let the CDK select one.
properties?
⚠️ Deprecated: undefined
Type:
{ [string]: string }
(optional, default: empty properties)
Key-Value pairs that define parameters for the connection.
secret?
⚠️ Deprecated: undefined
Type:
ISecret
(optional, default: no secret; any credentials must be supplied via properties)
A reference to a Secrets Manager secret holding the credentials for this connection.
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.
securityGroups?
⚠️ Deprecated: undefined
Type:
ISecurity[]
(optional, default: no security group)
The list of security groups needed to successfully make this connection e.g. to successfully connect to VPC.
Properties
| Name | Type | Description |
|---|---|---|
| connection | string | The ARN of the connection. |
| connection | string | The name of the connection. |
| env | Resource | The environment this resource belongs to. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
connectionArn
⚠️ Deprecated: undefined
Type:
string
The ARN of the connection.
connectionName
⚠️ Deprecated: undefined
Type:
string
The name of the connection.
env
⚠️ Deprecated: undefined
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
node
⚠️ Deprecated: undefined
Type:
Node
The tree node.
stack
⚠️ Deprecated: undefined
Type:
Stack
The stack in which this resource is defined.
static PROPERTY_INJECTION_ID
⚠️ Deprecated: undefined
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| add | Add additional connection parameters. |
| apply | Override the cross-stack reference strength for this resource. |
| apply | Apply the given removal policy to this resource. |
| to | Returns a string representation of this construct. |
| with(...mixins) | Applies one or more mixins to this construct. |
| static from | Creates a Connection construct that represents an external connection. |
| static from | Creates a Connection construct that represents an external connection. |
addProperty(key, value)
public addProperty(key: string, value: string): void
⚠️ Deprecated: undefined
Parameters
- key
string— parameter key. - value
string— parameter value.
Add additional connection parameters.
applyCrossStackReferenceStrength(strength)
public applyCrossStackReferenceStrength(strength: ReferenceStrength): void
⚠️ Deprecated: undefined
Parameters
- strength
Reference— - The reference strength to use for this resource.Strength
Override the cross-stack reference strength for this resource.
When set, any cross-stack reference to this resource will use the specified
mechanism instead of the global default determined by the
@aws-cdk/core:defaultCrossStackReferences context key. This is useful for
selectively weakening specific references to avoid the "deadly embrace" problem
without changing the app-wide default.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
⚠️ Deprecated: undefined
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
toString()
public toString(): string
⚠️ Deprecated: undefined
Returns
string
Returns a string representation of this construct.
with(...mixins)
public with(...mixins: IMixin[]): IConstruct
⚠️ Deprecated: undefined
Parameters
- mixins
IMixin
Returns
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
static fromConnectionArn(scope, id, connectionArn)
public static fromConnectionArn(scope: Construct, id: string, connectionArn: string): IConnection
⚠️ Deprecated: undefined
Parameters
- scope
Construct— The scope creating construct (usuallythis). - id
string— The construct's id. - connectionArn
string— arn of external connection.
Returns
Creates a Connection construct that represents an external connection.
static fromConnectionName(scope, id, connectionName)
public static fromConnectionName(scope: Construct, id: string, connectionName: string): IConnection
⚠️ Deprecated: undefined
Parameters
- scope
Construct— The scope creating construct (usuallythis). - id
string— The construct's id. - connectionName
string— name of external connection.
Returns
Creates a Connection construct that represents an external connection.

.NET
Go
Java
Python
TypeScript (