UNPKG

@pulumi/aws

Version:

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

238 lines • 9.88 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, Object.assign(Object.assign({}, 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 ? state.arn : undefined; resourceInputs["catalogTargets"] = state ? state.catalogTargets : undefined; resourceInputs["classifiers"] = state ? state.classifiers : undefined; resourceInputs["configuration"] = state ? state.configuration : undefined; resourceInputs["databaseName"] = state ? state.databaseName : undefined; resourceInputs["deltaTargets"] = state ? state.deltaTargets : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["dynamodbTargets"] = state ? state.dynamodbTargets : undefined; resourceInputs["hudiTargets"] = state ? state.hudiTargets : undefined; resourceInputs["icebergTargets"] = state ? state.icebergTargets : undefined; resourceInputs["jdbcTargets"] = state ? state.jdbcTargets : undefined; resourceInputs["lakeFormationConfiguration"] = state ? state.lakeFormationConfiguration : undefined; resourceInputs["lineageConfiguration"] = state ? state.lineageConfiguration : undefined; resourceInputs["mongodbTargets"] = state ? state.mongodbTargets : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["recrawlPolicy"] = state ? state.recrawlPolicy : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["role"] = state ? state.role : undefined; resourceInputs["s3Targets"] = state ? state.s3Targets : undefined; resourceInputs["schedule"] = state ? state.schedule : undefined; resourceInputs["schemaChangePolicy"] = state ? state.schemaChangePolicy : undefined; resourceInputs["securityConfiguration"] = state ? state.securityConfiguration : undefined; resourceInputs["tablePrefix"] = state ? state.tablePrefix : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; } else { const args = argsOrState; if ((!args || args.databaseName === undefined) && !opts.urn) { throw new Error("Missing required property 'databaseName'"); } if ((!args || args.role === undefined) && !opts.urn) { throw new Error("Missing required property 'role'"); } resourceInputs["catalogTargets"] = args ? args.catalogTargets : undefined; resourceInputs["classifiers"] = args ? args.classifiers : undefined; resourceInputs["configuration"] = args ? args.configuration : undefined; resourceInputs["databaseName"] = args ? args.databaseName : undefined; resourceInputs["deltaTargets"] = args ? args.deltaTargets : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["dynamodbTargets"] = args ? args.dynamodbTargets : undefined; resourceInputs["hudiTargets"] = args ? args.hudiTargets : undefined; resourceInputs["icebergTargets"] = args ? args.icebergTargets : undefined; resourceInputs["jdbcTargets"] = args ? args.jdbcTargets : undefined; resourceInputs["lakeFormationConfiguration"] = args ? args.lakeFormationConfiguration : undefined; resourceInputs["lineageConfiguration"] = args ? args.lineageConfiguration : undefined; resourceInputs["mongodbTargets"] = args ? args.mongodbTargets : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["recrawlPolicy"] = args ? args.recrawlPolicy : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["role"] = args ? args.role : undefined; resourceInputs["s3Targets"] = args ? args.s3Targets : undefined; resourceInputs["schedule"] = args ? args.schedule : undefined; resourceInputs["schemaChangePolicy"] = args ? args.schemaChangePolicy : undefined; resourceInputs["securityConfiguration"] = args ? args.securityConfiguration : undefined; resourceInputs["tablePrefix"] = args ? args.tablePrefix : undefined; resourceInputs["tags"] = args ? args.tags : undefined; 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