UNPKG

@pulumi/aws

Version:

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

414 lines • 12.2 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.getScriptOutput = exports.getScript = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Use this data source to generate a Glue script from a Directed Acyclic Graph (DAG). * * ## Example Usage * * ### Generate Python Script * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.glue.getScript({ * language: "PYTHON", * dagEdges: [ * { * source: "datasource0", * target: "applymapping1", * }, * { * source: "applymapping1", * target: "selectfields2", * }, * { * source: "selectfields2", * target: "resolvechoice3", * }, * { * source: "resolvechoice3", * target: "datasink4", * }, * ], * dagNodes: [ * { * id: "datasource0", * nodeType: "DataSource", * args: [ * { * name: "database", * value: `"${source.name}"`, * }, * { * name: "table_name", * value: `"${sourceAwsGlueCatalogTable.name}"`, * }, * ], * }, * { * id: "applymapping1", * nodeType: "ApplyMapping", * args: [{ * name: "mapping", * value: "[(\"column1\", \"string\", \"column1\", \"string\")]", * }], * }, * { * id: "selectfields2", * nodeType: "SelectFields", * args: [{ * name: "paths", * value: "[\"column1\"]", * }], * }, * { * id: "resolvechoice3", * nodeType: "ResolveChoice", * args: [ * { * name: "choice", * value: "\"MATCH_CATALOG\"", * }, * { * name: "database", * value: `"${destination.name}"`, * }, * { * name: "table_name", * value: `"${destinationAwsGlueCatalogTable.name}"`, * }, * ], * }, * { * id: "datasink4", * nodeType: "DataSink", * args: [ * { * name: "database", * value: `"${destination.name}"`, * }, * { * name: "table_name", * value: `"${destinationAwsGlueCatalogTable.name}"`, * }, * ], * }, * ], * }); * export const pythonScript = example.then(example => example.pythonScript); * ``` * * ### Generate Scala Code * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.glue.getScript({ * language: "SCALA", * dagEdges: [ * { * source: "datasource0", * target: "applymapping1", * }, * { * source: "applymapping1", * target: "selectfields2", * }, * { * source: "selectfields2", * target: "resolvechoice3", * }, * { * source: "resolvechoice3", * target: "datasink4", * }, * ], * dagNodes: [ * { * id: "datasource0", * nodeType: "DataSource", * args: [ * { * name: "database", * value: `"${source.name}"`, * }, * { * name: "table_name", * value: `"${sourceAwsGlueCatalogTable.name}"`, * }, * ], * }, * { * id: "applymapping1", * nodeType: "ApplyMapping", * args: [{ * name: "mappings", * value: "[(\"column1\", \"string\", \"column1\", \"string\")]", * }], * }, * { * id: "selectfields2", * nodeType: "SelectFields", * args: [{ * name: "paths", * value: "[\"column1\"]", * }], * }, * { * id: "resolvechoice3", * nodeType: "ResolveChoice", * args: [ * { * name: "choice", * value: "\"MATCH_CATALOG\"", * }, * { * name: "database", * value: `"${destination.name}"`, * }, * { * name: "table_name", * value: `"${destinationAwsGlueCatalogTable.name}"`, * }, * ], * }, * { * id: "datasink4", * nodeType: "DataSink", * args: [ * { * name: "database", * value: `"${destination.name}"`, * }, * { * name: "table_name", * value: `"${destinationAwsGlueCatalogTable.name}"`, * }, * ], * }, * ], * }); * export const scalaCode = example.then(example => example.scalaCode); * ``` */ function getScript(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("aws:glue/getScript:getScript", { "dagEdges": args.dagEdges, "dagNodes": args.dagNodes, "language": args.language, "region": args.region, }, opts); } exports.getScript = getScript; /** * Use this data source to generate a Glue script from a Directed Acyclic Graph (DAG). * * ## Example Usage * * ### Generate Python Script * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.glue.getScript({ * language: "PYTHON", * dagEdges: [ * { * source: "datasource0", * target: "applymapping1", * }, * { * source: "applymapping1", * target: "selectfields2", * }, * { * source: "selectfields2", * target: "resolvechoice3", * }, * { * source: "resolvechoice3", * target: "datasink4", * }, * ], * dagNodes: [ * { * id: "datasource0", * nodeType: "DataSource", * args: [ * { * name: "database", * value: `"${source.name}"`, * }, * { * name: "table_name", * value: `"${sourceAwsGlueCatalogTable.name}"`, * }, * ], * }, * { * id: "applymapping1", * nodeType: "ApplyMapping", * args: [{ * name: "mapping", * value: "[(\"column1\", \"string\", \"column1\", \"string\")]", * }], * }, * { * id: "selectfields2", * nodeType: "SelectFields", * args: [{ * name: "paths", * value: "[\"column1\"]", * }], * }, * { * id: "resolvechoice3", * nodeType: "ResolveChoice", * args: [ * { * name: "choice", * value: "\"MATCH_CATALOG\"", * }, * { * name: "database", * value: `"${destination.name}"`, * }, * { * name: "table_name", * value: `"${destinationAwsGlueCatalogTable.name}"`, * }, * ], * }, * { * id: "datasink4", * nodeType: "DataSink", * args: [ * { * name: "database", * value: `"${destination.name}"`, * }, * { * name: "table_name", * value: `"${destinationAwsGlueCatalogTable.name}"`, * }, * ], * }, * ], * }); * export const pythonScript = example.then(example => example.pythonScript); * ``` * * ### Generate Scala Code * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.glue.getScript({ * language: "SCALA", * dagEdges: [ * { * source: "datasource0", * target: "applymapping1", * }, * { * source: "applymapping1", * target: "selectfields2", * }, * { * source: "selectfields2", * target: "resolvechoice3", * }, * { * source: "resolvechoice3", * target: "datasink4", * }, * ], * dagNodes: [ * { * id: "datasource0", * nodeType: "DataSource", * args: [ * { * name: "database", * value: `"${source.name}"`, * }, * { * name: "table_name", * value: `"${sourceAwsGlueCatalogTable.name}"`, * }, * ], * }, * { * id: "applymapping1", * nodeType: "ApplyMapping", * args: [{ * name: "mappings", * value: "[(\"column1\", \"string\", \"column1\", \"string\")]", * }], * }, * { * id: "selectfields2", * nodeType: "SelectFields", * args: [{ * name: "paths", * value: "[\"column1\"]", * }], * }, * { * id: "resolvechoice3", * nodeType: "ResolveChoice", * args: [ * { * name: "choice", * value: "\"MATCH_CATALOG\"", * }, * { * name: "database", * value: `"${destination.name}"`, * }, * { * name: "table_name", * value: `"${destinationAwsGlueCatalogTable.name}"`, * }, * ], * }, * { * id: "datasink4", * nodeType: "DataSink", * args: [ * { * name: "database", * value: `"${destination.name}"`, * }, * { * name: "table_name", * value: `"${destinationAwsGlueCatalogTable.name}"`, * }, * ], * }, * ], * }); * export const scalaCode = example.then(example => example.scalaCode); * ``` */ function getScriptOutput(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("aws:glue/getScript:getScript", { "dagEdges": args.dagEdges, "dagNodes": args.dagNodes, "language": args.language, "region": args.region, }, opts); } exports.getScriptOutput = getScriptOutput; //# sourceMappingURL=getScript.js.map