|
| 1 | +# AWS Glue code examples for the SDK for Swift |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Shows how to use the AWS SDK for Swift to work with AWS Glue. |
| 6 | + |
| 7 | +<!--custom.overview.start--> |
| 8 | +<!--custom.overview.end--> |
| 9 | + |
| 10 | +_AWS Glue is a scalable, serverless data integration service that makes it easy to discover, prepare, and combine data for analytics, machine learning, and application development._ |
| 11 | + |
| 12 | +## ⚠ Important |
| 13 | + |
| 14 | +* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/). |
| 15 | +* Running the tests might result in charges to your AWS account. |
| 16 | +* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege). |
| 17 | +* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services). |
| 18 | + |
| 19 | +<!--custom.important.start--> |
| 20 | +<!--custom.important.end--> |
| 21 | + |
| 22 | +## Code examples |
| 23 | + |
| 24 | +### Prerequisites |
| 25 | + |
| 26 | +For prerequisites, see the [README](../../README.md#Prerequisites) in the `swift` folder. |
| 27 | + |
| 28 | + |
| 29 | +<!--custom.prerequisites.start--> |
| 30 | +<!--custom.prerequisites.end--> |
| 31 | + |
| 32 | +### Basics |
| 33 | + |
| 34 | +Code examples that show you how to perform the essential operations within a service. |
| 35 | + |
| 36 | +- [Learn the basics](scenario/Package.swift) |
| 37 | + |
| 38 | + |
| 39 | +### Single actions |
| 40 | + |
| 41 | +Code excerpts that show you how to call individual service functions. |
| 42 | + |
| 43 | +- [CreateCrawler](scenario/Sources/entry.swift#L134) |
| 44 | +- [CreateJob](scenario/Sources/entry.swift#L275) |
| 45 | +- [DeleteCrawler](scenario/Sources/entry.swift#L178) |
| 46 | +- [DeleteDatabase](scenario/Sources/entry.swift#L463) |
| 47 | +- [DeleteJob](scenario/Sources/entry.swift#L349) |
| 48 | +- [GetCrawler](scenario/Sources/entry.swift#L220) |
| 49 | +- [GetDatabase](scenario/Sources/entry.swift#L399) |
| 50 | +- [GetJobRun](scenario/Sources/entry.swift#L557) |
| 51 | +- [GetTables](scenario/Sources/entry.swift#L422) |
| 52 | +- [ListJobs](scenario/Sources/entry.swift#L312) |
| 53 | +- [StartCrawler](scenario/Sources/entry.swift#L198) |
| 54 | +- [StartJobRun](scenario/Sources/entry.swift#L518) |
| 55 | + |
| 56 | + |
| 57 | +<!--custom.examples.start--> |
| 58 | +<!--custom.examples.end--> |
| 59 | + |
| 60 | +## Run the examples |
| 61 | + |
| 62 | +### Instructions |
| 63 | + |
| 64 | +To build any of these examples from a terminal window, navigate into its |
| 65 | +directory, then use the following command: |
| 66 | + |
| 67 | +``` |
| 68 | +$ swift build |
| 69 | +``` |
| 70 | + |
| 71 | +To build one of these examples in Xcode, navigate to the example's directory |
| 72 | +(such as the `ListUsers` directory, to build that example). Then type `xed.` |
| 73 | +to open the example directory in Xcode. You can then use standard Xcode build |
| 74 | +and run commands. |
| 75 | + |
| 76 | +<!--custom.instructions.start--> |
| 77 | +<!--custom.instructions.end--> |
| 78 | + |
| 79 | + |
| 80 | +#### Learn the basics |
| 81 | + |
| 82 | +This example shows you how to do the following: |
| 83 | + |
| 84 | +- Create a crawler that crawls a public Amazon S3 bucket and generates a database of CSV-formatted metadata. |
| 85 | +- List information about databases and tables in your AWS Glue Data Catalog. |
| 86 | +- Create a job to extract CSV data from the S3 bucket, transform the data, and load JSON-formatted output into another S3 bucket. |
| 87 | +- List information about job runs, view transformed data, and clean up resources. |
| 88 | + |
| 89 | +<!--custom.basic_prereqs.glue_Scenario_GetStartedCrawlersJobs.start--> |
| 90 | +<!--custom.basic_prereqs.glue_Scenario_GetStartedCrawlersJobs.end--> |
| 91 | + |
| 92 | + |
| 93 | +<!--custom.basics.glue_Scenario_GetStartedCrawlersJobs.start--> |
| 94 | +<!--custom.basics.glue_Scenario_GetStartedCrawlersJobs.end--> |
| 95 | + |
| 96 | + |
| 97 | +### Tests |
| 98 | + |
| 99 | +⚠ Running tests might result in charges to your AWS account. |
| 100 | + |
| 101 | + |
| 102 | +To find instructions for running these tests, see the [README](../../README.md#Tests) |
| 103 | +in the `swift` folder. |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | +<!--custom.tests.start--> |
| 108 | +<!--custom.tests.end--> |
| 109 | + |
| 110 | +## Additional resources |
| 111 | + |
| 112 | +- [AWS Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/what-is-glue.html) |
| 113 | +- [AWS Glue API Reference](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api.html) |
| 114 | +- [SDK for Swift AWS Glue reference](https://sdk.amazonaws.com/swift/api/awsglue/latest/documentation/awsglue) |
| 115 | + |
| 116 | +<!--custom.resources.start--> |
| 117 | +<!--custom.resources.end--> |
| 118 | + |
| 119 | +--- |
| 120 | + |
| 121 | +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 122 | + |
| 123 | +SPDX-License-Identifier: Apache-2.0 |
0 commit comments