Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws-glue): add glue connection L2 Constructs #6948

Closed
wants to merge 18 commits into from

Conversation

wulfmann
Copy link
Contributor


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@wulfmann
Copy link
Contributor Author

@skinny85 this is ready for a review. I made the changes you suggested on #5171

@wulfmann wulfmann changed the title feat(aws-glue): add glue job and connection constructs feat(aws-glue): add glue connection L2 Constructs Mar 23, 2020
constructor(scope: Construct, id: string, props: ConnectionProps) {
super(scope, id);

const subnetId = props.vpcSubnets && props.vpc ? props.vpc.selectSubnets(props.vpcSubnets).subnetIds[0] : undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skinny85 I wasn't entirely sure what you meant on the other PR. Is this what you intended for the subnets? I have the same question for line 106.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be:

const subnetId = props.vpc ? props.vpc.selectSubnets(props.vpcSubnets).subnetIds[0] : undefined;

@skinny85 skinny85 self-assigned this Mar 23, 2020
Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @wulfmann ! I have some comments, but we're getting there!

packages/@aws-cdk/aws-glue/lib/connection.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-glue/lib/connection.ts Show resolved Hide resolved
packages/@aws-cdk/aws-glue/lib/connection.ts Show resolved Hide resolved
packages/@aws-cdk/aws-glue/lib/connection.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-glue/lib/connection.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-glue/lib/connection.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-glue/test/test.connection.ts Outdated Show resolved Hide resolved
connectionProperties: {},
});

expect(stack).toMatch({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want expect(stack).toHaveResourceLike(...).... right now, these tests don't actually verify anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea im still working on tests.

packages/@aws-cdk/aws-glue/test/test.connection.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-glue/lib/connection.ts Outdated Show resolved Hide resolved
@mergify mergify bot dismissed skinny85’s stale review March 24, 2020 13:32

Pull request has been modified.

import * as glue from '../lib';
import * as ec2 from '@aws-cdk/aws-ec2';

export = {
Copy link
Contributor

@skinny85 skinny85 Mar 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhm. Maybe I did a mental shortcut saying "that's all you needed". Jest tests look a tiny bit different than Nodeunit tests. So, this file would be something like:

describe('Glue Connection', () => {
  test('can be created without a VPC', () => {
    // ...
  });

  test('can be created with a VPC', () => {
    // ...
  });
});

@skinny85
Copy link
Contributor

About the Jest tests - my apologies, I forgot this module already has some Nodeunit tests. In this case (because you can't mix Nodeunit and Jest in the same CDK package), just make the new tests in Nodeunit as well.

Apologies for the churn!

@skinny85
Copy link
Contributor

BTW, we're investigating why the build fails with

 error TS0: Exported APIs cannot use un-exported type @aws-cdk/aws-glue.ConnectionInputTypes.JDBC

We know it's from the single-value enum, but it shouldn't really be happening. Will update when we know more.

Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just removing from my to-do list.

@mergify
Copy link
Contributor

mergify bot commented Mar 25, 2020

Once all the requested changes have been addressed, and the PR is ready for another review, remember to dismiss the review.

RomainMuller added a commit to aws/jsii that referenced this pull request Mar 26, 2020
TypeScript represents enums similar to union types, and single-valued
enums are "simplified" to the sole member (the TypeChecker fiercely
refuses to give a handle to the actual `enum` type). This resulted in
`jsii` incorrectly tagging the type at usage sites.

This commit adds the necessary infrastructure to detect single-valued
enums and tweak the FQN generation to obtain the correct result.

A new test was added to validate this whole endeavor works correctly
even when the single-valued enum is within a submodule (which adds even
more complexity to the mix).

References: aws/aws-cdk#6712 aws/aws-cdk#6948
mergify bot pushed a commit to aws/jsii that referenced this pull request Mar 27, 2020
TypeScript represents enums similar to union types, and single-valued
enums are "simplified" to the sole member (the TypeChecker fiercely
refuses to give a handle to the actual `enum` type). This resulted in
`jsii` incorrectly tagging the type at usage sites.

This commit adds the necessary infrastructure to detect single-valued
enums and tweak the FQN generation to obtain the correct result.

A new test was added to validate this whole endeavor works correctly
even when the single-valued enum is within a submodule (which adds even
more complexity to the mix).

References: aws/aws-cdk#6712 aws/aws-cdk#6948
@skinny85
Copy link
Contributor

@wulfmann any updates here? Are you ready for another round of reviews, or still working on it? (The single-value enum thing should be resolved now)

@wulfmann
Copy link
Contributor Author

I will check this first thing tomorrow and see if we can get this resolved!

@humanzz
Copy link
Contributor

humanzz commented Sep 18, 2020

Hi everyone,
Just checking on the status of this as my team is really interested in Job constructs for glue.

@skinny85
Copy link
Contributor

Still waiting for @wulfmann on this one 🙂

* The type of the connection. Currently, only JDBC is supported;
* SFTP is not supported.
*/
JDBC = 'JDBC',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@humanzz
Copy link
Contributor

humanzz commented Sep 22, 2020

@skinny85 Any chance/way to help completing this PR if @wulfmann is not available to wrap it?

@mergify mergify bot dismissed skinny85’s stale review September 29, 2020 00:54

Pull request has been modified.

@wulfmann
Copy link
Contributor Author

Finally back to wrapping this up. Sorry to everyone waiting on this.

@wulfmann
Copy link
Contributor Author

I've updated to the current branch of upstream and cleaned up some of the missing things. I should be able to wrap the tests up tomorrow so we can at least get the L2 connection construct merged.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 45afa5b
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wulfmann let me know when this is ready for review!

(Putting in "Request changes" to remove it from my ToDo list)

@humanzz
Copy link
Contributor

humanzz commented Dec 14, 2020

@wulfmann any updates here?

@skinny85
Copy link
Contributor

I'm closing this one due to inactivity, please comment if you want it re-opened.

@skinny85 skinny85 closed this Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants