AWS CloudFormation模板可用于在Amazon Glue中创建多谓词条件的Jupyter Notebook。以下是一个示例模板:
Resources:
Sparkeventsgluecrawler:
Type: AWS::Glue::Crawler
Properties:
Name: "Sparkeventsgluecrawler"
Role: "arn:aws:iam::123456789012:role/service-role/AWSGlueServiceRoleDefault"
Targets:
S3Targets:
- Path: "s3://my-s3-bucket/myfolder/"
SchemaChangePolicy:
UpdateBehavior: UPDATE_IN_DATABASE
DeleteBehavior: DEPRECATE_IN_DATABASE
TablePrefix: "glu"
Classifiers:
- classifier
RootS3Location:
Type: AWS::S3::Bucket
Properties:
BucketName: "my-s3-bucket"
GlueNotebook:
Type: AWS::Glue::DevEndpoint
Properties:
EndpointName: "glue-notebook"
RoleArn: "aws:iam::123456789012:role/myGlueRole"
SecurityGroupIds:
- security-group-id
SubnetId: subnet-id
GlueVersion: "1.0"
NumberOfNodes: 2
PublicKey: "my-public-key"
PublicKeys:
- my-public-key
ExtraPythonLibsS3Path: "s3://my-s3-bucket/myPythonlibs.zip"
GlueNotebookInstanceLifecycleConfig:
Type: "AWS::Glue::NotebookInstanceLifecycleConfig"
Properties:
NotebookInstanceLifecycleConfigs:
- OnCreate:
- Action:
- Name: "jupyter-enterprise-gateway-startup"
Arguments:
- "--GatewayPort=8888"
- "--IP=0.0.0.0"
- "--NotebookPort=8889"
- "--KernelGateway.Enabled=True"
- "--KernelGateway.Port=8889"
- "--KernelGateway.KernelManagerFactory.kernel_spec_manager_class=jupyter_enterprise_gateway.services.kernelspecs.managers.CachingNB2GatewayKernelSpecManagerClass"
Component: "KernelGatewayApp"
GlueNotebookInstance:
Type: "AWS::Glue::NotebookInstance"
Properties:
InstanceType: "ml.t2.medium"
RoleArn: "aws:iam::123456789012:role/service-role/AWSGlueServiceNotebookRole"
LifecycleConfigName: "GlueNotebookInstanceLifecycleConfig"
DirectInternetAccess: "Disabled"
SecurityGroupIds: