azurermStreamAnalyticsJobSchedule
Manages a Stream Analytics Job Schedule.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermStorageAccountExample = new azurerm.storageAccount.StorageAccount(
this,
"example_1",
{
account_replication_type: "LRS",
account_tier: "Standard",
location: azurermResourceGroupExample.location,
name: "example",
resource_group_name: azurermResourceGroupExample.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStorageAccountExample.overrideLogicalId("example");
const azurermStorageContainerExample =
new azurerm.storageContainer.StorageContainer(this, "example_2", {
container_access_type: "private",
name: "example",
storage_account_name: azurermStorageAccountExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStorageContainerExample.overrideLogicalId("example");
const azurermStreamAnalyticsJobExample =
new azurerm.streamAnalyticsJob.StreamAnalyticsJob(this, "example_3", {
compatibility_level: "1.2",
data_locale: "en-GB",
events_late_arrival_max_delay_in_seconds: 60,
events_out_of_order_max_delay_in_seconds: 50,
events_out_of_order_policy: "Adjust",
location: azurermResourceGroupExample.location,
name: "example-job",
output_error_policy: "Drop",
resource_group_name: azurermResourceGroupExample.name,
streaming_units: 3,
tags: {
environment: "Example",
},
transformation_query:
" SELECT *\n INTO [exampleoutput]\n FROM [exampleinput]\n",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStreamAnalyticsJobExample.overrideLogicalId("example");
const azurermStreamAnalyticsOutputBlobExample =
new azurerm.streamAnalyticsOutputBlob.StreamAnalyticsOutputBlob(
this,
"example_4",
{
date_format: "yyyy-MM-dd",
name: "exampleoutput",
path_pattern: "example-{date}-{time}",
resource_group_name: azurermStreamAnalyticsJobExample.resourceGroupName,
serialization: [
{
type: "Avro",
},
],
storage_account_key: azurermStorageAccountExample.primaryAccessKey,
storage_account_name: azurermStorageAccountExample.name,
storage_container_name: azurermStorageContainerExample.name,
stream_analytics_job_name: azurermStreamAnalyticsJobExample.name,
time_format: "HH",
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStreamAnalyticsOutputBlobExample.overrideLogicalId("example");
const azurermStreamAnalyticsStreamInputBlobExample =
new azurerm.streamAnalyticsStreamInputBlob.StreamAnalyticsStreamInputBlob(
this,
"example_5",
{
date_format: "yyyy/MM/dd",
name: "exampleinput",
path_pattern: "",
resource_group_name: azurermStreamAnalyticsJobExample.resourceGroupName,
serialization: [
{
encoding: "UTF8",
field_delimiter: ",",
type: "Csv",
},
],
storage_account_key: azurermStorageAccountExample.primaryAccessKey,
storage_account_name: azurermStorageAccountExample.name,
storage_container_name: azurermStorageContainerExample.name,
stream_analytics_job_name: azurermStreamAnalyticsJobExample.name,
time_format: "HH",
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStreamAnalyticsStreamInputBlobExample.overrideLogicalId("example");
const azurermStorageBlobExample = new azurerm.storageBlob.StorageBlob(
this,
"example_6",
{
name: "example",
source: "example.csv",
storage_account_name: azurermStorageAccountExample.name,
storage_container_name: azurermStorageContainerExample.name,
type: "Block",
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStorageBlobExample.overrideLogicalId("example");
const azurermStreamAnalyticsJobScheduleExample =
new azurerm.streamAnalyticsJobSchedule.StreamAnalyticsJobSchedule(
this,
"example_7",
{
depends_on: [
`\${${azurermStreamAnalyticsJobExample.fqn}}`,
`\${${azurermStreamAnalyticsStreamInputBlobExample.fqn}}`,
`\${${azurermStreamAnalyticsOutputBlobExample.fqn}}`,
],
start_mode: "CustomTime",
start_time: "2022-09-21T00:00:00Z",
stream_analytics_job_id: azurermStreamAnalyticsJobExample.id,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStreamAnalyticsJobScheduleExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
-
streamAnalyticsJobId
- (Required) The ID of the Stream Analytics Job that should be scheduled or started. Changing this forces a new resource to be created. -
startMode
- (Required) The starting mode of the Stream Analytics Job. Possible values arejobStartTime
,customTime
andlastOutputEventTime
.
-> Note: Setting startMode
to lastOutputEventTime
is only possible if the job had been previously started and produced output.
startTime
- (Optional) The time in ISO8601 format at which the Stream Analytics Job should be started e.g.20220401T00:00:00Z
. This property can only be specified ifstartMode
is set tocustomTime
Attributes Reference
The following attributes are exported in addition to the arguments listed above:
-
id
- The ID of the Stream Analytics Job. -
lastOutputTime
- The time at which the Stream Analytics job last produced an output.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Stream Analytics Job.update
- (Defaults to 30 minutes) Used when updating the Stream Analytics Job.read
- (Defaults to 5 minutes) Used when retrieving the Stream Analytics Job.delete
- (Defaults to 30 minutes) Used when deleting the Stream Analytics Job.
Import
Stream Analytics Job's can be imported using the resourceId
, e.g.