1. Packages
  2. AWS Classic
  3. API Docs
  4. glue
  5. getScript

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.glue.getScript

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Use this data source to generate a Glue script from a Directed Acyclic Graph (DAG).

    Example Usage

    Generate Python Script

    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);
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.glue.get_script(language="PYTHON",
        dag_edges=[
            {
                "source": "datasource0",
                "target": "applymapping1",
            },
            {
                "source": "applymapping1",
                "target": "selectfields2",
            },
            {
                "source": "selectfields2",
                "target": "resolvechoice3",
            },
            {
                "source": "resolvechoice3",
                "target": "datasink4",
            },
        ],
        dag_nodes=[
            {
                "id": "datasource0",
                "nodeType": "DataSource",
                "args": [
                    {
                        "name": "database",
                        "value": f"\"{source['name']}\"",
                    },
                    {
                        "name": "table_name",
                        "value": f"\"{source_aws_glue_catalog_table['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": f"\"{destination['name']}\"",
                    },
                    {
                        "name": "table_name",
                        "value": f"\"{destination_aws_glue_catalog_table['name']}\"",
                    },
                ],
            },
            {
                "id": "datasink4",
                "nodeType": "DataSink",
                "args": [
                    {
                        "name": "database",
                        "value": f"\"{destination['name']}\"",
                    },
                    {
                        "name": "table_name",
                        "value": f"\"{destination_aws_glue_catalog_table['name']}\"",
                    },
                ],
            },
        ])
    pulumi.export("pythonScript", example.python_script)
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := glue.GetScript(ctx, &glue.GetScriptArgs{
    			Language: pulumi.StringRef("PYTHON"),
    			DagEdges: []glue.GetScriptDagEdge{
    				{
    					Source: "datasource0",
    					Target: "applymapping1",
    				},
    				{
    					Source: "applymapping1",
    					Target: "selectfields2",
    				},
    				{
    					Source: "selectfields2",
    					Target: "resolvechoice3",
    				},
    				{
    					Source: "resolvechoice3",
    					Target: "datasink4",
    				},
    			},
    			DagNodes: []glue.GetScriptDagNode{
    				{
    					Id:       "datasource0",
    					NodeType: "DataSource",
    					Args: []glue.GetScriptDagNodeArg{
    						{
    							Name:  "database",
    							Value: fmt.Sprintf("\"%v\"", source.Name),
    						},
    						{
    							Name:  "table_name",
    							Value: fmt.Sprintf("\"%v\"", sourceAwsGlueCatalogTable.Name),
    						},
    					},
    				},
    				{
    					Id:       "applymapping1",
    					NodeType: "ApplyMapping",
    					Args: []glue.GetScriptDagNodeArg{
    						{
    							Name:  "mapping",
    							Value: "[(\"column1\", \"string\", \"column1\", \"string\")]",
    						},
    					},
    				},
    				{
    					Id:       "selectfields2",
    					NodeType: "SelectFields",
    					Args: []glue.GetScriptDagNodeArg{
    						{
    							Name:  "paths",
    							Value: "[\"column1\"]",
    						},
    					},
    				},
    				{
    					Id:       "resolvechoice3",
    					NodeType: "ResolveChoice",
    					Args: []glue.GetScriptDagNodeArg{
    						{
    							Name:  "choice",
    							Value: "\"MATCH_CATALOG\"",
    						},
    						{
    							Name:  "database",
    							Value: fmt.Sprintf("\"%v\"", destination.Name),
    						},
    						{
    							Name:  "table_name",
    							Value: fmt.Sprintf("\"%v\"", destinationAwsGlueCatalogTable.Name),
    						},
    					},
    				},
    				{
    					Id:       "datasink4",
    					NodeType: "DataSink",
    					Args: []glue.GetScriptDagNodeArg{
    						{
    							Name:  "database",
    							Value: fmt.Sprintf("\"%v\"", destination.Name),
    						},
    						{
    							Name:  "table_name",
    							Value: fmt.Sprintf("\"%v\"", destinationAwsGlueCatalogTable.Name),
    						},
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("pythonScript", example.PythonScript)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Glue.GetScript.Invoke(new()
        {
            Language = "PYTHON",
            DagEdges = new[]
            {
                new Aws.Glue.Inputs.GetScriptDagEdgeInputArgs
                {
                    Source = "datasource0",
                    Target = "applymapping1",
                },
                new Aws.Glue.Inputs.GetScriptDagEdgeInputArgs
                {
                    Source = "applymapping1",
                    Target = "selectfields2",
                },
                new Aws.Glue.Inputs.GetScriptDagEdgeInputArgs
                {
                    Source = "selectfields2",
                    Target = "resolvechoice3",
                },
                new Aws.Glue.Inputs.GetScriptDagEdgeInputArgs
                {
                    Source = "resolvechoice3",
                    Target = "datasink4",
                },
            },
            DagNodes = new[]
            {
                new Aws.Glue.Inputs.GetScriptDagNodeInputArgs
                {
                    Id = "datasource0",
                    NodeType = "DataSource",
                    Args = new[]
                    {
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "database",
                            Value = $"\"{source.Name}\"",
                        },
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "table_name",
                            Value = $"\"{sourceAwsGlueCatalogTable.Name}\"",
                        },
                    },
                },
                new Aws.Glue.Inputs.GetScriptDagNodeInputArgs
                {
                    Id = "applymapping1",
                    NodeType = "ApplyMapping",
                    Args = new[]
                    {
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "mapping",
                            Value = "[(\"column1\", \"string\", \"column1\", \"string\")]",
                        },
                    },
                },
                new Aws.Glue.Inputs.GetScriptDagNodeInputArgs
                {
                    Id = "selectfields2",
                    NodeType = "SelectFields",
                    Args = new[]
                    {
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "paths",
                            Value = "[\"column1\"]",
                        },
                    },
                },
                new Aws.Glue.Inputs.GetScriptDagNodeInputArgs
                {
                    Id = "resolvechoice3",
                    NodeType = "ResolveChoice",
                    Args = new[]
                    {
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "choice",
                            Value = "\"MATCH_CATALOG\"",
                        },
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "database",
                            Value = $"\"{destination.Name}\"",
                        },
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "table_name",
                            Value = $"\"{destinationAwsGlueCatalogTable.Name}\"",
                        },
                    },
                },
                new Aws.Glue.Inputs.GetScriptDagNodeInputArgs
                {
                    Id = "datasink4",
                    NodeType = "DataSink",
                    Args = new[]
                    {
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "database",
                            Value = $"\"{destination.Name}\"",
                        },
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "table_name",
                            Value = $"\"{destinationAwsGlueCatalogTable.Name}\"",
                        },
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["pythonScript"] = example.Apply(getScriptResult => getScriptResult.PythonScript),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.glue.GlueFunctions;
    import com.pulumi.aws.glue.inputs.GetScriptArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = GlueFunctions.getScript(GetScriptArgs.builder()
                .language("PYTHON")
                .dagEdges(            
                    GetScriptDagEdgeArgs.builder()
                        .source("datasource0")
                        .target("applymapping1")
                        .build(),
                    GetScriptDagEdgeArgs.builder()
                        .source("applymapping1")
                        .target("selectfields2")
                        .build(),
                    GetScriptDagEdgeArgs.builder()
                        .source("selectfields2")
                        .target("resolvechoice3")
                        .build(),
                    GetScriptDagEdgeArgs.builder()
                        .source("resolvechoice3")
                        .target("datasink4")
                        .build())
                .dagNodes(            
                    GetScriptDagNodeArgs.builder()
                        .id("datasource0")
                        .nodeType("DataSource")
                        .args(                    
                            GetScriptDagNodeArgArgs.builder()
                                .name("database")
                                .value(String.format("\"%s\"", source.name()))
                                .build(),
                            GetScriptDagNodeArgArgs.builder()
                                .name("table_name")
                                .value(String.format("\"%s\"", sourceAwsGlueCatalogTable.name()))
                                .build())
                        .build(),
                    GetScriptDagNodeArgs.builder()
                        .id("applymapping1")
                        .nodeType("ApplyMapping")
                        .args(GetScriptDagNodeArgArgs.builder()
                            .name("mapping")
                            .value("[(\"column1\", \"string\", \"column1\", \"string\")]")
                            .build())
                        .build(),
                    GetScriptDagNodeArgs.builder()
                        .id("selectfields2")
                        .nodeType("SelectFields")
                        .args(GetScriptDagNodeArgArgs.builder()
                            .name("paths")
                            .value("[\"column1\"]")
                            .build())
                        .build(),
                    GetScriptDagNodeArgs.builder()
                        .id("resolvechoice3")
                        .nodeType("ResolveChoice")
                        .args(                    
                            GetScriptDagNodeArgArgs.builder()
                                .name("choice")
                                .value("\"MATCH_CATALOG\"")
                                .build(),
                            GetScriptDagNodeArgArgs.builder()
                                .name("database")
                                .value(String.format("\"%s\"", destination.name()))
                                .build(),
                            GetScriptDagNodeArgArgs.builder()
                                .name("table_name")
                                .value(String.format("\"%s\"", destinationAwsGlueCatalogTable.name()))
                                .build())
                        .build(),
                    GetScriptDagNodeArgs.builder()
                        .id("datasink4")
                        .nodeType("DataSink")
                        .args(                    
                            GetScriptDagNodeArgArgs.builder()
                                .name("database")
                                .value(String.format("\"%s\"", destination.name()))
                                .build(),
                            GetScriptDagNodeArgArgs.builder()
                                .name("table_name")
                                .value(String.format("\"%s\"", destinationAwsGlueCatalogTable.name()))
                                .build())
                        .build())
                .build());
    
            ctx.export("pythonScript", example.applyValue(getScriptResult -> getScriptResult.pythonScript()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:glue:getScript
          Arguments:
            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}"'
    outputs:
      pythonScript: ${example.pythonScript}
    

    Generate Scala Code

    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);
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.glue.get_script(language="SCALA",
        dag_edges=[
            {
                "source": "datasource0",
                "target": "applymapping1",
            },
            {
                "source": "applymapping1",
                "target": "selectfields2",
            },
            {
                "source": "selectfields2",
                "target": "resolvechoice3",
            },
            {
                "source": "resolvechoice3",
                "target": "datasink4",
            },
        ],
        dag_nodes=[
            {
                "id": "datasource0",
                "nodeType": "DataSource",
                "args": [
                    {
                        "name": "database",
                        "value": f"\"{source['name']}\"",
                    },
                    {
                        "name": "table_name",
                        "value": f"\"{source_aws_glue_catalog_table['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": f"\"{destination['name']}\"",
                    },
                    {
                        "name": "table_name",
                        "value": f"\"{destination_aws_glue_catalog_table['name']}\"",
                    },
                ],
            },
            {
                "id": "datasink4",
                "nodeType": "DataSink",
                "args": [
                    {
                        "name": "database",
                        "value": f"\"{destination['name']}\"",
                    },
                    {
                        "name": "table_name",
                        "value": f"\"{destination_aws_glue_catalog_table['name']}\"",
                    },
                ],
            },
        ])
    pulumi.export("scalaCode", example.scala_code)
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := glue.GetScript(ctx, &glue.GetScriptArgs{
    			Language: pulumi.StringRef("SCALA"),
    			DagEdges: []glue.GetScriptDagEdge{
    				{
    					Source: "datasource0",
    					Target: "applymapping1",
    				},
    				{
    					Source: "applymapping1",
    					Target: "selectfields2",
    				},
    				{
    					Source: "selectfields2",
    					Target: "resolvechoice3",
    				},
    				{
    					Source: "resolvechoice3",
    					Target: "datasink4",
    				},
    			},
    			DagNodes: []glue.GetScriptDagNode{
    				{
    					Id:       "datasource0",
    					NodeType: "DataSource",
    					Args: []glue.GetScriptDagNodeArg{
    						{
    							Name:  "database",
    							Value: fmt.Sprintf("\"%v\"", source.Name),
    						},
    						{
    							Name:  "table_name",
    							Value: fmt.Sprintf("\"%v\"", sourceAwsGlueCatalogTable.Name),
    						},
    					},
    				},
    				{
    					Id:       "applymapping1",
    					NodeType: "ApplyMapping",
    					Args: []glue.GetScriptDagNodeArg{
    						{
    							Name:  "mappings",
    							Value: "[(\"column1\", \"string\", \"column1\", \"string\")]",
    						},
    					},
    				},
    				{
    					Id:       "selectfields2",
    					NodeType: "SelectFields",
    					Args: []glue.GetScriptDagNodeArg{
    						{
    							Name:  "paths",
    							Value: "[\"column1\"]",
    						},
    					},
    				},
    				{
    					Id:       "resolvechoice3",
    					NodeType: "ResolveChoice",
    					Args: []glue.GetScriptDagNodeArg{
    						{
    							Name:  "choice",
    							Value: "\"MATCH_CATALOG\"",
    						},
    						{
    							Name:  "database",
    							Value: fmt.Sprintf("\"%v\"", destination.Name),
    						},
    						{
    							Name:  "table_name",
    							Value: fmt.Sprintf("\"%v\"", destinationAwsGlueCatalogTable.Name),
    						},
    					},
    				},
    				{
    					Id:       "datasink4",
    					NodeType: "DataSink",
    					Args: []glue.GetScriptDagNodeArg{
    						{
    							Name:  "database",
    							Value: fmt.Sprintf("\"%v\"", destination.Name),
    						},
    						{
    							Name:  "table_name",
    							Value: fmt.Sprintf("\"%v\"", destinationAwsGlueCatalogTable.Name),
    						},
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("scalaCode", example.ScalaCode)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Glue.GetScript.Invoke(new()
        {
            Language = "SCALA",
            DagEdges = new[]
            {
                new Aws.Glue.Inputs.GetScriptDagEdgeInputArgs
                {
                    Source = "datasource0",
                    Target = "applymapping1",
                },
                new Aws.Glue.Inputs.GetScriptDagEdgeInputArgs
                {
                    Source = "applymapping1",
                    Target = "selectfields2",
                },
                new Aws.Glue.Inputs.GetScriptDagEdgeInputArgs
                {
                    Source = "selectfields2",
                    Target = "resolvechoice3",
                },
                new Aws.Glue.Inputs.GetScriptDagEdgeInputArgs
                {
                    Source = "resolvechoice3",
                    Target = "datasink4",
                },
            },
            DagNodes = new[]
            {
                new Aws.Glue.Inputs.GetScriptDagNodeInputArgs
                {
                    Id = "datasource0",
                    NodeType = "DataSource",
                    Args = new[]
                    {
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "database",
                            Value = $"\"{source.Name}\"",
                        },
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "table_name",
                            Value = $"\"{sourceAwsGlueCatalogTable.Name}\"",
                        },
                    },
                },
                new Aws.Glue.Inputs.GetScriptDagNodeInputArgs
                {
                    Id = "applymapping1",
                    NodeType = "ApplyMapping",
                    Args = new[]
                    {
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "mappings",
                            Value = "[(\"column1\", \"string\", \"column1\", \"string\")]",
                        },
                    },
                },
                new Aws.Glue.Inputs.GetScriptDagNodeInputArgs
                {
                    Id = "selectfields2",
                    NodeType = "SelectFields",
                    Args = new[]
                    {
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "paths",
                            Value = "[\"column1\"]",
                        },
                    },
                },
                new Aws.Glue.Inputs.GetScriptDagNodeInputArgs
                {
                    Id = "resolvechoice3",
                    NodeType = "ResolveChoice",
                    Args = new[]
                    {
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "choice",
                            Value = "\"MATCH_CATALOG\"",
                        },
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "database",
                            Value = $"\"{destination.Name}\"",
                        },
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "table_name",
                            Value = $"\"{destinationAwsGlueCatalogTable.Name}\"",
                        },
                    },
                },
                new Aws.Glue.Inputs.GetScriptDagNodeInputArgs
                {
                    Id = "datasink4",
                    NodeType = "DataSink",
                    Args = new[]
                    {
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "database",
                            Value = $"\"{destination.Name}\"",
                        },
                        new Aws.Glue.Inputs.GetScriptDagNodeArgInputArgs
                        {
                            Name = "table_name",
                            Value = $"\"{destinationAwsGlueCatalogTable.Name}\"",
                        },
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["scalaCode"] = example.Apply(getScriptResult => getScriptResult.ScalaCode),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.glue.GlueFunctions;
    import com.pulumi.aws.glue.inputs.GetScriptArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = GlueFunctions.getScript(GetScriptArgs.builder()
                .language("SCALA")
                .dagEdges(            
                    GetScriptDagEdgeArgs.builder()
                        .source("datasource0")
                        .target("applymapping1")
                        .build(),
                    GetScriptDagEdgeArgs.builder()
                        .source("applymapping1")
                        .target("selectfields2")
                        .build(),
                    GetScriptDagEdgeArgs.builder()
                        .source("selectfields2")
                        .target("resolvechoice3")
                        .build(),
                    GetScriptDagEdgeArgs.builder()
                        .source("resolvechoice3")
                        .target("datasink4")
                        .build())
                .dagNodes(            
                    GetScriptDagNodeArgs.builder()
                        .id("datasource0")
                        .nodeType("DataSource")
                        .args(                    
                            GetScriptDagNodeArgArgs.builder()
                                .name("database")
                                .value(String.format("\"%s\"", source.name()))
                                .build(),
                            GetScriptDagNodeArgArgs.builder()
                                .name("table_name")
                                .value(String.format("\"%s\"", sourceAwsGlueCatalogTable.name()))
                                .build())
                        .build(),
                    GetScriptDagNodeArgs.builder()
                        .id("applymapping1")
                        .nodeType("ApplyMapping")
                        .args(GetScriptDagNodeArgArgs.builder()
                            .name("mappings")
                            .value("[(\"column1\", \"string\", \"column1\", \"string\")]")
                            .build())
                        .build(),
                    GetScriptDagNodeArgs.builder()
                        .id("selectfields2")
                        .nodeType("SelectFields")
                        .args(GetScriptDagNodeArgArgs.builder()
                            .name("paths")
                            .value("[\"column1\"]")
                            .build())
                        .build(),
                    GetScriptDagNodeArgs.builder()
                        .id("resolvechoice3")
                        .nodeType("ResolveChoice")
                        .args(                    
                            GetScriptDagNodeArgArgs.builder()
                                .name("choice")
                                .value("\"MATCH_CATALOG\"")
                                .build(),
                            GetScriptDagNodeArgArgs.builder()
                                .name("database")
                                .value(String.format("\"%s\"", destination.name()))
                                .build(),
                            GetScriptDagNodeArgArgs.builder()
                                .name("table_name")
                                .value(String.format("\"%s\"", destinationAwsGlueCatalogTable.name()))
                                .build())
                        .build(),
                    GetScriptDagNodeArgs.builder()
                        .id("datasink4")
                        .nodeType("DataSink")
                        .args(                    
                            GetScriptDagNodeArgArgs.builder()
                                .name("database")
                                .value(String.format("\"%s\"", destination.name()))
                                .build(),
                            GetScriptDagNodeArgArgs.builder()
                                .name("table_name")
                                .value(String.format("\"%s\"", destinationAwsGlueCatalogTable.name()))
                                .build())
                        .build())
                .build());
    
            ctx.export("scalaCode", example.applyValue(getScriptResult -> getScriptResult.scalaCode()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:glue:getScript
          Arguments:
            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}"'
    outputs:
      scalaCode: ${example.scalaCode}
    

    Using getScript

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getScript(args: GetScriptArgs, opts?: InvokeOptions): Promise<GetScriptResult>
    function getScriptOutput(args: GetScriptOutputArgs, opts?: InvokeOptions): Output<GetScriptResult>
    def get_script(dag_edges: Optional[Sequence[GetScriptDagEdge]] = None,
                   dag_nodes: Optional[Sequence[GetScriptDagNode]] = None,
                   language: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetScriptResult
    def get_script_output(dag_edges: Optional[pulumi.Input[Sequence[pulumi.Input[GetScriptDagEdgeArgs]]]] = None,
                   dag_nodes: Optional[pulumi.Input[Sequence[pulumi.Input[GetScriptDagNodeArgs]]]] = None,
                   language: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetScriptResult]
    func GetScript(ctx *Context, args *GetScriptArgs, opts ...InvokeOption) (*GetScriptResult, error)
    func GetScriptOutput(ctx *Context, args *GetScriptOutputArgs, opts ...InvokeOption) GetScriptResultOutput

    > Note: This function is named GetScript in the Go SDK.

    public static class GetScript 
    {
        public static Task<GetScriptResult> InvokeAsync(GetScriptArgs args, InvokeOptions? opts = null)
        public static Output<GetScriptResult> Invoke(GetScriptInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetScriptResult> getScript(GetScriptArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:glue/getScript:getScript
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DagEdges List<GetScriptDagEdge>
    List of the edges in the DAG. Defined below.
    DagNodes List<GetScriptDagNode>
    List of the nodes in the DAG. Defined below.
    Language string
    Programming language of the resulting code from the DAG. Defaults to PYTHON. Valid values are PYTHON and SCALA.
    DagEdges []GetScriptDagEdge
    List of the edges in the DAG. Defined below.
    DagNodes []GetScriptDagNode
    List of the nodes in the DAG. Defined below.
    Language string
    Programming language of the resulting code from the DAG. Defaults to PYTHON. Valid values are PYTHON and SCALA.
    dagEdges List<GetScriptDagEdge>
    List of the edges in the DAG. Defined below.
    dagNodes List<GetScriptDagNode>
    List of the nodes in the DAG. Defined below.
    language String
    Programming language of the resulting code from the DAG. Defaults to PYTHON. Valid values are PYTHON and SCALA.
    dagEdges GetScriptDagEdge[]
    List of the edges in the DAG. Defined below.
    dagNodes GetScriptDagNode[]
    List of the nodes in the DAG. Defined below.
    language string
    Programming language of the resulting code from the DAG. Defaults to PYTHON. Valid values are PYTHON and SCALA.
    dag_edges Sequence[GetScriptDagEdge]
    List of the edges in the DAG. Defined below.
    dag_nodes Sequence[GetScriptDagNode]
    List of the nodes in the DAG. Defined below.
    language str
    Programming language of the resulting code from the DAG. Defaults to PYTHON. Valid values are PYTHON and SCALA.
    dagEdges List<Property Map>
    List of the edges in the DAG. Defined below.
    dagNodes List<Property Map>
    List of the nodes in the DAG. Defined below.
    language String
    Programming language of the resulting code from the DAG. Defaults to PYTHON. Valid values are PYTHON and SCALA.

    getScript Result

    The following output properties are available:

    DagEdges List<GetScriptDagEdge>
    DagNodes List<GetScriptDagNode>
    Id string
    The provider-assigned unique ID for this managed resource.
    PythonScript string
    Python script generated from the DAG when the language argument is set to PYTHON.
    ScalaCode string
    Scala code generated from the DAG when the language argument is set to SCALA.
    Language string
    DagEdges []GetScriptDagEdge
    DagNodes []GetScriptDagNode
    Id string
    The provider-assigned unique ID for this managed resource.
    PythonScript string
    Python script generated from the DAG when the language argument is set to PYTHON.
    ScalaCode string
    Scala code generated from the DAG when the language argument is set to SCALA.
    Language string
    dagEdges List<GetScriptDagEdge>
    dagNodes List<GetScriptDagNode>
    id String
    The provider-assigned unique ID for this managed resource.
    pythonScript String
    Python script generated from the DAG when the language argument is set to PYTHON.
    scalaCode String
    Scala code generated from the DAG when the language argument is set to SCALA.
    language String
    dagEdges GetScriptDagEdge[]
    dagNodes GetScriptDagNode[]
    id string
    The provider-assigned unique ID for this managed resource.
    pythonScript string
    Python script generated from the DAG when the language argument is set to PYTHON.
    scalaCode string
    Scala code generated from the DAG when the language argument is set to SCALA.
    language string
    dag_edges Sequence[GetScriptDagEdge]
    dag_nodes Sequence[GetScriptDagNode]
    id str
    The provider-assigned unique ID for this managed resource.
    python_script str
    Python script generated from the DAG when the language argument is set to PYTHON.
    scala_code str
    Scala code generated from the DAG when the language argument is set to SCALA.
    language str
    dagEdges List<Property Map>
    dagNodes List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    pythonScript String
    Python script generated from the DAG when the language argument is set to PYTHON.
    scalaCode String
    Scala code generated from the DAG when the language argument is set to SCALA.
    language String

    Supporting Types

    GetScriptDagEdge

    Source string
    ID of the node at which the edge starts.
    Target string
    ID of the node at which the edge ends.
    TargetParameter string
    Target of the edge.
    Source string
    ID of the node at which the edge starts.
    Target string
    ID of the node at which the edge ends.
    TargetParameter string
    Target of the edge.
    source String
    ID of the node at which the edge starts.
    target String
    ID of the node at which the edge ends.
    targetParameter String
    Target of the edge.
    source string
    ID of the node at which the edge starts.
    target string
    ID of the node at which the edge ends.
    targetParameter string
    Target of the edge.
    source str
    ID of the node at which the edge starts.
    target str
    ID of the node at which the edge ends.
    target_parameter str
    Target of the edge.
    source String
    ID of the node at which the edge starts.
    target String
    ID of the node at which the edge ends.
    targetParameter String
    Target of the edge.

    GetScriptDagNode

    Args List<GetScriptDagNodeArg>
    Nested configuration an argument or property of a node. Defined below.
    Id string
    Node identifier that is unique within the node's graph.
    NodeType string
    Type of node this is.
    LineNumber int
    Line number of the node.
    Args []GetScriptDagNodeArg
    Nested configuration an argument or property of a node. Defined below.
    Id string
    Node identifier that is unique within the node's graph.
    NodeType string
    Type of node this is.
    LineNumber int
    Line number of the node.
    args List<GetScriptDagNodeArg>
    Nested configuration an argument or property of a node. Defined below.
    id String
    Node identifier that is unique within the node's graph.
    nodeType String
    Type of node this is.
    lineNumber Integer
    Line number of the node.
    args GetScriptDagNodeArg[]
    Nested configuration an argument or property of a node. Defined below.
    id string
    Node identifier that is unique within the node's graph.
    nodeType string
    Type of node this is.
    lineNumber number
    Line number of the node.
    args Sequence[GetScriptDagNodeArg]
    Nested configuration an argument or property of a node. Defined below.
    id str
    Node identifier that is unique within the node's graph.
    node_type str
    Type of node this is.
    line_number int
    Line number of the node.
    args List<Property Map>
    Nested configuration an argument or property of a node. Defined below.
    id String
    Node identifier that is unique within the node's graph.
    nodeType String
    Type of node this is.
    lineNumber Number
    Line number of the node.

    GetScriptDagNodeArg

    Name string
    Name of the argument or property.
    Value string
    Value of the argument or property.
    Param bool
    Boolean if the value is used as a parameter. Defaults to false.
    Name string
    Name of the argument or property.
    Value string
    Value of the argument or property.
    Param bool
    Boolean if the value is used as a parameter. Defaults to false.
    name String
    Name of the argument or property.
    value String
    Value of the argument or property.
    param Boolean
    Boolean if the value is used as a parameter. Defaults to false.
    name string
    Name of the argument or property.
    value string
    Value of the argument or property.
    param boolean
    Boolean if the value is used as a parameter. Defaults to false.
    name str
    Name of the argument or property.
    value str
    Value of the argument or property.
    param bool
    Boolean if the value is used as a parameter. Defaults to false.
    name String
    Name of the argument or property.
    value String
    Value of the argument or property.
    param Boolean
    Boolean if the value is used as a parameter. Defaults to false.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi