com.pulumi.azure.streamanalytics.kotlin.OutputSynapse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.streamanalytics.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [OutputSynapse].
*/
@PulumiTagMarker
public class OutputSynapseResourceBuilder internal constructor() {
public var name: String? = null
public var args: OutputSynapseArgs = OutputSynapseArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend OutputSynapseArgsBuilder.() -> Unit) {
val builder = OutputSynapseArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): OutputSynapse {
val builtJavaResource = com.pulumi.azure.streamanalytics.OutputSynapse(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return OutputSynapse(builtJavaResource)
}
}
/**
* Manages a Stream Analytics Output to an Azure Synapse Analytics Workspace.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const exampleResourceGroup = new azure.core.ResourceGroup("example", {
* name: "rg-example",
* location: "West Europe",
* });
* const example = azure.streamanalytics.getJobOutput({
* name: "example-job",
* resourceGroupName: exampleResourceGroup.name,
* });
* const exampleAccount = new azure.storage.Account("example", {
* name: "examplestorageacc",
* resourceGroupName: exampleResourceGroup.name,
* location: exampleResourceGroup.location,
* accountTier: "Standard",
* accountReplicationType: "LRS",
* accountKind: "StorageV2",
* isHnsEnabled: true,
* });
* const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("example", {
* name: "example",
* storageAccountId: exampleAccount.id,
* });
* const exampleWorkspace = new azure.synapse.Workspace("example", {
* name: "example",
* resourceGroupName: exampleResourceGroup.name,
* location: exampleResourceGroup.location,
* storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id,
* sqlAdministratorLogin: "sqladminuser",
* sqlAdministratorLoginPassword: "H@Sh1CoR3!",
* identity: {
* type: "SystemAssigned",
* },
* });
* const exampleOutputSynapse = new azure.streamanalytics.OutputSynapse("example", {
* name: "example-output-synapse",
* streamAnalyticsJobName: example.apply(example => example.name),
* resourceGroupName: example.apply(example => example.resourceGroupName),
* server: exampleWorkspace.connectivityEndpoints.sqlOnDemand,
* user: exampleWorkspace.sqlAdministratorLogin,
* password: exampleWorkspace.sqlAdministratorLoginPassword,
* database: "master",
* table: "ExampleTable",
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example_resource_group = azure.core.ResourceGroup("example",
* name="rg-example",
* location="West Europe")
* example = azure.streamanalytics.get_job_output(name="example-job",
* resource_group_name=example_resource_group.name)
* example_account = azure.storage.Account("example",
* name="examplestorageacc",
* resource_group_name=example_resource_group.name,
* location=example_resource_group.location,
* account_tier="Standard",
* account_replication_type="LRS",
* account_kind="StorageV2",
* is_hns_enabled=True)
* example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("example",
* name="example",
* storage_account_id=example_account.id)
* example_workspace = azure.synapse.Workspace("example",
* name="example",
* resource_group_name=example_resource_group.name,
* location=example_resource_group.location,
* storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id,
* sql_administrator_login="sqladminuser",
* sql_administrator_login_password="H@Sh1CoR3!",
* identity=azure.synapse.WorkspaceIdentityArgs(
* type="SystemAssigned",
* ))
* example_output_synapse = azure.streamanalytics.OutputSynapse("example",
* name="example-output-synapse",
* stream_analytics_job_name=example.name,
* resource_group_name=example.resource_group_name,
* server=example_workspace.connectivity_endpoints["sqlOnDemand"],
* user=example_workspace.sql_administrator_login,
* password=example_workspace.sql_administrator_login_password,
* database="master",
* table="ExampleTable")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "rg-example",
* Location = "West Europe",
* });
* var example = Azure.StreamAnalytics.GetJob.Invoke(new()
* {
* Name = "example-job",
* ResourceGroupName = exampleResourceGroup.Name,
* });
* var exampleAccount = new Azure.Storage.Account("example", new()
* {
* Name = "examplestorageacc",
* ResourceGroupName = exampleResourceGroup.Name,
* Location = exampleResourceGroup.Location,
* AccountTier = "Standard",
* AccountReplicationType = "LRS",
* AccountKind = "StorageV2",
* IsHnsEnabled = true,
* });
* var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("example", new()
* {
* Name = "example",
* StorageAccountId = exampleAccount.Id,
* });
* var exampleWorkspace = new Azure.Synapse.Workspace("example", new()
* {
* Name = "example",
* ResourceGroupName = exampleResourceGroup.Name,
* Location = exampleResourceGroup.Location,
* StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id,
* SqlAdministratorLogin = "sqladminuser",
* SqlAdministratorLoginPassword = "H@Sh1CoR3!",
* Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs
* {
* Type = "SystemAssigned",
* },
* });
* var exampleOutputSynapse = new Azure.StreamAnalytics.OutputSynapse("example", new()
* {
* Name = "example-output-synapse",
* StreamAnalyticsJobName = example.Apply(getJobResult => getJobResult.Name),
* ResourceGroupName = example.Apply(getJobResult => getJobResult.ResourceGroupName),
* Server = exampleWorkspace.ConnectivityEndpoints.Apply(connectivityEndpoints => connectivityEndpoints.SqlOnDemand),
* User = exampleWorkspace.SqlAdministratorLogin,
* Password = exampleWorkspace.SqlAdministratorLoginPassword,
* Database = "master",
* Table = "ExampleTable",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("rg-example"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* example := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{
* Name: pulumi.String("example-job"),
* ResourceGroupName: exampleResourceGroup.Name,
* }, nil)
* exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
* Name: pulumi.String("examplestorageacc"),
* ResourceGroupName: exampleResourceGroup.Name,
* Location: exampleResourceGroup.Location,
* AccountTier: pulumi.String("Standard"),
* AccountReplicationType: pulumi.String("LRS"),
* AccountKind: pulumi.String("StorageV2"),
* IsHnsEnabled: pulumi.Bool(true),
* })
* if err != nil {
* return err
* }
* exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "example", &storage.DataLakeGen2FilesystemArgs{
* Name: pulumi.String("example"),
* StorageAccountId: exampleAccount.ID(),
* })
* if err != nil {
* return err
* }
* exampleWorkspace, err := synapse.NewWorkspace(ctx, "example", &synapse.WorkspaceArgs{
* Name: pulumi.String("example"),
* ResourceGroupName: exampleResourceGroup.Name,
* Location: exampleResourceGroup.Location,
* StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(),
* SqlAdministratorLogin: pulumi.String("sqladminuser"),
* SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"),
* Identity: &synapse.WorkspaceIdentityArgs{
* Type: pulumi.String("SystemAssigned"),
* },
* })
* if err != nil {
* return err
* }
* _, err = streamanalytics.NewOutputSynapse(ctx, "example", &streamanalytics.OutputSynapseArgs{
* Name: pulumi.String("example-output-synapse"),
* StreamAnalyticsJobName: example.ApplyT(func(example streamanalytics.GetJobResult) (*string, error) {
* return &example.Name, nil
* }).(pulumi.StringPtrOutput),
* ResourceGroupName: example.ApplyT(func(example streamanalytics.GetJobResult) (*string, error) {
* return &example.ResourceGroupName, nil
* }).(pulumi.StringPtrOutput),
* Server: exampleWorkspace.ConnectivityEndpoints.ApplyT(func(connectivityEndpoints map[string]string) (string, error) {
* return connectivityEndpoints.SqlOnDemand, nil
* }).(pulumi.StringOutput),
* User: exampleWorkspace.SqlAdministratorLogin,
* Password: exampleWorkspace.SqlAdministratorLoginPassword,
* Database: pulumi.String("master"),
* Table: pulumi.String("ExampleTable"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.streamanalytics.StreamanalyticsFunctions;
* import com.pulumi.azure.streamanalytics.inputs.GetJobArgs;
* import com.pulumi.azure.storage.Account;
* import com.pulumi.azure.storage.AccountArgs;
* import com.pulumi.azure.storage.DataLakeGen2Filesystem;
* import com.pulumi.azure.storage.DataLakeGen2FilesystemArgs;
* import com.pulumi.azure.synapse.Workspace;
* import com.pulumi.azure.synapse.WorkspaceArgs;
* import com.pulumi.azure.synapse.inputs.WorkspaceIdentityArgs;
* import com.pulumi.azure.streamanalytics.OutputSynapse;
* import com.pulumi.azure.streamanalytics.OutputSynapseArgs;
* 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) {
* var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
* .name("rg-example")
* .location("West Europe")
* .build());
* final var example = StreamanalyticsFunctions.getJob(GetJobArgs.builder()
* .name("example-job")
* .resourceGroupName(exampleResourceGroup.name())
* .build());
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("examplestorageacc")
* .resourceGroupName(exampleResourceGroup.name())
* .location(exampleResourceGroup.location())
* .accountTier("Standard")
* .accountReplicationType("LRS")
* .accountKind("StorageV2")
* .isHnsEnabled("true")
* .build());
* var exampleDataLakeGen2Filesystem = new DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", DataLakeGen2FilesystemArgs.builder()
* .name("example")
* .storageAccountId(exampleAccount.id())
* .build());
* var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
* .name("example")
* .resourceGroupName(exampleResourceGroup.name())
* .location(exampleResourceGroup.location())
* .storageDataLakeGen2FilesystemId(exampleDataLakeGen2Filesystem.id())
* .sqlAdministratorLogin("sqladminuser")
* .sqlAdministratorLoginPassword("H@Sh1CoR3!")
* .identity(WorkspaceIdentityArgs.builder()
* .type("SystemAssigned")
* .build())
* .build());
* var exampleOutputSynapse = new OutputSynapse("exampleOutputSynapse", OutputSynapseArgs.builder()
* .name("example-output-synapse")
* .streamAnalyticsJobName(example.applyValue(getJobResult -> getJobResult).applyValue(example -> example.applyValue(getJobResult -> getJobResult.name())))
* .resourceGroupName(example.applyValue(getJobResult -> getJobResult).applyValue(example -> example.applyValue(getJobResult -> getJobResult.resourceGroupName())))
* .server(exampleWorkspace.connectivityEndpoints().applyValue(connectivityEndpoints -> connectivityEndpoints.sqlOnDemand()))
* .user(exampleWorkspace.sqlAdministratorLogin())
* .password(exampleWorkspace.sqlAdministratorLoginPassword())
* .database("master")
* .table("ExampleTable")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleResourceGroup:
* type: azure:core:ResourceGroup
* name: example
* properties:
* name: rg-example
* location: West Europe
* exampleAccount:
* type: azure:storage:Account
* name: example
* properties:
* name: examplestorageacc
* resourceGroupName: ${exampleResourceGroup.name}
* location: ${exampleResourceGroup.location}
* accountTier: Standard
* accountReplicationType: LRS
* accountKind: StorageV2
* isHnsEnabled: 'true'
* exampleDataLakeGen2Filesystem:
* type: azure:storage:DataLakeGen2Filesystem
* name: example
* properties:
* name: example
* storageAccountId: ${exampleAccount.id}
* exampleWorkspace:
* type: azure:synapse:Workspace
* name: example
* properties:
* name: example
* resourceGroupName: ${exampleResourceGroup.name}
* location: ${exampleResourceGroup.location}
* storageDataLakeGen2FilesystemId: ${exampleDataLakeGen2Filesystem.id}
* sqlAdministratorLogin: sqladminuser
* sqlAdministratorLoginPassword: H@Sh1CoR3!
* identity:
* type: SystemAssigned
* exampleOutputSynapse:
* type: azure:streamanalytics:OutputSynapse
* name: example
* properties:
* name: example-output-synapse
* streamAnalyticsJobName: ${example.name}
* resourceGroupName: ${example.resourceGroupName}
* server: ${exampleWorkspace.connectivityEndpoints.sqlOnDemand}
* user: ${exampleWorkspace.sqlAdministratorLogin}
* password: ${exampleWorkspace.sqlAdministratorLoginPassword}
* database: master
* table: ExampleTable
* variables:
* example:
* fn::invoke:
* Function: azure:streamanalytics:getJob
* Arguments:
* name: example-job
* resourceGroupName: ${exampleResourceGroup.name}
* ```
*
* ## Import
* A Stream Analytics Output to an Azure Synapse Analytics Workspace can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:streamanalytics/outputSynapse:OutputSynapse example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/outputs/output1
* ```
*/
public class OutputSynapse internal constructor(
override val javaResource: com.pulumi.azure.streamanalytics.OutputSynapse,
) : KotlinCustomResource(javaResource, OutputSynapseMapper) {
/**
* The name of the Azure SQL database. Changing this forces a new resource to be created.
*/
public val database: Output
get() = javaResource.database().applyValue({ args0 -> args0 })
/**
* The name of the Stream Output. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The password that will be used to connect to the Azure SQL database.
*/
public val password: Output
get() = javaResource.password().applyValue({ args0 -> args0 })
/**
* The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* The name of the SQL server containing the Azure SQL database. Changing this forces a new resource to be created.
*/
public val server: Output
get() = javaResource.server().applyValue({ args0 -> args0 })
/**
* The name of the Stream Analytics Job. Changing this forces a new resource to be created.
*/
public val streamAnalyticsJobName: Output
get() = javaResource.streamAnalyticsJobName().applyValue({ args0 -> args0 })
/**
* The name of the table in the Azure SQL database. Changing this forces a new resource to be created.
*/
public val table: Output
get() = javaResource.table().applyValue({ args0 -> args0 })
/**
* The user name that will be used to connect to the Azure SQL database. Changing this forces a new resource to be created.
*/
public val user: Output
get() = javaResource.user().applyValue({ args0 -> args0 })
}
public object OutputSynapseMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.streamanalytics.OutputSynapse::class == javaResource::class
override fun map(javaResource: Resource): OutputSynapse = OutputSynapse(
javaResource as
com.pulumi.azure.streamanalytics.OutputSynapse,
)
}
/**
* @see [OutputSynapse].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [OutputSynapse].
*/
public suspend fun outputSynapse(
name: String,
block: suspend OutputSynapseResourceBuilder.() -> Unit,
): OutputSynapse {
val builder = OutputSynapseResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [OutputSynapse].
* @param name The _unique_ name of the resulting resource.
*/
public fun outputSynapse(name: String): OutputSynapse {
val builder = OutputSynapseResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy