UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

238 lines • 8.94 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Crawler = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a Glue Crawler. More information can be found in the [AWS Glue Developer Guide](https://docs.aws.amazon.com/glue/latest/dg/add-crawler.html) * * ## Example Usage * * ### DynamoDB Target Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.Crawler("example", { * databaseName: exampleAwsGlueCatalogDatabase.name, * name: "example", * role: exampleAwsIamRole.arn, * dynamodbTargets: [{ * path: "table-name", * }], * }); * ``` * * ### JDBC Target Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.Crawler("example", { * databaseName: exampleAwsGlueCatalogDatabase.name, * name: "example", * role: exampleAwsIamRole.arn, * jdbcTargets: [{ * connectionName: exampleAwsGlueConnection.name, * path: "database-name/%", * }], * }); * ``` * * ### S3 Target Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.Crawler("example", { * databaseName: exampleAwsGlueCatalogDatabase.name, * name: "example", * role: exampleAwsIamRole.arn, * s3Targets: [{ * path: `s3://${exampleAwsS3Bucket.bucket}`, * }], * }); * ``` * * ### Catalog Target Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.Crawler("example", { * databaseName: exampleAwsGlueCatalogDatabase.name, * name: "example", * role: exampleAwsIamRole.arn, * catalogTargets: [{ * databaseName: exampleAwsGlueCatalogDatabase.name, * tables: [exampleAwsGlueCatalogTable.name], * }], * schemaChangePolicy: { * deleteBehavior: "LOG", * }, * configuration: `{ * "Version":1.0, * "Grouping": { * "TableGroupingPolicy": "CombineCompatibleSchemas" * } * } * `, * }); * ``` * * ### MongoDB Target Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.Crawler("example", { * databaseName: exampleAwsGlueCatalogDatabase.name, * name: "example", * role: exampleAwsIamRole.arn, * mongodbTargets: [{ * connectionName: exampleAwsGlueConnection.name, * path: "database-name/%", * }], * }); * ``` * * ### Configuration Settings Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const eventsCrawler = new aws.glue.Crawler("events_crawler", { * databaseName: glueDatabase.name, * schedule: "cron(0 1 * * ? *)", * name: `events_crawler_${environmentName}`, * role: glueRole.arn, * tags: tags, * configuration: JSON.stringify({ * Grouping: { * TableGroupingPolicy: "CombineCompatibleSchemas", * }, * CrawlerOutput: { * Partitions: { * AddOrUpdateBehavior: "InheritFromTable", * }, * }, * Version: 1, * }), * s3Targets: [{ * path: `s3://${dataLakeBucket.bucket}`, * }], * }); * ``` * * ## Import * * Using `pulumi import`, import Glue Crawlers using `name`. For example: * * ```sh * $ pulumi import aws:glue/crawler:Crawler MyJob MyJob * ``` */ class Crawler extends pulumi.CustomResource { /** * Get an existing Crawler resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new Crawler(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Crawler. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Crawler.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["catalogTargets"] = state?.catalogTargets; resourceInputs["classifiers"] = state?.classifiers; resourceInputs["configuration"] = state?.configuration; resourceInputs["databaseName"] = state?.databaseName; resourceInputs["deltaTargets"] = state?.deltaTargets; resourceInputs["description"] = state?.description; resourceInputs["dynamodbTargets"] = state?.dynamodbTargets; resourceInputs["hudiTargets"] = state?.hudiTargets; resourceInputs["icebergTargets"] = state?.icebergTargets; resourceInputs["jdbcTargets"] = state?.jdbcTargets; resourceInputs["lakeFormationConfiguration"] = state?.lakeFormationConfiguration; resourceInputs["lineageConfiguration"] = state?.lineageConfiguration; resourceInputs["mongodbTargets"] = state?.mongodbTargets; resourceInputs["name"] = state?.name; resourceInputs["recrawlPolicy"] = state?.recrawlPolicy; resourceInputs["region"] = state?.region; resourceInputs["role"] = state?.role; resourceInputs["s3Targets"] = state?.s3Targets; resourceInputs["schedule"] = state?.schedule; resourceInputs["schemaChangePolicy"] = state?.schemaChangePolicy; resourceInputs["securityConfiguration"] = state?.securityConfiguration; resourceInputs["tablePrefix"] = state?.tablePrefix; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.databaseName === undefined && !opts.urn) { throw new Error("Missing required property 'databaseName'"); } if (args?.role === undefined && !opts.urn) { throw new Error("Missing required property 'role'"); } resourceInputs["catalogTargets"] = args?.catalogTargets; resourceInputs["classifiers"] = args?.classifiers; resourceInputs["configuration"] = args?.configuration; resourceInputs["databaseName"] = args?.databaseName; resourceInputs["deltaTargets"] = args?.deltaTargets; resourceInputs["description"] = args?.description; resourceInputs["dynamodbTargets"] = args?.dynamodbTargets; resourceInputs["hudiTargets"] = args?.hudiTargets; resourceInputs["icebergTargets"] = args?.icebergTargets; resourceInputs["jdbcTargets"] = args?.jdbcTargets; resourceInputs["lakeFormationConfiguration"] = args?.lakeFormationConfiguration; resourceInputs["lineageConfiguration"] = args?.lineageConfiguration; resourceInputs["mongodbTargets"] = args?.mongodbTargets; resourceInputs["name"] = args?.name; resourceInputs["recrawlPolicy"] = args?.recrawlPolicy; resourceInputs["region"] = args?.region; resourceInputs["role"] = args?.role; resourceInputs["s3Targets"] = args?.s3Targets; resourceInputs["schedule"] = args?.schedule; resourceInputs["schemaChangePolicy"] = args?.schemaChangePolicy; resourceInputs["securityConfiguration"] = args?.securityConfiguration; resourceInputs["tablePrefix"] = args?.tablePrefix; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Crawler.__pulumiType, name, resourceInputs, opts); } } exports.Crawler = Crawler; /** @internal */ Crawler.__pulumiType = 'aws:glue/crawler:Crawler'; //# sourceMappingURL=crawler.js.map