Connection class

Manages an AWS Glue Connection.

Example Usage

Non-VPC Connection

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.glue.Connection("example", {
    name: "example",
    connectionProperties: {
        JDBC_CONNECTION_URL: "jdbc:mysql://example.com/exampledatabase",
        PASSWORD: "examplepassword",
        USERNAME: "exampleusername",
    },
});
import pulumi
import pulumi_aws as aws

example = aws.glue.Connection("example",
    name="example",
    connection_properties={
        "JDBC_CONNECTION_URL": "jdbc:mysql://example.com/exampledatabase",
        "PASSWORD": "examplepassword",
        "USERNAME": "exampleusername",
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Glue.Connection("example", new()
    {
        Name = "example",
        ConnectionProperties =
        {
            { "JDBC_CONNECTION_URL", "jdbc:mysql://example.com/exampledatabase" },
            { "PASSWORD", "examplepassword" },
            { "USERNAME", "exampleusername" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := glue.NewConnection(ctx, "example", &glue.ConnectionArgs{
			Name: pulumi.String("example"),
			ConnectionProperties: pulumi.StringMap{
				"JDBC_CONNECTION_URL": pulumi.String("jdbc:mysql://example.com/exampledatabase"),
				"PASSWORD":            pulumi.String("examplepassword"),
				"USERNAME":            pulumi.String("exampleusername"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_glue_connection" "example" {
  name = "example"
  connection_properties = {
    "JDBC_CONNECTION_URL" = "jdbc:mysql://example.com/exampledatabase"
    "PASSWORD"            = "examplepassword"
    "USERNAME"            = "exampleusername"
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glue.Connection;
import com.pulumi.aws.glue.ConnectionArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new Connection("example", ConnectionArgs.builder()
            .name("example")
            .connectionProperties(Map.ofEntries(
                Map.entry("JDBC_CONNECTION_URL", "jdbc:mysql://example.com/exampledatabase"),
                Map.entry("PASSWORD", "examplepassword"),
                Map.entry("USERNAME", "exampleusername")
            ))
            .build());

    }
}
resources:
  example:
    type: aws:glue:Connection
    properties:
      name: example
      connectionProperties:
        JDBC_CONNECTION_URL: jdbc:mysql://example.com/exampledatabase
        PASSWORD: examplepassword
        USERNAME: exampleusername

Non-VPC Connection with secret manager reference

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = aws.secretsmanager.getSecret({
    name: "example-secret",
});
const exampleConnection = new aws.glue.Connection("example", {
    name: "example",
    connectionProperties: {
        JDBC_CONNECTION_URL: "jdbc:mysql://example.com/exampledatabase",
        SECRET_ID: example.then(example => example.name),
    },
});
import pulumi
import pulumi_aws as aws

example = aws.secretsmanager.get_secret(name="example-secret")
example_connection = aws.glue.Connection("example",
    name="example",
    connection_properties={
        "JDBC_CONNECTION_URL": "jdbc:mysql://example.com/exampledatabase",
        "SECRET_ID": example.name,
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = Aws.SecretsManager.GetSecret.Invoke(new()
    {
        Name = "example-secret",
    });

    var exampleConnection = new Aws.Glue.Connection("example", new()
    {
        Name = "example",
        ConnectionProperties =
        {
            { "JDBC_CONNECTION_URL", "jdbc:mysql://example.com/exampledatabase" },
            { "SECRET_ID", example.Apply(getSecretResult => getSecretResult.Name) },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/secretsmanager"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := secretsmanager.LookupSecret(ctx, &secretsmanager.LookupSecretArgs{
			Name: pulumi.StringRef("example-secret"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = glue.NewConnection(ctx, "example", &glue.ConnectionArgs{
			Name: pulumi.String("example"),
			ConnectionProperties: pulumi.StringMap{
				"JDBC_CONNECTION_URL": pulumi.String("jdbc:mysql://example.com/exampledatabase"),
				"SECRET_ID":           pulumi.String(example.Name),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_secretsmanager_getsecret" "example" {
  name = "example-secret"
}

resource "aws_glue_connection" "example" {
  name = "example"
  connection_properties = {
    "JDBC_CONNECTION_URL" = "jdbc:mysql://example.com/exampledatabase"
    "SECRET_ID"           = data.aws_secretsmanager_getsecret.example.name
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.secretsmanager.SecretsmanagerFunctions;
import com.pulumi.aws.secretsmanager.inputs.GetSecretArgs;
import com.pulumi.aws.glue.Connection;
import com.pulumi.aws.glue.ConnectionArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 = SecretsmanagerFunctions.getSecret(GetSecretArgs.builder()
            .name("example-secret")
            .build());

        var exampleConnection = new Connection("exampleConnection", ConnectionArgs.builder()
            .name("example")
            .connectionProperties(Map.ofEntries(
                Map.entry("JDBC_CONNECTION_URL", "jdbc:mysql://example.com/exampledatabase"),
                Map.entry("SECRET_ID", example.name())
            ))
            .build());

    }
}
resources:
  exampleConnection:
    type: aws:glue:Connection
    name: example
    properties:
      name: example
      connectionProperties:
        JDBC_CONNECTION_URL: jdbc:mysql://example.com/exampledatabase
        SECRET_ID: ${example.name}
variables:
  example:
    fn::invoke:
      function: aws:secretsmanager:getSecret
      arguments:
        name: example-secret

VPC Connection

For more information, see the AWS Documentation.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.glue.Connection("example", {
    physicalConnectionRequirements: {
        availabilityZone: exampleAwsSubnet.availabilityZone,
        securityGroupIdLists: [exampleAwsSecurityGroup.id],
        subnetId: exampleAwsSubnet.id,
    },
    name: "example",
    connectionProperties: {
        JDBC_CONNECTION_URL: `jdbc:mysql://${exampleAwsRdsCluster.endpoint}/exampledatabase`,
        PASSWORD: "examplepassword",
        USERNAME: "exampleusername",
    },
});
import pulumi
import pulumi_aws as aws

example = aws.glue.Connection("example",
    physical_connection_requirements={
        "availability_zone": example_aws_subnet["availabilityZone"],
        "security_group_id_lists": [example_aws_security_group["id"]],
        "subnet_id": example_aws_subnet["id"],
    },
    name="example",
    connection_properties={
        "JDBC_CONNECTION_URL": f"jdbc:mysql://{example_aws_rds_cluster['endpoint']}/exampledatabase",
        "PASSWORD": "examplepassword",
        "USERNAME": "exampleusername",
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Glue.Connection("example", new()
    {
        PhysicalConnectionRequirements = new Aws.Glue.Inputs.ConnectionPhysicalConnectionRequirementsArgs
        {
            AvailabilityZone = exampleAwsSubnet.AvailabilityZone,
            SecurityGroupIdLists = new[]
            {
                exampleAwsSecurityGroup.Id,
            },
            SubnetId = exampleAwsSubnet.Id,
        },
        Name = "example",
        ConnectionProperties =
        {
            { "JDBC_CONNECTION_URL", $"jdbc:mysql://{exampleAwsRdsCluster.Endpoint}/exampledatabase" },
            { "PASSWORD", "examplepassword" },
            { "USERNAME", "exampleusername" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := glue.NewConnection(ctx, "example", &glue.ConnectionArgs{
			PhysicalConnectionRequirements: &glue.ConnectionPhysicalConnectionRequirementsArgs{
				AvailabilityZone: pulumi.Any(exampleAwsSubnet.AvailabilityZone),
				SecurityGroupIdLists: pulumi.StringArray{
					exampleAwsSecurityGroup.Id,
				},
				SubnetId: pulumi.Any(exampleAwsSubnet.Id),
			},
			Name: pulumi.String("example"),
			ConnectionProperties: pulumi.StringMap{
				"JDBC_CONNECTION_URL": pulumi.Sprintf("jdbc:mysql://%v/exampledatabase", exampleAwsRdsCluster.Endpoint),
				"PASSWORD":            pulumi.String("examplepassword"),
				"USERNAME":            pulumi.String("exampleusername"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_glue_connection" "example" {
  physical_connection_requirements = {
    availability_zone       = exampleAwsSubnet.availabilityZone
    security_group_id_lists = [exampleAwsSecurityGroup.id]
    subnet_id               = exampleAwsSubnet.id
  }
  name = "example"
  connection_properties = {
    "JDBC_CONNECTION_URL" ="jdbc:mysql://${exampleAwsRdsCluster.endpoint}/exampledatabase"
    "PASSWORD"            = "examplepassword"
    "USERNAME"            = "exampleusername"
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glue.Connection;
import com.pulumi.aws.glue.ConnectionArgs;
import com.pulumi.aws.glue.inputs.ConnectionPhysicalConnectionRequirementsArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new Connection("example", ConnectionArgs.builder()
            .physicalConnectionRequirements(ConnectionPhysicalConnectionRequirementsArgs.builder()
                .availabilityZone(exampleAwsSubnet.availabilityZone())
                .securityGroupIdLists(exampleAwsSecurityGroup.id())
                .subnetId(exampleAwsSubnet.id())
                .build())
            .name("example")
            .connectionProperties(Map.ofEntries(
                Map.entry("JDBC_CONNECTION_URL", String.format("jdbc:mysql://%s/exampledatabase", exampleAwsRdsCluster.endpoint())),
                Map.entry("PASSWORD", "examplepassword"),
                Map.entry("USERNAME", "exampleusername")
            ))
            .build());

    }
}
resources:
  example:
    type: aws:glue:Connection
    properties:
      physicalConnectionRequirements:
        availabilityZone: ${exampleAwsSubnet.availabilityZone}
        securityGroupIdLists:
          - ${exampleAwsSecurityGroup.id}
        subnetId: ${exampleAwsSubnet.id}
      name: example
      connectionProperties:
        JDBC_CONNECTION_URL: jdbc:mysql://${exampleAwsRdsCluster.endpoint}/exampledatabase
        PASSWORD: examplepassword
        USERNAME: exampleusername

Connection using a custom connector

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// Define the custom connector using the connection_type of `CUSTOM` with the match_criteria of `template_connection`
// Example here being a snowflake jdbc connector with a secret having user and password as keys
const example = aws.secretsmanager.getSecret({
    name: "example-secret",
});
const example1 = new aws.glue.Connection("example1", {
    name: "example1",
    connectionType: "CUSTOM",
    connectionProperties: {
        CONNECTOR_CLASS_NAME: "net.snowflake.client.jdbc.SnowflakeDriver",
        CONNECTION_TYPE: "Jdbc",
        CONNECTOR_URL: "s3://example/snowflake-jdbc.jar",
        JDBC_CONNECTION_URL: "[[\"default=jdbc:snowflake://example.com/?user=${user}&password=${password}\"],\",\"]",
    },
    matchCriterias: ["template-connection"],
});
// Reference the connector using match_criteria with the connector created above.
const example2 = new aws.glue.Connection("example2", {
    name: "example2",
    connectionType: "CUSTOM",
    connectionProperties: {
        CONNECTOR_CLASS_NAME: "net.snowflake.client.jdbc.SnowflakeDriver",
        CONNECTION_TYPE: "Jdbc",
        CONNECTOR_URL: "s3://example/snowflake-jdbc.jar",
        JDBC_CONNECTION_URL: "jdbc:snowflake://example.com/?user=${user}&password=${password}",
        SECRET_ID: example.then(example => example.name),
    },
    matchCriterias: [
        "Connection",
        example1.name,
    ],
});
import pulumi
import pulumi_aws as aws

# Define the custom connector using the connection_type of `CUSTOM` with the match_criteria of `template_connection`
# Example here being a snowflake jdbc connector with a secret having user and password as keys
example = aws.secretsmanager.get_secret(name="example-secret")
example1 = aws.glue.Connection("example1",
    name="example1",
    connection_type="CUSTOM",
    connection_properties={
        "CONNECTOR_CLASS_NAME": "net.snowflake.client.jdbc.SnowflakeDriver",
        "CONNECTION_TYPE": "Jdbc",
        "CONNECTOR_URL": "s3://example/snowflake-jdbc.jar",
        "JDBC_CONNECTION_URL": "[[\"default=jdbc:snowflake://example.com/?user=${user}&password=${password}\"],\",\"]",
    },
    match_criterias=["template-connection"])
# Reference the connector using match_criteria with the connector created above.
example2 = aws.glue.Connection("example2",
    name="example2",
    connection_type="CUSTOM",
    connection_properties={
        "CONNECTOR_CLASS_NAME": "net.snowflake.client.jdbc.SnowflakeDriver",
        "CONNECTION_TYPE": "Jdbc",
        "CONNECTOR_URL": "s3://example/snowflake-jdbc.jar",
        "JDBC_CONNECTION_URL": "jdbc:snowflake://example.com/?user=${user}&password=${password}",
        "SECRET_ID": example.name,
    },
    match_criterias=[
        "Connection",
        example1.name,
    ])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    // Define the custom connector using the connection_type of `CUSTOM` with the match_criteria of `template_connection`
    // Example here being a snowflake jdbc connector with a secret having user and password as keys
    var example = Aws.SecretsManager.GetSecret.Invoke(new()
    {
        Name = "example-secret",
    });

    var example1 = new Aws.Glue.Connection("example1", new()
    {
        Name = "example1",
        ConnectionType = "CUSTOM",
        ConnectionProperties =
        {
            { "CONNECTOR_CLASS_NAME", "net.snowflake.client.jdbc.SnowflakeDriver" },
            { "CONNECTION_TYPE", "Jdbc" },
            { "CONNECTOR_URL", "s3://example/snowflake-jdbc.jar" },
            { "JDBC_CONNECTION_URL", "[[\"default=jdbc:snowflake://example.com/?user=${user}&password=${password}\"],\",\"]" },
        },
        MatchCriterias = new[]
        {
            "template-connection",
        },
    });

    // Reference the connector using match_criteria with the connector created above.
    var example2 = new Aws.Glue.Connection("example2", new()
    {
        Name = "example2",
        ConnectionType = "CUSTOM",
        ConnectionProperties =
        {
            { "CONNECTOR_CLASS_NAME", "net.snowflake.client.jdbc.SnowflakeDriver" },
            { "CONNECTION_TYPE", "Jdbc" },
            { "CONNECTOR_URL", "s3://example/snowflake-jdbc.jar" },
            { "JDBC_CONNECTION_URL", "jdbc:snowflake://example.com/?user=${user}&password=${password}" },
            { "SECRET_ID", example.Apply(getSecretResult => getSecretResult.Name) },
        },
        MatchCriterias = new[]
        {
            "Connection",
            example1.Name,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/secretsmanager"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Define the custom connector using the connection_type of `CUSTOM` with the match_criteria of `template_connection`
		// Example here being a snowflake jdbc connector with a secret having user and password as keys
		example, err := secretsmanager.LookupSecret(ctx, &secretsmanager.LookupSecretArgs{
			Name: pulumi.StringRef("example-secret"),
		}, nil)
		if err != nil {
			return err
		}
		example1, err := glue.NewConnection(ctx, "example1", &glue.ConnectionArgs{
			Name:           pulumi.String("example1"),
			ConnectionType: pulumi.String("CUSTOM"),
			ConnectionProperties: pulumi.StringMap{
				"CONNECTOR_CLASS_NAME": pulumi.String("net.snowflake.client.jdbc.SnowflakeDriver"),
				"CONNECTION_TYPE":      pulumi.String("Jdbc"),
				"CONNECTOR_URL":        pulumi.String("s3://example/snowflake-jdbc.jar"),
				"JDBC_CONNECTION_URL":  pulumi.String("[[\"default=jdbc:snowflake://example.com/?user=${user}&password=${password}\"],\",\"]"),
			},
			MatchCriterias: pulumi.StringArray{
				pulumi.String("template-connection"),
			},
		})
		if err != nil {
			return err
		}
		// Reference the connector using match_criteria with the connector created above.
		_, err = glue.NewConnection(ctx, "example2", &glue.ConnectionArgs{
			Name:           pulumi.String("example2"),
			ConnectionType: pulumi.String("CUSTOM"),
			ConnectionProperties: pulumi.StringMap{
				"CONNECTOR_CLASS_NAME": pulumi.String("net.snowflake.client.jdbc.SnowflakeDriver"),
				"CONNECTION_TYPE":      pulumi.String("Jdbc"),
				"CONNECTOR_URL":        pulumi.String("s3://example/snowflake-jdbc.jar"),
				"JDBC_CONNECTION_URL":  pulumi.String("jdbc:snowflake://example.com/?user=${user}&password=${password}"),
				"SECRET_ID":            pulumi.String(example.Name),
			},
			MatchCriterias: pulumi.StringArray{
				pulumi.String("Connection"),
				example1.Name,
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_secretsmanager_getsecret" "example" {
  name = "example-secret"
}

resource "aws_glue_connection" "example1" {
  name            = "example1"
  connection_type = "CUSTOM"
  connection_properties = {
    "CONNECTOR_CLASS_NAME" = "net.snowflake.client.jdbc.SnowflakeDriver"
    "CONNECTION_TYPE"      = "Jdbc"
    "CONNECTOR_URL"        = "s3://example/snowflake-jdbc.jar"
    "JDBC_CONNECTION_URL"  = "[[\"default=jdbc:snowflake://example.com/?user=$${user}&password=$${password}\"],\",\"]"
  }
  match_criterias = ["template-connection"]
}
# Reference the connector using match_criteria with the connector created above.
resource "aws_glue_connection" "example2" {
  name            = "example2"
  connection_type = "CUSTOM"
  connection_properties = {
    "CONNECTOR_CLASS_NAME" = "net.snowflake.client.jdbc.SnowflakeDriver"
    "CONNECTION_TYPE"      = "Jdbc"
    "CONNECTOR_URL"        = "s3://example/snowflake-jdbc.jar"
    "JDBC_CONNECTION_URL"  = "jdbc:snowflake://example.com/?user=$${user}&password=$${password}"
    "SECRET_ID"            = data.aws_secretsmanager_getsecret.example.name
  }
  match_criterias = ["Connection", aws_glue_connection.example1.name]
}
# Define the custom connector using the connection_type of `CUSTOM` with the match_criteria of `template_connection`
# Example here being a snowflake jdbc connector with a secret having user and password as keys
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.secretsmanager.SecretsmanagerFunctions;
import com.pulumi.aws.secretsmanager.inputs.GetSecretArgs;
import com.pulumi.aws.glue.Connection;
import com.pulumi.aws.glue.ConnectionArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        // Define the custom connector using the connection_type of `CUSTOM` with the match_criteria of `template_connection`
        // Example here being a snowflake jdbc connector with a secret having user and password as keys
        final var example = SecretsmanagerFunctions.getSecret(GetSecretArgs.builder()
            .name("example-secret")
            .build());

        var example1 = new Connection("example1", ConnectionArgs.builder()
            .name("example1")
            .connectionType("CUSTOM")
            .connectionProperties(Map.ofEntries(
                Map.entry("CONNECTOR_CLASS_NAME", "net.snowflake.client.jdbc.SnowflakeDriver"),
                Map.entry("CONNECTION_TYPE", "Jdbc"),
                Map.entry("CONNECTOR_URL", "s3://example/snowflake-jdbc.jar"),
                Map.entry("JDBC_CONNECTION_URL", "[[\"default=jdbc:snowflake://example.com/?user=${user}&password=${password}\"],\",\"]")
            ))
            .matchCriterias("template-connection")
            .build());

        // Reference the connector using match_criteria with the connector created above.
        var example2 = new Connection("example2", ConnectionArgs.builder()
            .name("example2")
            .connectionType("CUSTOM")
            .connectionProperties(Map.ofEntries(
                Map.entry("CONNECTOR_CLASS_NAME", "net.snowflake.client.jdbc.SnowflakeDriver"),
                Map.entry("CONNECTION_TYPE", "Jdbc"),
                Map.entry("CONNECTOR_URL", "s3://example/snowflake-jdbc.jar"),
                Map.entry("JDBC_CONNECTION_URL", "jdbc:snowflake://example.com/?user=${user}&password=${password}"),
                Map.entry("SECRET_ID", example.name())
            ))
            .matchCriterias(
                "Connection",
                example1.name())
            .build());

    }
}
resources:
  example1:
    type: aws:glue:Connection
    properties:
      name: example1
      connectionType: CUSTOM
      connectionProperties:
        CONNECTOR_CLASS_NAME: net.snowflake.client.jdbc.SnowflakeDriver
        CONNECTION_TYPE: Jdbc
        CONNECTOR_URL: s3://example/snowflake-jdbc.jar
        JDBC_CONNECTION_URL: '[["default=jdbc:snowflake://example.com/?user=$${user}&password=$${password}"],","]'
      matchCriterias:
        - template-connection
  # Reference the connector using match_criteria with the connector created above.
  example2:
    type: aws:glue:Connection
    properties:
      name: example2
      connectionType: CUSTOM
      connectionProperties:
        CONNECTOR_CLASS_NAME: net.snowflake.client.jdbc.SnowflakeDriver
        CONNECTION_TYPE: Jdbc
        CONNECTOR_URL: s3://example/snowflake-jdbc.jar
        JDBC_CONNECTION_URL: jdbc:snowflake://example.com/?user=$${user}&password=$${password}
        SECRET_ID: ${example.name}
      matchCriterias:
        - Connection
        - ${example1.name}
variables:
  # Define the custom connector using the connection_type of `CUSTOM` with the match_criteria of `template_connection`
  # Example here being a snowflake jdbc connector with a secret having user and password as keys
  example:
    fn::invoke:
      function: aws:secretsmanager:getSecret
      arguments:
        name: example-secret

Azure Cosmos Connection

For more information, see the AWS Documentation.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.secretsmanager.Secret("example", {name: "example-secret"});
const exampleSecretVersion = new aws.secretsmanager.SecretVersion("example", {
    secretId: example.id,
    secretString: JSON.stringify({
        username: "exampleusername",
        password: "examplepassword",
    }),
});
const exampleConnection = new aws.glue.Connection("example", {
    name: "example",
    connectionType: "AZURECOSMOS",
    connectionProperties: {
        SparkProperties: pulumi.jsonStringify({
            secretId: example.name,
            "spark.cosmos.accountEndpoint": "https://exampledbaccount.documents.azure.com:443/",
        }),
    },
});
import pulumi
import json
import pulumi_aws as aws

example = aws.secretsmanager.Secret("example", name="example-secret")
example_secret_version = aws.secretsmanager.SecretVersion("example",
    secret_id=example.id,
    secret_string=json.dumps({
        "username": "exampleusername",
        "password": "examplepassword",
    }))
example_connection = aws.glue.Connection("example",
    name="example",
    connection_type="AZURECOSMOS",
    connection_properties={
        "SparkProperties": pulumi.Output.json_dumps({
            "secretId": example.name,
            "spark.cosmos.accountEndpoint": "https://exampledbaccount.documents.azure.com:443/",
        }),
    })
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.SecretsManager.Secret("example", new()
    {
        Name = "example-secret",
    });

    var exampleSecretVersion = new Aws.SecretsManager.SecretVersion("example", new()
    {
        SecretId = example.Id,
        SecretString = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["username"] = "exampleusername",
            ["password"] = "examplepassword",
        }),
    });

    var exampleConnection = new Aws.Glue.Connection("example", new()
    {
        Name = "example",
        ConnectionType = "AZURECOSMOS",
        ConnectionProperties =
        {
            { "SparkProperties", Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
            {
                ["secretId"] = example.Name,
                ["spark.cosmos.accountEndpoint"] = "https://exampledbaccount.documents.azure.com:443/",
            })) },
        },
    });

});
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/secretsmanager"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := secretsmanager.NewSecret(ctx, "example", &secretsmanager.SecretArgs{
			Name: pulumi.String("example-secret"),
		})
		if err != nil {
			return err
		}
		tmpJSON0, err := json.Marshal(map[string]string{
			"username": "exampleusername",
			"password": "examplepassword",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = secretsmanager.NewSecretVersion(ctx, "example", &secretsmanager.SecretVersionArgs{
			SecretId:     example.ID().ToIDOutput().ToStringOutput(),
			SecretString: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		_, err = glue.NewConnection(ctx, "example", &glue.ConnectionArgs{
			Name:           pulumi.String("example"),
			ConnectionType: pulumi.String("AZURECOSMOS"),
			ConnectionProperties: pulumi.StringMap{
				"SparkProperties": example.Name.ApplyT(func(name string) (pulumi.String, error) {
					var _zero pulumi.String
					tmpJSON1, err := json.Marshal(map[string]string{
						"secretId":                     name,
						"spark.cosmos.accountEndpoint": "https://exampledbaccount.documents.azure.com:443/",
					})
					if err != nil {
						return _zero, err
					}
					json1 := string(tmpJSON1)
					return pulumi.String(json1), nil
				}).(pulumi.StringOutput),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_secretsmanager_secret" "example" {
  name = "example-secret"
}
resource "aws_secretsmanager_secretversion" "example" {
  secret_id = aws_secretsmanager_secret.example.id
  secret_string = jsonencode({
    "username" = "exampleusername"
    "password" = "examplepassword"
  })
}
resource "aws_glue_connection" "example" {
  name            = "example"
  connection_type = "AZURECOSMOS"
  connection_properties = {
    "SparkProperties" = jsonencode({
      "secretId"                     = aws_secretsmanager_secret.example.name
      "spark.cosmos.accountEndpoint" = "https://exampledbaccount.documents.azure.com:443/"
    })
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.secretsmanager.Secret;
import com.pulumi.aws.secretsmanager.SecretArgs;
import com.pulumi.aws.secretsmanager.SecretVersion;
import com.pulumi.aws.secretsmanager.SecretVersionArgs;
import com.pulumi.aws.glue.Connection;
import com.pulumi.aws.glue.ConnectionArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new Secret("example", SecretArgs.builder()
            .name("example-secret")
            .build());

        var exampleSecretVersion = new SecretVersion("exampleSecretVersion", SecretVersionArgs.builder()
            .secretId(example.id())
            .secretString(serializeJson(
                jsonObject(
                    jsonProperty("username", "exampleusername"),
                    jsonProperty("password", "examplepassword")
                )))
            .build());

        var exampleConnection = new Connection("exampleConnection", ConnectionArgs.builder()
            .name("example")
            .connectionType("AZURECOSMOS")
            .connectionProperties(Map.of("SparkProperties", example.name().applyValue(_name -> serializeJson(
                jsonObject(
                    jsonProperty("secretId", _name),
                    jsonProperty("spark.cosmos.accountEndpoint", "https://exampledbaccount.documents.azure.com:443/")
                )))))
            .build());

    }
}
resources:
  example:
    type: aws:secretsmanager:Secret
    properties:
      name: example-secret
  exampleSecretVersion:
    type: aws:secretsmanager:SecretVersion
    name: example
    properties:
      secretId: ${example.id}
      secretString:
        fn::toJSON:
          username: exampleusername
          password: examplepassword
  exampleConnection:
    type: aws:glue:Connection
    name: example
    properties:
      name: example
      connectionType: AZURECOSMOS
      connectionProperties:
        SparkProperties:
          fn::toJSON:
            secretId: ${example.name}
            spark.cosmos.accountEndpoint: https://exampledbaccount.documents.azure.com:443/

Azure SQL Connection

For more information, see the AWS Documentation.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.secretsmanager.Secret("example", {name: "example-secret"});
const exampleSecretVersion = new aws.secretsmanager.SecretVersion("example", {
    secretId: example.id,
    secretString: JSON.stringify({
        username: "exampleusername",
        password: "examplepassword",
    }),
});
const exampleConnection = new aws.glue.Connection("example", {
    name: "example",
    connectionType: "AZURECOSMOS",
    connectionProperties: {
        SparkProperties: pulumi.jsonStringify({
            secretId: example.name,
            url: "jdbc:sqlserver:exampledbserver.database.windows.net:1433;database=exampledatabase",
        }),
    },
});
import pulumi
import json
import pulumi_aws as aws

example = aws.secretsmanager.Secret("example", name="example-secret")
example_secret_version = aws.secretsmanager.SecretVersion("example",
    secret_id=example.id,
    secret_string=json.dumps({
        "username": "exampleusername",
        "password": "examplepassword",
    }))
example_connection = aws.glue.Connection("example",
    name="example",
    connection_type="AZURECOSMOS",
    connection_properties={
        "SparkProperties": pulumi.Output.json_dumps({
            "secretId": example.name,
            "url": "jdbc:sqlserver:exampledbserver.database.windows.net:1433;database=exampledatabase",
        }),
    })
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.SecretsManager.Secret("example", new()
    {
        Name = "example-secret",
    });

    var exampleSecretVersion = new Aws.SecretsManager.SecretVersion("example", new()
    {
        SecretId = example.Id,
        SecretString = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["username"] = "exampleusername",
            ["password"] = "examplepassword",
        }),
    });

    var exampleConnection = new Aws.Glue.Connection("example", new()
    {
        Name = "example",
        ConnectionType = "AZURECOSMOS",
        ConnectionProperties =
        {
            { "SparkProperties", Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
            {
                ["secretId"] = example.Name,
                ["url"] = "jdbc:sqlserver:exampledbserver.database.windows.net:1433;database=exampledatabase",
            })) },
        },
    });

});
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/secretsmanager"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := secretsmanager.NewSecret(ctx, "example", &secretsmanager.SecretArgs{
			Name: pulumi.String("example-secret"),
		})
		if err != nil {
			return err
		}
		tmpJSON0, err := json.Marshal(map[string]string{
			"username": "exampleusername",
			"password": "examplepassword",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = secretsmanager.NewSecretVersion(ctx, "example", &secretsmanager.SecretVersionArgs{
			SecretId:     example.ID().ToIDOutput().ToStringOutput(),
			SecretString: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		_, err = glue.NewConnection(ctx, "example", &glue.ConnectionArgs{
			Name:           pulumi.String("example"),
			ConnectionType: pulumi.String("AZURECOSMOS"),
			ConnectionProperties: pulumi.StringMap{
				"SparkProperties": example.Name.ApplyT(func(name string) (pulumi.String, error) {
					var _zero pulumi.String
					tmpJSON1, err := json.Marshal(map[string]string{
						"secretId": name,
						"url":      "jdbc:sqlserver:exampledbserver.database.windows.net:1433;database=exampledatabase",
					})
					if err != nil {
						return _zero, err
					}
					json1 := string(tmpJSON1)
					return pulumi.String(json1), nil
				}).(pulumi.StringOutput),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_secretsmanager_secret" "example" {
  name = "example-secret"
}
resource "aws_secretsmanager_secretversion" "example" {
  secret_id = aws_secretsmanager_secret.example.id
  secret_string = jsonencode({
    "username" = "exampleusername"
    "password" = "examplepassword"
  })
}
resource "aws_glue_connection" "example" {
  name            = "example"
  connection_type = "AZURECOSMOS"
  connection_properties = {
    "SparkProperties" = jsonencode({
      "secretId" = aws_secretsmanager_secret.example.name
      "url"      = "jdbc:sqlserver:exampledbserver.database.windows.net:1433;database=exampledatabase"
    })
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.secretsmanager.Secret;
import com.pulumi.aws.secretsmanager.SecretArgs;
import com.pulumi.aws.secretsmanager.SecretVersion;
import com.pulumi.aws.secretsmanager.SecretVersionArgs;
import com.pulumi.aws.glue.Connection;
import com.pulumi.aws.glue.ConnectionArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new Secret("example", SecretArgs.builder()
            .name("example-secret")
            .build());

        var exampleSecretVersion = new SecretVersion("exampleSecretVersion", SecretVersionArgs.builder()
            .secretId(example.id())
            .secretString(serializeJson(
                jsonObject(
                    jsonProperty("username", "exampleusername"),
                    jsonProperty("password", "examplepassword")
                )))
            .build());

        var exampleConnection = new Connection("exampleConnection", ConnectionArgs.builder()
            .name("example")
            .connectionType("AZURECOSMOS")
            .connectionProperties(Map.of("SparkProperties", example.name().applyValue(_name -> serializeJson(
                jsonObject(
                    jsonProperty("secretId", _name),
                    jsonProperty("url", "jdbc:sqlserver:exampledbserver.database.windows.net:1433;database=exampledatabase")
                )))))
            .build());

    }
}
resources:
  example:
    type: aws:secretsmanager:Secret
    properties:
      name: example-secret
  exampleSecretVersion:
    type: aws:secretsmanager:SecretVersion
    name: example
    properties:
      secretId: ${example.id}
      secretString:
        fn::toJSON:
          username: exampleusername
          password: examplepassword
  exampleConnection:
    type: aws:glue:Connection
    name: example
    properties:
      name: example
      connectionType: AZURECOSMOS
      connectionProperties:
        SparkProperties:
          fn::toJSON:
            secretId: ${example.name}
            url: jdbc:sqlserver:exampledbserver.database.windows.net:1433;database=exampledatabase

Google BigQuery Connection

For more information, see the AWS Documentation.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as std from "@pulumi/std";

const example = new aws.secretsmanager.Secret("example", {name: "example-secret"});
const exampleSecretVersion = new aws.secretsmanager.SecretVersion("example", {
    secretId: example.id,
    secretString: JSON.stringify({
        credentials: std.base64encode({
            input: `{
  \\"type\\": \\"service_account\\",
  \\"project_id\\": \\"example-project\\",
  \\"private_key_id\\": \\"example-key\\",
  \\"private_key\\": \\"-----BEGIN RSA PRIVATE KEY-----\\
REDACTED\\
-----END RSA PRIVATE KEY-----\\",
  \\"client_email\\": \\"example-project@appspot.gserviceaccount.com\\",
  \\"client_id\\": example-client\\",
  \\"auth_uri\\": \\"https://accounts.google.com/o/oauth2/auth\\",
  \\"token_uri\\": \\"https://oauth2.googleapis.com/token\\",
  \\"auth_provider_x509_cert_url\\": \\"https://www.googleapis.com/oauth2/v1/certs\\",
  \\"client_x509_cert_url\\": \\"https://www.googleapis.com/robot/v1/metadata/x509/example-project%%40appspot.gserviceaccount.com\\",
  \\"universe_domain\\": \\"googleapis.com\\"
}
`,
        }).then(invoke => invoke.result),
    }),
});
const exampleConnection = new aws.glue.Connection("example", {
    name: "example",
    connectionType: "BIGQUERY",
    connectionProperties: {
        SparkProperties: pulumi.jsonStringify({
            secretId: example.name,
        }),
    },
});
import pulumi
import json
import pulumi_aws as aws
import pulumi_std as std

example = aws.secretsmanager.Secret("example", name="example-secret")
example_secret_version = aws.secretsmanager.SecretVersion("example",
    secret_id=example.id,
    secret_string=json.dumps({
        "credentials": std.base64encode(input="""{
  \"type\": \"service_account\",
  \"project_id\": \"example-project\",
  \"private_key_id\": \"example-key\",
  \"private_key\": \"-----BEGIN RSA PRIVATE KEY-----\
REDACTED\
-----END RSA PRIVATE KEY-----\",
  \"client_email\": \"example-project@appspot.gserviceaccount.com\",
  \"client_id\": example-client\",
  \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",
  \"token_uri\": \"https://oauth2.googleapis.com/token\",
  \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",
  \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/example-project%%40appspot.gserviceaccount.com\",
  \"universe_domain\": \"googleapis.com\"
}
""").result,
    }))
example_connection = aws.glue.Connection("example",
    name="example",
    connection_type="BIGQUERY",
    connection_properties={
        "SparkProperties": pulumi.Output.json_dumps({
            "secretId": example.name,
        }),
    })
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
using Std = Pulumi.Std;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.SecretsManager.Secret("example", new()
    {
        Name = "example-secret",
    });

    var exampleSecretVersion = new Aws.SecretsManager.SecretVersion("example", new()
    {
        SecretId = example.Id,
        SecretString = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["credentials"] = Std.Base64encode.Invoke(new()
            {
                Input = @"{
  \""type\"": \""service_account\"",
  \""project_id\"": \""example-project\"",
  \""private_key_id\"": \""example-key\"",
  \""private_key\"": \""-----BEGIN RSA PRIVATE KEY-----\
REDACTED\
-----END RSA PRIVATE KEY-----\"",
  \""client_email\"": \""example-project@appspot.gserviceaccount.com\"",
  \""client_id\"": example-client\"",
  \""auth_uri\"": \""https://accounts.google.com/o/oauth2/auth\"",
  \""token_uri\"": \""https://oauth2.googleapis.com/token\"",
  \""auth_provider_x509_cert_url\"": \""https://www.googleapis.com/oauth2/v1/certs\"",
  \""client_x509_cert_url\"": \""https://www.googleapis.com/robot/v1/metadata/x509/example-project%%40appspot.gserviceaccount.com\"",
  \""universe_domain\"": \""googleapis.com\""
}
",
            }).Apply(invoke => invoke.Result),
        }),
    });

    var exampleConnection = new Aws.Glue.Connection("example", new()
    {
        Name = "example",
        ConnectionType = "BIGQUERY",
        ConnectionProperties =
        {
            { "SparkProperties", Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
            {
                ["secretId"] = example.Name,
            })) },
        },
    });

});
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/secretsmanager"
	"github.com/pulumi/pulumi-std/sdk/go/std"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := secretsmanager.NewSecret(ctx, "example", &secretsmanager.SecretArgs{
			Name: pulumi.String("example-secret"),
		})
		if err != nil {
			return err
		}
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"credentials": std.Base64encode(ctx, &std.Base64encodeArgs{
				Input: `{
  \"type\": \"service_account\",
  \"project_id\": \"example-project\",
  \"private_key_id\": \"example-key\",
  \"private_key\": \"-----BEGIN RSA PRIVATE KEY-----\
REDACTED\
-----END RSA PRIVATE KEY-----\",
  \"client_email\": \"example-project@appspot.gserviceaccount.com\",
  \"client_id\": example-client\",
  \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",
  \"token_uri\": \"https://oauth2.googleapis.com/token\",
  \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",
  \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/example-project%%40appspot.gserviceaccount.com\",
  \"universe_domain\": \"googleapis.com\"
}
`,
			}, nil).Result,
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = secretsmanager.NewSecretVersion(ctx, "example", &secretsmanager.SecretVersionArgs{
			SecretId:     example.ID().ToIDOutput().ToStringOutput(),
			SecretString: json0,
		})
		if err != nil {
			return err
		}
		_, err = glue.NewConnection(ctx, "example", &glue.ConnectionArgs{
			Name:           pulumi.String("example"),
			ConnectionType: pulumi.String("BIGQUERY"),
			ConnectionProperties: pulumi.StringMap{
				"SparkProperties": example.Name.ApplyT(func(name string) (pulumi.String, error) {
					var _zero pulumi.String
					tmpJSON1, err := json.Marshal(map[string]string{
						"secretId": name,
					})
					if err != nil {
						return _zero, err
					}
					json1 := string(tmpJSON1)
					return pulumi.String(json1), nil
				}).(pulumi.StringOutput),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
    std = {
      source = "pulumi/std"
    }
  }
}

resource "aws_secretsmanager_secret" "example" {
  name = "example-secret"
}
resource "aws_secretsmanager_secretversion" "example" {
  secret_id = aws_secretsmanager_secret.example.id
  secret_string = jsonencode({
    "credentials" = base64encode("{\n  \\\"type\\\": \\\"service_account\\\",\n  \\\"project_id\\\": \\\"example-project\\\",\n  \\\"private_key_id\\\": \\\"example-key\\\",\n  \\\"private_key\\\": \\\"-----BEGIN RSA PRIVATE KEY-----\\\nREDACTED\\\n-----END RSA PRIVATE KEY-----\\\",\n  \\\"client_email\\\": \\\"example-project@appspot.gserviceaccount.com\\\",\n  \\\"client_id\\\": example-client\\\",\n  \\\"auth_uri\\\": \\\"https://accounts.google.com/o/oauth2/auth\\\",\n  \\\"token_uri\\\": \\\"https://oauth2.googleapis.com/token\\\",\n  \\\"auth_provider_x509_cert_url\\\": \\\"https://www.googleapis.com/oauth2/v1/certs\\\",\n  \\\"client_x509_cert_url\\\": \\\"https://www.googleapis.com/robot/v1/metadata/x509/example-project%%40appspot.gserviceaccount.com\\\",\n  \\\"universe_domain\\\": \\\"googleapis.com\\\"\n}\n")
  })
}
resource "aws_glue_connection" "example" {
  name            = "example"
  connection_type = "BIGQUERY"
  connection_properties = {
    "SparkProperties" = jsonencode({
      "secretId" = aws_secretsmanager_secret.example.name
    })
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.secretsmanager.Secret;
import com.pulumi.aws.secretsmanager.SecretArgs;
import com.pulumi.aws.secretsmanager.SecretVersion;
import com.pulumi.aws.secretsmanager.SecretVersionArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.Base64encodeArgs;
import com.pulumi.aws.glue.Connection;
import com.pulumi.aws.glue.ConnectionArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new Secret("example", SecretArgs.builder()
            .name("example-secret")
            .build());

        var exampleSecretVersion = new SecretVersion("exampleSecretVersion", SecretVersionArgs.builder()
            .secretId(example.id())
            .secretString(serializeJson(
                jsonObject(
                    jsonProperty("credentials", StdFunctions.base64encode(Base64encodeArgs.builder()
                        .input("""
{
  \"type\": \"service_account\",
  \"project_id\": \"example-project\",
  \"private_key_id\": \"example-key\",
  \"private_key\": \"-----BEGIN RSA PRIVATE KEY-----\
REDACTED\
-----END RSA PRIVATE KEY-----\",
  \"client_email\": \"example-project@appspot.gserviceaccount.com\",
  \"client_id\": example-client\",
  \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",
  \"token_uri\": \"https://oauth2.googleapis.com/token\",
  \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",
  \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/example-project%%40appspot.gserviceaccount.com\",
  \"universe_domain\": \"googleapis.com\"
}
                        """)
                        .build()).result())
                )))
            .build());

        var exampleConnection = new Connection("exampleConnection", ConnectionArgs.builder()
            .name("example")
            .connectionType("BIGQUERY")
            .connectionProperties(Map.of("SparkProperties", example.name().applyValue(_name -> serializeJson(
                jsonObject(
                    jsonProperty("secretId", _name)
                )))))
            .build());

    }
}
resources:
  example:
    type: aws:secretsmanager:Secret
    properties:
      name: example-secret
  exampleSecretVersion:
    type: aws:secretsmanager:SecretVersion
    name: example
    properties:
      secretId: ${example.id}
      secretString:
        fn::toJSON:
          credentials:
            fn::invoke:
              function: std:base64encode
              arguments:
                input: |
                  {
                    \"type\": \"service_account\",
                    \"project_id\": \"example-project\",
                    \"private_key_id\": \"example-key\",
                    \"private_key\": \"-----BEGIN RSA PRIVATE KEY-----\
                  REDACTED\
                  -----END RSA PRIVATE KEY-----\",
                    \"client_email\": \"example-project@appspot.gserviceaccount.com\",
                    \"client_id\": example-client\",
                    \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",
                    \"token_uri\": \"https://oauth2.googleapis.com/token\",
                    \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",
                    \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/example-project%%40appspot.gserviceaccount.com\",
                    \"universe_domain\": \"googleapis.com\"
                  }
              return: result
  exampleConnection:
    type: aws:glue:Connection
    name: example
    properties:
      name: example
      connectionType: BIGQUERY
      connectionProperties:
        SparkProperties:
          fn::toJSON:
            secretId: ${example.name}

OpenSearch Service Connection

For more information, see the AWS Documentation.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.secretsmanager.Secret("example", {name: "example-secret"});
const exampleSecretVersion = new aws.secretsmanager.SecretVersion("example", {
    secretId: example.id,
    secretString: JSON.stringify({
        "opensearch.net.http.auth.user": "exampleusername",
        "opensearch.net.http.auth.pass": "examplepassword",
    }),
});
const exampleConnection = new aws.glue.Connection("example", {
    name: "example",
    connectionType: "OPENSEARCH",
    connectionProperties: {
        SparkProperties: pulumi.jsonStringify({
            secretId: example.name,
            "opensearch.nodes": "https://search-exampledomain-ixlmh4jieahrau3bfebcgp8cnm.us-east-1.es.amazonaws.com",
            "opensearch.port": "443",
            "opensearch.aws.sigv4.region": "us-east-1",
            "opensearch.nodes.wan.only": "true",
            "opensearch.aws.sigv4.enabled": "true",
        }),
    },
});
import pulumi
import json
import pulumi_aws as aws

example = aws.secretsmanager.Secret("example", name="example-secret")
example_secret_version = aws.secretsmanager.SecretVersion("example",
    secret_id=example.id,
    secret_string=json.dumps({
        "opensearch.net.http.auth.user": "exampleusername",
        "opensearch.net.http.auth.pass": "examplepassword",
    }))
example_connection = aws.glue.Connection("example",
    name="example",
    connection_type="OPENSEARCH",
    connection_properties={
        "SparkProperties": pulumi.Output.json_dumps({
            "secretId": example.name,
            "opensearch.nodes": "https://search-exampledomain-ixlmh4jieahrau3bfebcgp8cnm.us-east-1.es.amazonaws.com",
            "opensearch.port": "443",
            "opensearch.aws.sigv4.region": "us-east-1",
            "opensearch.nodes.wan.only": "true",
            "opensearch.aws.sigv4.enabled": "true",
        }),
    })
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.SecretsManager.Secret("example", new()
    {
        Name = "example-secret",
    });

    var exampleSecretVersion = new Aws.SecretsManager.SecretVersion("example", new()
    {
        SecretId = example.Id,
        SecretString = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["opensearch.net.http.auth.user"] = "exampleusername",
            ["opensearch.net.http.auth.pass"] = "examplepassword",
        }),
    });

    var exampleConnection = new Aws.Glue.Connection("example", new()
    {
        Name = "example",
        ConnectionType = "OPENSEARCH",
        ConnectionProperties =
        {
            { "SparkProperties", Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
            {
                ["secretId"] = example.Name,
                ["opensearch.nodes"] = "https://search-exampledomain-ixlmh4jieahrau3bfebcgp8cnm.us-east-1.es.amazonaws.com",
                ["opensearch.port"] = "443",
                ["opensearch.aws.sigv4.region"] = "us-east-1",
                ["opensearch.nodes.wan.only"] = "true",
                ["opensearch.aws.sigv4.enabled"] = "true",
            })) },
        },
    });

});
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/secretsmanager"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := secretsmanager.NewSecret(ctx, "example", &secretsmanager.SecretArgs{
			Name: pulumi.String("example-secret"),
		})
		if err != nil {
			return err
		}
		tmpJSON0, err := json.Marshal(map[string]string{
			"opensearch.net.http.auth.user": "exampleusername",
			"opensearch.net.http.auth.pass": "examplepassword",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = secretsmanager.NewSecretVersion(ctx, "example", &secretsmanager.SecretVersionArgs{
			SecretId:     example.ID().ToIDOutput().ToStringOutput(),
			SecretString: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		_, err = glue.NewConnection(ctx, "example", &glue.ConnectionArgs{
			Name:           pulumi.String("example"),
			ConnectionType: pulumi.String("OPENSEARCH"),
			ConnectionProperties: pulumi.StringMap{
				"SparkProperties": example.Name.ApplyT(func(name string) (pulumi.String, error) {
					var _zero pulumi.String
					tmpJSON1, err := json.Marshal(map[string]string{
						"secretId":                     name,
						"opensearch.nodes":             "https://search-exampledomain-ixlmh4jieahrau3bfebcgp8cnm.us-east-1.es.amazonaws.com",
						"opensearch.port":              "443",
						"opensearch.aws.sigv4.region":  "us-east-1",
						"opensearch.nodes.wan.only":    "true",
						"opensearch.aws.sigv4.enabled": "true",
					})
					if err != nil {
						return _zero, err
					}
					json1 := string(tmpJSON1)
					return pulumi.String(json1), nil
				}).(pulumi.StringOutput),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_secretsmanager_secret" "example" {
  name = "example-secret"
}
resource "aws_secretsmanager_secretversion" "example" {
  secret_id = aws_secretsmanager_secret.example.id
  secret_string = jsonencode({
    "opensearch.net.http.auth.user" = "exampleusername"
    "opensearch.net.http.auth.pass" = "examplepassword"
  })
}
resource "aws_glue_connection" "example" {
  name            = "example"
  connection_type = "OPENSEARCH"
  connection_properties = {
    "SparkProperties" = jsonencode({
      "secretId"                     = aws_secretsmanager_secret.example.name
      "opensearch.nodes"             = "https://search-exampledomain-ixlmh4jieahrau3bfebcgp8cnm.us-east-1.es.amazonaws.com"
      "opensearch.port"              = "443"
      "opensearch.aws.sigv4.region"  = "us-east-1"
      "opensearch.nodes.wan.only"    = "true"
      "opensearch.aws.sigv4.enabled" = "true"
    })
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.secretsmanager.Secret;
import com.pulumi.aws.secretsmanager.SecretArgs;
import com.pulumi.aws.secretsmanager.SecretVersion;
import com.pulumi.aws.secretsmanager.SecretVersionArgs;
import com.pulumi.aws.glue.Connection;
import com.pulumi.aws.glue.ConnectionArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new Secret("example", SecretArgs.builder()
            .name("example-secret")
            .build());

        var exampleSecretVersion = new SecretVersion("exampleSecretVersion", SecretVersionArgs.builder()
            .secretId(example.id())
            .secretString(serializeJson(
                jsonObject(
                    jsonProperty("opensearch.net.http.auth.user", "exampleusername"),
                    jsonProperty("opensearch.net.http.auth.pass", "examplepassword")
                )))
            .build());

        var exampleConnection = new Connection("exampleConnection", ConnectionArgs.builder()
            .name("example")
            .connectionType("OPENSEARCH")
            .connectionProperties(Map.of("SparkProperties", example.name().applyValue(_name -> serializeJson(
                jsonObject(
                    jsonProperty("secretId", _name),
                    jsonProperty("opensearch.nodes", "https://search-exampledomain-ixlmh4jieahrau3bfebcgp8cnm.us-east-1.es.amazonaws.com"),
                    jsonProperty("opensearch.port", "443"),
                    jsonProperty("opensearch.aws.sigv4.region", "us-east-1"),
                    jsonProperty("opensearch.nodes.wan.only", "true"),
                    jsonProperty("opensearch.aws.sigv4.enabled", "true")
                )))))
            .build());

    }
}
resources:
  example:
    type: aws:secretsmanager:Secret
    properties:
      name: example-secret
  exampleSecretVersion:
    type: aws:secretsmanager:SecretVersion
    name: example
    properties:
      secretId: ${example.id}
      secretString:
        fn::toJSON:
          opensearch.net.http.auth.user: exampleusername
          opensearch.net.http.auth.pass: examplepassword
  exampleConnection:
    type: aws:glue:Connection
    name: example
    properties:
      name: example
      connectionType: OPENSEARCH
      connectionProperties:
        SparkProperties:
          fn::toJSON:
            secretId: ${example.name}
            opensearch.nodes: https://search-exampledomain-ixlmh4jieahrau3bfebcgp8cnm.us-east-1.es.amazonaws.com
            opensearch.port: '443'
            opensearch.aws.sigv4.region: us-east-1
            opensearch.nodes.wan.only: 'true'
            opensearch.aws.sigv4.enabled: 'true'

Snowflake Connection

For more information, see the AWS Documentation.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.secretsmanager.Secret("example", {name: "example-secret"});
const exampleSecretVersion = new aws.secretsmanager.SecretVersion("example", {
    secretId: example.id,
    secretString: JSON.stringify({
        sfUser: "exampleusername",
        sfPassword: "examplepassword",
    }),
});
const exampleConnection = new aws.glue.Connection("example", {
    name: "example",
    connectionType: "SNOWFLAKE",
    connectionProperties: {
        SparkProperties: pulumi.jsonStringify({
            secretId: example.name,
            sfRole: "EXAMPLEETLROLE",
            sfUrl: "exampleorg-exampleconnection.snowflakecomputing.com",
        }),
    },
});
import pulumi
import json
import pulumi_aws as aws

example = aws.secretsmanager.Secret("example", name="example-secret")
example_secret_version = aws.secretsmanager.SecretVersion("example",
    secret_id=example.id,
    secret_string=json.dumps({
        "sfUser": "exampleusername",
        "sfPassword": "examplepassword",
    }))
example_connection = aws.glue.Connection("example",
    name="example",
    connection_type="SNOWFLAKE",
    connection_properties={
        "SparkProperties": pulumi.Output.json_dumps({
            "secretId": example.name,
            "sfRole": "EXAMPLEETLROLE",
            "sfUrl": "exampleorg-exampleconnection.snowflakecomputing.com",
        }),
    })
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.SecretsManager.Secret("example", new()
    {
        Name = "example-secret",
    });

    var exampleSecretVersion = new Aws.SecretsManager.SecretVersion("example", new()
    {
        SecretId = example.Id,
        SecretString = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["sfUser"] = "exampleusername",
            ["sfPassword"] = "examplepassword",
        }),
    });

    var exampleConnection = new Aws.Glue.Connection("example", new()
    {
        Name = "example",
        ConnectionType = "SNOWFLAKE",
        ConnectionProperties =
        {
            { "SparkProperties", Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
            {
                ["secretId"] = example.Name,
                ["sfRole"] = "EXAMPLEETLROLE",
                ["sfUrl"] = "exampleorg-exampleconnection.snowflakecomputing.com",
            })) },
        },
    });

});
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/secretsmanager"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := secretsmanager.NewSecret(ctx, "example", &secretsmanager.SecretArgs{
			Name: pulumi.String("example-secret"),
		})
		if err != nil {
			return err
		}
		tmpJSON0, err := json.Marshal(map[string]string{
			"sfUser":     "exampleusername",
			"sfPassword": "examplepassword",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = secretsmanager.NewSecretVersion(ctx, "example", &secretsmanager.SecretVersionArgs{
			SecretId:     example.ID().ToIDOutput().ToStringOutput(),
			SecretString: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		_, err = glue.NewConnection(ctx, "example", &glue.ConnectionArgs{
			Name:           pulumi.String("example"),
			ConnectionType: pulumi.String("SNOWFLAKE"),
			ConnectionProperties: pulumi.StringMap{
				"SparkProperties": example.Name.ApplyT(func(name string) (pulumi.String, error) {
					var _zero pulumi.String
					tmpJSON1, err := json.Marshal(map[string]string{
						"secretId": name,
						"sfRole":   "EXAMPLEETLROLE",
						"sfUrl":    "exampleorg-exampleconnection.snowflakecomputing.com",
					})
					if err != nil {
						return _zero, err
					}
					json1 := string(tmpJSON1)
					return pulumi.String(json1), nil
				}).(pulumi.StringOutput),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_secretsmanager_secret" "example" {
  name = "example-secret"
}
resource "aws_secretsmanager_secretversion" "example" {
  secret_id = aws_secretsmanager_secret.example.id
  secret_string = jsonencode({
    "sfUser"     = "exampleusername"
    "sfPassword" = "examplepassword"
  })
}
resource "aws_glue_connection" "example" {
  name            = "example"
  connection_type = "SNOWFLAKE"
  connection_properties = {
    "SparkProperties" = jsonencode({
      "secretId" = aws_secretsmanager_secret.example.name
      "sfRole"   = "EXAMPLEETLROLE"
      "sfUrl"    = "exampleorg-exampleconnection.snowflakecomputing.com"
    })
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.secretsmanager.Secret;
import com.pulumi.aws.secretsmanager.SecretArgs;
import com.pulumi.aws.secretsmanager.SecretVersion;
import com.pulumi.aws.secretsmanager.SecretVersionArgs;
import com.pulumi.aws.glue.Connection;
import com.pulumi.aws.glue.ConnectionArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new Secret("example", SecretArgs.builder()
            .name("example-secret")
            .build());

        var exampleSecretVersion = new SecretVersion("exampleSecretVersion", SecretVersionArgs.builder()
            .secretId(example.id())
            .secretString(serializeJson(
                jsonObject(
                    jsonProperty("sfUser", "exampleusername"),
                    jsonProperty("sfPassword", "examplepassword")
                )))
            .build());

        var exampleConnection = new Connection("exampleConnection", ConnectionArgs.builder()
            .name("example")
            .connectionType("SNOWFLAKE")
            .connectionProperties(Map.of("SparkProperties", example.name().applyValue(_name -> serializeJson(
                jsonObject(
                    jsonProperty("secretId", _name),
                    jsonProperty("sfRole", "EXAMPLEETLROLE"),
                    jsonProperty("sfUrl", "exampleorg-exampleconnection.snowflakecomputing.com")
                )))))
            .build());

    }
}
resources:
  example:
    type: aws:secretsmanager:Secret
    properties:
      name: example-secret
  exampleSecretVersion:
    type: aws:secretsmanager:SecretVersion
    name: example
    properties:
      secretId: ${example.id}
      secretString:
        fn::toJSON:
          sfUser: exampleusername
          sfPassword: examplepassword
  exampleConnection:
    type: aws:glue:Connection
    name: example
    properties:
      name: example
      connectionType: SNOWFLAKE
      connectionProperties:
        SparkProperties:
          fn::toJSON:
            secretId: ${example.name}
            sfRole: EXAMPLEETLROLE
            sfUrl: exampleorg-exampleconnection.snowflakecomputing.com

DynamoDB Connection

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.glue.Connection("test", {
    name: "example",
    connectionType: "DYNAMODB",
    athenaProperties: {
        lambda_function_arn: "arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_athena_abcdefgh",
        disable_spill_encryption: "false",
        spill_bucket: "example-bucket",
    },
});
import pulumi
import pulumi_aws as aws

test = aws.glue.Connection("test",
    name="example",
    connection_type="DYNAMODB",
    athena_properties={
        "lambda_function_arn": "arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_athena_abcdefgh",
        "disable_spill_encryption": "false",
        "spill_bucket": "example-bucket",
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var test = new Aws.Glue.Connection("test", new()
    {
        Name = "example",
        ConnectionType = "DYNAMODB",
        AthenaProperties =
        {
            { "lambda_function_arn", "arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_athena_abcdefgh" },
            { "disable_spill_encryption", "false" },
            { "spill_bucket", "example-bucket" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := glue.NewConnection(ctx, "test", &glue.ConnectionArgs{
			Name:           pulumi.String("example"),
			ConnectionType: pulumi.String("DYNAMODB"),
			AthenaProperties: pulumi.StringMap{
				"lambda_function_arn":      pulumi.String("arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_athena_abcdefgh"),
				"disable_spill_encryption": pulumi.String("false"),
				"spill_bucket":             pulumi.String("example-bucket"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_glue_connection" "test" {
  name            = "example"
  connection_type = "DYNAMODB"
  athena_properties = {
    "lambda_function_arn"      = "arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_athena_abcdefgh"
    "disable_spill_encryption" = "false"
    "spill_bucket"             = "example-bucket"
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glue.Connection;
import com.pulumi.aws.glue.ConnectionArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var test = new Connection("test", ConnectionArgs.builder()
            .name("example")
            .connectionType("DYNAMODB")
            .athenaProperties(Map.ofEntries(
                Map.entry("lambda_function_arn", "arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_athena_abcdefgh"),
                Map.entry("disable_spill_encryption", "false"),
                Map.entry("spill_bucket", "example-bucket")
            ))
            .build());

    }
}
resources:
  test:
    type: aws:glue:Connection
    properties:
      name: example
      connectionType: DYNAMODB
      athenaProperties:
        lambda_function_arn: arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_athena_abcdefgh
        disable_spill_encryption: 'false'
        spill_bucket: example-bucket

MySQL Federated Connection

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.glue.Connection("example", {
    authenticationConfiguration: {
        authenticationType: "BASIC",
        secretArn: exampleAwsSecretsmanagerSecret.arn,
    },
    physicalConnectionRequirements: {
        availabilityZone: exampleAwsSubnet.availabilityZone,
        securityGroupIdLists: [exampleAwsSecurityGroup.id],
        subnetId: exampleAwsSubnet.id,
    },
    name: "athenafederatedcatalog_mysql",
    connectionType: "MYSQL",
    athenaProperties: {
        lambda_function_arn: "arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_mysql",
        spill_bucket: exampleAwsS3Bucket.bucket,
    },
    connectionProperties: {
        HOST: exampleAwsRdsCluster.endpoint,
        PORT: exampleAwsRdsCluster.port,
        DATABASE: exampleAwsRdsCluster.databaseName,
    },
});
import pulumi
import pulumi_aws as aws

example = aws.glue.Connection("example",
    authentication_configuration={
        "authentication_type": "BASIC",
        "secret_arn": example_aws_secretsmanager_secret["arn"],
    },
    physical_connection_requirements={
        "availability_zone": example_aws_subnet["availabilityZone"],
        "security_group_id_lists": [example_aws_security_group["id"]],
        "subnet_id": example_aws_subnet["id"],
    },
    name="athenafederatedcatalog_mysql",
    connection_type="MYSQL",
    athena_properties={
        "lambda_function_arn": "arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_mysql",
        "spill_bucket": example_aws_s3_bucket["bucket"],
    },
    connection_properties={
        "HOST": example_aws_rds_cluster["endpoint"],
        "PORT": example_aws_rds_cluster["port"],
        "DATABASE": example_aws_rds_cluster["databaseName"],
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Glue.Connection("example", new()
    {
        AuthenticationConfiguration = new Aws.Glue.Inputs.ConnectionAuthenticationConfigurationArgs
        {
            AuthenticationType = "BASIC",
            SecretArn = exampleAwsSecretsmanagerSecret.Arn,
        },
        PhysicalConnectionRequirements = new Aws.Glue.Inputs.ConnectionPhysicalConnectionRequirementsArgs
        {
            AvailabilityZone = exampleAwsSubnet.AvailabilityZone,
            SecurityGroupIdLists = new[]
            {
                exampleAwsSecurityGroup.Id,
            },
            SubnetId = exampleAwsSubnet.Id,
        },
        Name = "athenafederatedcatalog_mysql",
        ConnectionType = "MYSQL",
        AthenaProperties =
        {
            { "lambda_function_arn", "arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_mysql" },
            { "spill_bucket", exampleAwsS3Bucket.Bucket },
        },
        ConnectionProperties =
        {
            { "HOST", exampleAwsRdsCluster.Endpoint },
            { "PORT", exampleAwsRdsCluster.Port },
            { "DATABASE", exampleAwsRdsCluster.DatabaseName },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/glue"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := glue.NewConnection(ctx, "example", &glue.ConnectionArgs{
			AuthenticationConfiguration: &glue.ConnectionAuthenticationConfigurationArgs{
				AuthenticationType: pulumi.String("BASIC"),
				SecretArn:          pulumi.Any(exampleAwsSecretsmanagerSecret.Arn),
			},
			PhysicalConnectionRequirements: &glue.ConnectionPhysicalConnectionRequirementsArgs{
				AvailabilityZone: pulumi.Any(exampleAwsSubnet.AvailabilityZone),
				SecurityGroupIdLists: pulumi.StringArray{
					exampleAwsSecurityGroup.Id,
				},
				SubnetId: pulumi.Any(exampleAwsSubnet.Id),
			},
			Name:           pulumi.String("athenafederatedcatalog_mysql"),
			ConnectionType: pulumi.String("MYSQL"),
			AthenaProperties: pulumi.StringMap{
				"lambda_function_arn": pulumi.String("arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_mysql"),
				"spill_bucket":        pulumi.Any(exampleAwsS3Bucket.Bucket),
			},
			ConnectionProperties: pulumi.StringMap{
				"HOST":     pulumi.Any(exampleAwsRdsCluster.Endpoint),
				"PORT":     pulumi.Any(exampleAwsRdsCluster.Port),
				"DATABASE": pulumi.Any(exampleAwsRdsCluster.DatabaseName),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_glue_connection" "example" {
  authentication_configuration = {
    authentication_type = "BASIC"
    secret_arn          = exampleAwsSecretsmanagerSecret.arn
  }
  physical_connection_requirements = {
    availability_zone       = exampleAwsSubnet.availabilityZone
    security_group_id_lists = [exampleAwsSecurityGroup.id]
    subnet_id               = exampleAwsSubnet.id
  }
  name            = "athenafederatedcatalog_mysql"
  connection_type = "MYSQL"
  athena_properties = {
    "lambda_function_arn" = "arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_mysql"
    "spill_bucket"        = exampleAwsS3Bucket.bucket
  }
  connection_properties = {
    "HOST"     = exampleAwsRdsCluster.endpoint
    "PORT"     = exampleAwsRdsCluster.port
    "DATABASE" = exampleAwsRdsCluster.databaseName
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glue.Connection;
import com.pulumi.aws.glue.ConnectionArgs;
import com.pulumi.aws.glue.inputs.ConnectionAuthenticationConfigurationArgs;
import com.pulumi.aws.glue.inputs.ConnectionPhysicalConnectionRequirementsArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new Connection("example", ConnectionArgs.builder()
            .authenticationConfiguration(ConnectionAuthenticationConfigurationArgs.builder()
                .authenticationType("BASIC")
                .secretArn(exampleAwsSecretsmanagerSecret.arn())
                .build())
            .physicalConnectionRequirements(ConnectionPhysicalConnectionRequirementsArgs.builder()
                .availabilityZone(exampleAwsSubnet.availabilityZone())
                .securityGroupIdLists(exampleAwsSecurityGroup.id())
                .subnetId(exampleAwsSubnet.id())
                .build())
            .name("athenafederatedcatalog_mysql")
            .connectionType("MYSQL")
            .athenaProperties(Map.ofEntries(
                Map.entry("lambda_function_arn", "arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_mysql"),
                Map.entry("spill_bucket", exampleAwsS3Bucket.bucket())
            ))
            .connectionProperties(Map.ofEntries(
                Map.entry("HOST", exampleAwsRdsCluster.endpoint()),
                Map.entry("PORT", exampleAwsRdsCluster.port()),
                Map.entry("DATABASE", exampleAwsRdsCluster.databaseName())
            ))
            .build());

    }
}
resources:
  example:
    type: aws:glue:Connection
    properties:
      authenticationConfiguration:
        authenticationType: BASIC
        secretArn: ${exampleAwsSecretsmanagerSecret.arn}
      physicalConnectionRequirements:
        availabilityZone: ${exampleAwsSubnet.availabilityZone}
        securityGroupIdLists:
          - ${exampleAwsSecurityGroup.id}
        subnetId: ${exampleAwsSubnet.id}
      name: athenafederatedcatalog_mysql
      connectionType: MYSQL
      athenaProperties:
        lambda_function_arn: arn:aws:lambda:us-east-1:123456789012:function:athenafederatedcatalog_mysql
        spill_bucket: ${exampleAwsS3Bucket.bucket}
      connectionProperties:
        HOST: ${exampleAwsRdsCluster.endpoint}
        PORT: ${exampleAwsRdsCluster.port}
        DATABASE: ${exampleAwsRdsCluster.databaseName}

Import

Using pulumi import, import Glue Connections using the CATALOG-ID (AWS account ID if not custom) and NAME. For example:

$ pulumi import aws:glue/connection:Connection MyConnection 123456789012:MyConnection

Constructors

Connection(String name, {ConnectionArgs? args, CustomResourceOptions? options})
Creates a new Connection. name The Pulumi resource name. args Arguments used to configure this Connection. The set of arguments for Connection. options Resource options controlling this resource's behavior.
Connection.reference(String urn)
Creates a typed reference to an existing Connection resource.

Properties

arn ↔ Output<String>
ARN of the Glue Connection.
latefinal
athenaProperties ↔ Output<Map<String, String>?>
Map of key-value pairs used as connection properties specific to the Athena compute environment.
latefinal
authenticationConfiguration ↔ Output<ConnectionAuthenticationConfiguration?>
Configuration block for authentication options. See authenticationConfiguration below.
latefinal
catalogId ↔ Output<String>
ID of the Data Catalog in which to create the connection. If none is supplied, the AWS account ID is used by default.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
connectionProperties ↔ Output<Map<String, String>?>
Map of key-value pairs used as parameters for this connection. For more information, see the AWS Documentation.
latefinal
connectionType ↔ Output<String?>
Type of the connection. Valid values: AZURECOSMOS, AZURESQL, BIGQUERY, CUSTOM, DYNAMODB, JDBC, KAFKA, MARKETPLACE, MONGODB, NETWORK, OPENSEARCH, SNOWFLAKE. Defaults to JDBC. Some connection types require the SparkProperties property with a JSON document that contains the actual connection properties. For specific examples, refer to Example Usage.
latefinal
description ↔ Output<String?>
Description of the connection.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
matchCriterias ↔ Output<List<String>?>
List of criteria that can be used in selecting this connection.
latefinal
name ↔ Output<String>
Name of the connection.
latefinal
physicalConnectionRequirements ↔ Output<ConnectionPhysicalConnectionRequirements?>
Map of physical connection requirements, such as VPC and SecurityGroup. See physicalConnectionRequirements below.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tags ↔ Output<Map<String, String>?>
Key-value map of resource tags. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ConnectionState? state, CustomResourceOptions? options}) → Connection
Gets an existing Connection resource's state with the given name and id.