-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
constructor(scope: Construct, id: string, props: ConnectionProps) { | ||
super(scope, id); | ||
|
||
const subnetId = props.vpcSubnets && props.vpc ? props.vpc.selectSubnets(props.vpcSubnets).subnetIds[0] : undefined; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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;
There was a problem hiding this 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!
connectionProperties: {}, | ||
}); | ||
|
||
expect(stack).toMatch({ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
import * as glue from '../lib'; | ||
import * as ec2 from '@aws-cdk/aws-ec2'; | ||
|
||
export = { |
There was a problem hiding this comment.
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', () => {
// ...
});
});
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! |
BTW, we're investigating why the build fails with
We know it's from the single-value enum, but it shouldn't really be happening. Will update when we know more. |
There was a problem hiding this 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.
Once all the requested changes have been addressed, and the PR is ready for another review, remember to dismiss the review. |
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
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
@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) |
I will check this first thing tomorrow and see if we can get this resolved! |
Hi everyone, |
Still waiting for @wulfmann on this one 🙂 |
* The type of the connection. Currently, only JDBC is supported; | ||
* SFTP is not supported. | ||
*/ | ||
JDBC = 'JDBC', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like there are more types currently supported https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-connection-connectioninput.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Pull request has been modified.
Finally back to wrapping this up. Sorry to everyone waiting on this. |
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 CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this 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)
@wulfmann any updates here? |
I'm closing this one due to inactivity, please comment if you want it re-opened. |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license