import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages an Elastic Job Step. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "example", * location: "westeurope", * }); * const exampleServer = new azure.mssql.Server("example", { * name: "example-server", * location: example.location, * resourceGroupName: example.name, * version: "12.0", * administratorLogin: "4dm1n157r470r", * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", * }); * const exampleDatabase = new azure.mssql.Database("example", { * name: "example-db", * serverId: exampleServer.id, * collation: "SQL_Latin1_General_CP1_CI_AS", * skuName: "S1", * }); * const exampleJobAgent = new azure.mssql.JobAgent("example", { * name: "example-job-agent", * location: example.location, * databaseId: exampleDatabase.id, * }); * const exampleJobCredential = new azure.mssql.JobCredential("example", { * name: "example-job-credential", * jobAgentId: exampleJobAgent.id, * username: "exampleusername", * password: "examplepassword", * }); * const exampleJobTargetGroup = new azure.mssql.JobTargetGroup("example", { * name: "example-target-group", * jobAgentId: exampleJobAgent.id, * jobTargets: [{ * serverName: exampleServer.name, * databaseName: exampleDatabase.name, * jobCredentialId: exampleJobCredential.id, * }], * }); * const exampleJob = new azure.mssql.Job("example", { * name: "example-job", * jobAgentId: exampleJobAgent.id, * description: "example description", * }); * const test = new azure.mssql.JobStep("test", { * name: "example-job-step", * jobId: exampleJob.id, * jobCredentialId: exampleJobCredential.id, * jobTargetGroupId: exampleJobTargetGroup.id, * jobStepIndex: 1, * sqlScript: `IF NOT EXISTS (SELECT * FROM sys.objects WHERE [name] = N'Pets') * CREATE TABLE Pets ( * Animal NVARCHAR(50), * Name NVARCHAR(50), * ); * `, * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.Sql` - 2023-08-01-preview * * ## Import * * Elastic Job Steps can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:mssql/jobStep:JobStep example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Sql/servers/myserver1/jobAgents/myjobagent1/jobs/myjob1/steps/myjobstep1 * ``` */ export declare class JobStep extends pulumi.CustomResource { /** * Get an existing JobStep resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: JobStepState, opts?: pulumi.CustomResourceOptions): JobStep; /** * Returns true if the given object is an instance of JobStep. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is JobStep; /** * The initial retry interval in seconds. Defaults to `1`. */ readonly initialRetryIntervalSeconds: pulumi.Output; /** * The ID of the Elastic Job Credential to use when executing this Elastic Job Step. Omit this argument to run the step under the Job Agent's managed identity (user-assigned). * * !> **Note:** Once set, `jobCredentialId` cannot be removed. Removing the credential will force a new resource to be created. */ readonly jobCredentialId: pulumi.Output; /** * The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created. */ readonly jobId: pulumi.Output; /** * The index at which to insert this Elastic Job Step into the Elastic Job. * * > **Note:** This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job. */ readonly jobStepIndex: pulumi.Output; /** * The ID of the Elastic Job Target Group. */ readonly jobTargetGroupId: pulumi.Output; /** * The maximum retry interval in seconds. Defaults to `120`. * * > **Note:** `maximumRetryIntervalSeconds` must be greater than `initialRetryIntervalSeconds`. */ readonly maximumRetryIntervalSeconds: pulumi.Output; /** * The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created. */ readonly name: pulumi.Output; /** * An `outputTarget` block as defined below. */ readonly outputTarget: pulumi.Output; /** * The number of retry attempts. Defaults to `10`. */ readonly retryAttempts: pulumi.Output; /** * The multiplier for time between retries. Defaults to `2.0`. */ readonly retryIntervalBackoffMultiplier: pulumi.Output; /** * The T-SQL script to be executed by this Elastic Job Step. * * > **Note:** While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent. */ readonly sqlScript: pulumi.Output; /** * The execution timeout in seconds for this Elastic Job Step. Defaults to `43200`. */ readonly timeoutSeconds: pulumi.Output; /** * Create a JobStep resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: JobStepArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering JobStep resources. */ export interface JobStepState { /** * The initial retry interval in seconds. Defaults to `1`. */ initialRetryIntervalSeconds?: pulumi.Input; /** * The ID of the Elastic Job Credential to use when executing this Elastic Job Step. Omit this argument to run the step under the Job Agent's managed identity (user-assigned). * * !> **Note:** Once set, `jobCredentialId` cannot be removed. Removing the credential will force a new resource to be created. */ jobCredentialId?: pulumi.Input; /** * The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created. */ jobId?: pulumi.Input; /** * The index at which to insert this Elastic Job Step into the Elastic Job. * * > **Note:** This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job. */ jobStepIndex?: pulumi.Input; /** * The ID of the Elastic Job Target Group. */ jobTargetGroupId?: pulumi.Input; /** * The maximum retry interval in seconds. Defaults to `120`. * * > **Note:** `maximumRetryIntervalSeconds` must be greater than `initialRetryIntervalSeconds`. */ maximumRetryIntervalSeconds?: pulumi.Input; /** * The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created. */ name?: pulumi.Input; /** * An `outputTarget` block as defined below. */ outputTarget?: pulumi.Input; /** * The number of retry attempts. Defaults to `10`. */ retryAttempts?: pulumi.Input; /** * The multiplier for time between retries. Defaults to `2.0`. */ retryIntervalBackoffMultiplier?: pulumi.Input; /** * The T-SQL script to be executed by this Elastic Job Step. * * > **Note:** While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent. */ sqlScript?: pulumi.Input; /** * The execution timeout in seconds for this Elastic Job Step. Defaults to `43200`. */ timeoutSeconds?: pulumi.Input; } /** * The set of arguments for constructing a JobStep resource. */ export interface JobStepArgs { /** * The initial retry interval in seconds. Defaults to `1`. */ initialRetryIntervalSeconds?: pulumi.Input; /** * The ID of the Elastic Job Credential to use when executing this Elastic Job Step. Omit this argument to run the step under the Job Agent's managed identity (user-assigned). * * !> **Note:** Once set, `jobCredentialId` cannot be removed. Removing the credential will force a new resource to be created. */ jobCredentialId?: pulumi.Input; /** * The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created. */ jobId: pulumi.Input; /** * The index at which to insert this Elastic Job Step into the Elastic Job. * * > **Note:** This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job. */ jobStepIndex: pulumi.Input; /** * The ID of the Elastic Job Target Group. */ jobTargetGroupId: pulumi.Input; /** * The maximum retry interval in seconds. Defaults to `120`. * * > **Note:** `maximumRetryIntervalSeconds` must be greater than `initialRetryIntervalSeconds`. */ maximumRetryIntervalSeconds?: pulumi.Input; /** * The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created. */ name?: pulumi.Input; /** * An `outputTarget` block as defined below. */ outputTarget?: pulumi.Input; /** * The number of retry attempts. Defaults to `10`. */ retryAttempts?: pulumi.Input; /** * The multiplier for time between retries. Defaults to `2.0`. */ retryIntervalBackoffMultiplier?: pulumi.Input; /** * The T-SQL script to be executed by this Elastic Job Step. * * > **Note:** While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent. */ sqlScript: pulumi.Input; /** * The execution timeout in seconds for this Elastic Job Step. Defaults to `43200`. */ timeoutSeconds?: pulumi.Input; }