-
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(glue): add Job L2 construct #11128
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
The only required parameter is `script` which defines the relative path to your Python or Scala file. A `CustomResource` pushes your script to S3 and configures the `Job` with necessary permissions and the final location of the script. | ||
|
||
```ts | ||
new glue.Job(stack, 'MyJob', { | ||
script: './lib/scripts/etlJob.py' | ||
}); | ||
``` | ||
|
||
By default, an S3 bucket will be created to store the provided script but you can manually pass the `bucket` and `s3Prefix`: | ||
|
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 feel like it is more natural to use the s3-assets module here. This would work similar to how Lambda deals with assets.
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.
@adamelmore I agree with @tdikland that we should just use the regular asset mechanism.
Regarding the API, I want to provide something similar to what we have in Lambda
and CloudWatch Synthetics
, which also accept code from the user.
new glue.Job(this, 'Job', {
code: glue.Code.fromAsset(...) // glue.Code.fromInline(...)
});
Is it even possible to use a directory or does it have to be a single script file?
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.
This all sounds good to me. And pretty certain only a single script is allowed.
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.
In that case the api shouldn't Code.fromAsset
but rather Code.fromScript
or Code.fromFile
@iliapolo have a chance to look at this? |
@adamelmore sorry its taking a while. I'll try to have a look by EOW. thanks for this! |
This PR has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Dont close |
@adamelmore What do you think about closing this in favor of #12506 ? Would love your input their as well. |
Absolutely. I never did make time to work on an implementation, here. I do use my own Job construct, and have some opinions around the API, so I'll try to review that PR as I have time! |
Closing in favor of #12506 |
@iliapolo looking to start a conversation here around a
Job
L2 construct inaws-glue
. I'm using my ownJob
,Crawler
andTrigger
constructs, and I think they could be useful here. Starting withJob
, there's the need to push a local script to S3; sort of a lite version of Lambda bundling.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license