Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/@aws-cdk/aws-glue-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,16 @@ new glue.Connection(this, "RdsConnection", {
});
```

If you need to use a connection type that doesn't exist as a static member on `ConnectionType`, you can instantiate a `ConnectionType` object, e.g: `new glue.ConnectionType('NEW_TYPE')`.
For Snowflake `Connection`, you can use the `SNOWFLAKE` connection type:

```ts
new glue.Connection(this, 'SnowflakeConnection', {
type: glue.ConnectionType.SNOWFLAKE,
connectionName: 'snowflake-connection',
});
```

If you need to use a connection type that doesn't exist as a static member on `ConnectionType`, you can instantiate a `ConnectionType` object, e.g: `new glue.ConnectionType('NEW_TYPE')`.**

See [Adding a Connection to Your Data Store](https://docs.aws.amazon.com/glue/latest/dg/populate-add-connection.html) and [Connection Structure](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-connections.html#aws-glue-api-catalog-connections-Connection) documentation for more information on the supported data stores and their configurations.

Expand Down
5 changes: 5 additions & 0 deletions packages/@aws-cdk/aws-glue-alpha/lib/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ export class ConnectionType {
*/
public static readonly DYNAMODB = new ConnectionType('DYNAMODB');

/**
* Designates a connection to Snowflake.
*/
public static readonly SNOWFLAKE = new ConnectionType('SNOWFLAKE');

/**
* The name of this ConnectionType, as expected by Connection resource.
*/
Expand Down
15 changes: 15 additions & 0 deletions packages/@aws-cdk/aws-glue-alpha/test/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,18 @@ test('fromConnectionArn', () => {
expect(connection.connectionName).toEqual('name');
expect(connection.connectionArn).toEqual(connectionArn);
});

test('SNOWFLAKE connection type', () => {
const stack = new cdk.Stack();
new glue.Connection(stack, 'Connection', {
connectionName: 'snowflake-connection',
type: glue.ConnectionType.SNOWFLAKE,
});

Template.fromStack(stack).hasResourceProperties('AWS::Glue::Connection', {
ConnectionInput: {
ConnectionType: 'SNOWFLAKE',
Name: 'snowflake-connection',
},
});
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,18 @@
}
}
}
},
"SnowflakeConnectionDC9F05AB": {
"Type": "AWS::Glue::Connection",
"Properties": {
"CatalogId": {
"Ref": "AWS::AccountId"
},
"ConnectionInput": {
"Name": "snowflake-connection",
"ConnectionType": "SNOWFLAKE"
}
}
}
},
"Parameters": {
Expand Down

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions packages/@aws-cdk/aws-glue-alpha/test/integ.connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ new glue.Connection(stack, 'NetworkConnection', {
subnet: vpc.privateSubnets[0],
securityGroups: [sg],
});

// Snowflake connection
new glue.Connection(stack, 'SnowflakeConnection', {
type: glue.ConnectionType.SNOWFLAKE,
connectionName: 'snowflake-connection',
});
Loading