1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package glue
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/glue/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// Creates a new development endpoint.
16func (c *Client) CreateDevEndpoint(ctx context.Context, params *CreateDevEndpointInput, optFns ...func(*Options)) (*CreateDevEndpointOutput, error) {
17	if params == nil {
18		params = &CreateDevEndpointInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "CreateDevEndpoint", params, optFns, addOperationCreateDevEndpointMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*CreateDevEndpointOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31type CreateDevEndpointInput struct {
32
33	// The name to be assigned to the new DevEndpoint.
34	//
35	// This member is required.
36	EndpointName *string
37
38	// The IAM role for the DevEndpoint.
39	//
40	// This member is required.
41	RoleArn *string
42
43	// A map of arguments used to configure the DevEndpoint.
44	Arguments map[string]string
45
46	// The path to one or more Java .jar files in an S3 bucket that should be loaded in
47	// your DevEndpoint.
48	ExtraJarsS3Path *string
49
50	// The paths to one or more Python libraries in an Amazon S3 bucket that should be
51	// loaded in your DevEndpoint. Multiple values must be complete paths separated by
52	// a comma. You can only use pure Python libraries with a DevEndpoint. Libraries
53	// that rely on C extensions, such as the pandas (http://pandas.pydata.org/) Python
54	// data analysis library, are not yet supported.
55	ExtraPythonLibsS3Path *string
56
57	// Glue version determines the versions of Apache Spark and Python that AWS Glue
58	// supports. The Python version indicates the version supported for running your
59	// ETL scripts on development endpoints. For more information about the available
60	// AWS Glue versions and corresponding Spark and Python versions, see Glue version
61	// (https://docs.aws.amazon.com/glue/latest/dg/add-job.html) in the developer
62	// guide. Development endpoints that are created without specifying a Glue version
63	// default to Glue 0.9. You can specify a version of Python support for development
64	// endpoints by using the Arguments parameter in the CreateDevEndpoint or
65	// UpdateDevEndpoint APIs. If no arguments are provided, the version defaults to
66	// Python 2.
67	GlueVersion *string
68
69	// The number of AWS Glue Data Processing Units (DPUs) to allocate to this
70	// DevEndpoint.
71	NumberOfNodes int32
72
73	// The number of workers of a defined workerType that are allocated to the
74	// development endpoint. The maximum number of workers you can define are 299 for
75	// G.1X, and 149 for G.2X.
76	NumberOfWorkers *int32
77
78	// The public key to be used by this DevEndpoint for authentication. This attribute
79	// is provided for backward compatibility because the recommended attribute to use
80	// is public keys.
81	PublicKey *string
82
83	// A list of public keys to be used by the development endpoints for
84	// authentication. The use of this attribute is preferred over a single public key
85	// because the public keys allow you to have a different private key per client. If
86	// you previously created an endpoint with a public key, you must remove that key
87	// to be able to set a list of public keys. Call the UpdateDevEndpoint API with the
88	// public key content in the deletePublicKeys attribute, and the list of new keys
89	// in the addPublicKeys attribute.
90	PublicKeys []string
91
92	// The name of the SecurityConfiguration structure to be used with this
93	// DevEndpoint.
94	SecurityConfiguration *string
95
96	// Security group IDs for the security groups to be used by the new DevEndpoint.
97	SecurityGroupIds []string
98
99	// The subnet ID for the new DevEndpoint to use.
100	SubnetId *string
101
102	// The tags to use with this DevEndpoint. You may use tags to limit access to the
103	// DevEndpoint. For more information about tags in AWS Glue, see AWS Tags in AWS
104	// Glue (https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html) in the
105	// developer guide.
106	Tags map[string]string
107
108	// The type of predefined worker that is allocated to the development endpoint.
109	// Accepts a value of Standard, G.1X, or G.2X.
110	//
111	// * For the Standard worker type,
112	// each worker provides 4 vCPU, 16 GB of memory and a 50GB disk, and 2 executors
113	// per worker.
114	//
115	// * For the G.1X worker type, each worker maps to 1 DPU (4 vCPU, 16
116	// GB of memory, 64 GB disk), and provides 1 executor per worker. We recommend this
117	// worker type for memory-intensive jobs.
118	//
119	// * For the G.2X worker type, each worker
120	// maps to 2 DPU (8 vCPU, 32 GB of memory, 128 GB disk), and provides 1 executor
121	// per worker. We recommend this worker type for memory-intensive jobs.
122	//
123	// Known
124	// issue: when a development endpoint is created with the G.2XWorkerType
125	// configuration, the Spark drivers for the development endpoint will run on 4
126	// vCPU, 16 GB of memory, and a 64 GB disk.
127	WorkerType types.WorkerType
128}
129
130type CreateDevEndpointOutput struct {
131
132	// The map of arguments used to configure this DevEndpoint. Valid arguments are:
133	//
134	// *
135	// "--enable-glue-datacatalog": ""
136	//
137	// * "GLUE_PYTHON_VERSION": "3"
138	//
139	// *
140	// "GLUE_PYTHON_VERSION": "2"
141	//
142	// You can specify a version of Python support for
143	// development endpoints by using the Arguments parameter in the CreateDevEndpoint
144	// or UpdateDevEndpoint APIs. If no arguments are provided, the version defaults to
145	// Python 2.
146	Arguments map[string]string
147
148	// The AWS Availability Zone where this DevEndpoint is located.
149	AvailabilityZone *string
150
151	// The point in time at which this DevEndpoint was created.
152	CreatedTimestamp *time.Time
153
154	// The name assigned to the new DevEndpoint.
155	EndpointName *string
156
157	// Path to one or more Java .jar files in an S3 bucket that will be loaded in your
158	// DevEndpoint.
159	ExtraJarsS3Path *string
160
161	// The paths to one or more Python libraries in an S3 bucket that will be loaded in
162	// your DevEndpoint.
163	ExtraPythonLibsS3Path *string
164
165	// The reason for a current failure in this DevEndpoint.
166	FailureReason *string
167
168	// Glue version determines the versions of Apache Spark and Python that AWS Glue
169	// supports. The Python version indicates the version supported for running your
170	// ETL scripts on development endpoints.
171	GlueVersion *string
172
173	// The number of AWS Glue Data Processing Units (DPUs) allocated to this
174	// DevEndpoint.
175	NumberOfNodes int32
176
177	// The number of workers of a defined workerType that are allocated to the
178	// development endpoint.
179	NumberOfWorkers *int32
180
181	// The Amazon Resource Name (ARN) of the role assigned to the new DevEndpoint.
182	RoleArn *string
183
184	// The name of the SecurityConfiguration structure being used with this
185	// DevEndpoint.
186	SecurityConfiguration *string
187
188	// The security groups assigned to the new DevEndpoint.
189	SecurityGroupIds []string
190
191	// The current status of the new DevEndpoint.
192	Status *string
193
194	// The subnet ID assigned to the new DevEndpoint.
195	SubnetId *string
196
197	// The ID of the virtual private cloud (VPC) used by this DevEndpoint.
198	VpcId *string
199
200	// The type of predefined worker that is allocated to the development endpoint. May
201	// be a value of Standard, G.1X, or G.2X.
202	WorkerType types.WorkerType
203
204	// The address of the YARN endpoint used by this DevEndpoint.
205	YarnEndpointAddress *string
206
207	// The Apache Zeppelin port for the remote Apache Spark interpreter.
208	ZeppelinRemoteSparkInterpreterPort int32
209
210	// Metadata pertaining to the operation's result.
211	ResultMetadata middleware.Metadata
212}
213
214func addOperationCreateDevEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) {
215	err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDevEndpoint{}, middleware.After)
216	if err != nil {
217		return err
218	}
219	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDevEndpoint{}, middleware.After)
220	if err != nil {
221		return err
222	}
223	if err = addSetLoggerMiddleware(stack, options); err != nil {
224		return err
225	}
226	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
227		return err
228	}
229	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
230		return err
231	}
232	if err = addResolveEndpointMiddleware(stack, options); err != nil {
233		return err
234	}
235	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
236		return err
237	}
238	if err = addRetryMiddlewares(stack, options); err != nil {
239		return err
240	}
241	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
242		return err
243	}
244	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
245		return err
246	}
247	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
248		return err
249	}
250	if err = addClientUserAgent(stack); err != nil {
251		return err
252	}
253	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
254		return err
255	}
256	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
257		return err
258	}
259	if err = addOpCreateDevEndpointValidationMiddleware(stack); err != nil {
260		return err
261	}
262	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDevEndpoint(options.Region), middleware.Before); err != nil {
263		return err
264	}
265	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
266		return err
267	}
268	if err = addResponseErrorMiddleware(stack); err != nil {
269		return err
270	}
271	if err = addRequestResponseLogging(stack, options); err != nil {
272		return err
273	}
274	return nil
275}
276
277func newServiceMetadataMiddleware_opCreateDevEndpoint(region string) *awsmiddleware.RegisterServiceMetadata {
278	return &awsmiddleware.RegisterServiceMetadata{
279		Region:        region,
280		ServiceID:     ServiceID,
281		SigningName:   "glue",
282		OperationName: "CreateDevEndpoint",
283	}
284}
285