import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages Start Stop Schedules for an MS SQL Managed Instance. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "database-rg", * location: "West Europe", * }); * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("example", { * name: "mi-security-group", * location: example.location, * resourceGroupName: example.name, * }); * const allowManagementInbound = new azure.network.NetworkSecurityRule("allow_management_inbound", { * name: "allow_management_inbound", * priority: 106, * direction: "Inbound", * access: "Allow", * protocol: "Tcp", * sourcePortRange: "*", * destinationPortRanges: [ * "9000", * "9003", * "1438", * "1440", * "1452", * ], * sourceAddressPrefix: "*", * destinationAddressPrefix: "*", * resourceGroupName: example.name, * networkSecurityGroupName: exampleNetworkSecurityGroup.name, * }); * const allowMisubnetInbound = new azure.network.NetworkSecurityRule("allow_misubnet_inbound", { * name: "allow_misubnet_inbound", * priority: 200, * direction: "Inbound", * access: "Allow", * protocol: "*", * sourcePortRange: "*", * destinationPortRange: "*", * sourceAddressPrefix: "10.0.0.0/24", * destinationAddressPrefix: "*", * resourceGroupName: example.name, * networkSecurityGroupName: exampleNetworkSecurityGroup.name, * }); * const allowHealthProbeInbound = new azure.network.NetworkSecurityRule("allow_health_probe_inbound", { * name: "allow_health_probe_inbound", * priority: 300, * direction: "Inbound", * access: "Allow", * protocol: "*", * sourcePortRange: "*", * destinationPortRange: "*", * sourceAddressPrefix: "AzureLoadBalancer", * destinationAddressPrefix: "*", * resourceGroupName: example.name, * networkSecurityGroupName: exampleNetworkSecurityGroup.name, * }); * const allowTdsInbound = new azure.network.NetworkSecurityRule("allow_tds_inbound", { * name: "allow_tds_inbound", * priority: 1000, * direction: "Inbound", * access: "Allow", * protocol: "Tcp", * sourcePortRange: "*", * destinationPortRange: "1433", * sourceAddressPrefix: "VirtualNetwork", * destinationAddressPrefix: "*", * resourceGroupName: example.name, * networkSecurityGroupName: exampleNetworkSecurityGroup.name, * }); * const denyAllInbound = new azure.network.NetworkSecurityRule("deny_all_inbound", { * name: "deny_all_inbound", * priority: 4096, * direction: "Inbound", * access: "Deny", * protocol: "*", * sourcePortRange: "*", * destinationPortRange: "*", * sourceAddressPrefix: "*", * destinationAddressPrefix: "*", * resourceGroupName: example.name, * networkSecurityGroupName: exampleNetworkSecurityGroup.name, * }); * const allowManagementOutbound = new azure.network.NetworkSecurityRule("allow_management_outbound", { * name: "allow_management_outbound", * priority: 102, * direction: "Outbound", * access: "Allow", * protocol: "Tcp", * sourcePortRange: "*", * destinationPortRanges: [ * "80", * "443", * "12000", * ], * sourceAddressPrefix: "*", * destinationAddressPrefix: "*", * resourceGroupName: example.name, * networkSecurityGroupName: exampleNetworkSecurityGroup.name, * }); * const allowMisubnetOutbound = new azure.network.NetworkSecurityRule("allow_misubnet_outbound", { * name: "allow_misubnet_outbound", * priority: 200, * direction: "Outbound", * access: "Allow", * protocol: "*", * sourcePortRange: "*", * destinationPortRange: "*", * sourceAddressPrefix: "10.0.0.0/24", * destinationAddressPrefix: "*", * resourceGroupName: example.name, * networkSecurityGroupName: exampleNetworkSecurityGroup.name, * }); * const denyAllOutbound = new azure.network.NetworkSecurityRule("deny_all_outbound", { * name: "deny_all_outbound", * priority: 4096, * direction: "Outbound", * access: "Deny", * protocol: "*", * sourcePortRange: "*", * destinationPortRange: "*", * sourceAddressPrefix: "*", * destinationAddressPrefix: "*", * resourceGroupName: example.name, * networkSecurityGroupName: exampleNetworkSecurityGroup.name, * }); * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", { * name: "vnet-mi", * resourceGroupName: example.name, * addressSpaces: ["10.0.0.0/16"], * location: example.location, * }); * const exampleSubnet = new azure.network.Subnet("example", { * name: "subnet-mi", * resourceGroupName: example.name, * virtualNetworkName: exampleVirtualNetwork.name, * addressPrefixes: ["10.0.0.0/24"], * delegations: [{ * name: "managedinstancedelegation", * serviceDelegation: { * name: "Microsoft.Sql/managedInstances", * actions: [ * "Microsoft.Network/virtualNetworks/subnets/join/action", * "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", * "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", * ], * }, * }], * }); * const exampleSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("example", { * subnetId: exampleSubnet.id, * networkSecurityGroupId: exampleNetworkSecurityGroup.id, * }); * const exampleRouteTable = new azure.network.RouteTable("example", { * name: "routetable-mi", * location: example.location, * resourceGroupName: example.name, * disableBgpRoutePropagation: false, * }, { * dependsOn: [exampleSubnet], * }); * const exampleSubnetRouteTableAssociation = new azure.network.SubnetRouteTableAssociation("example", { * subnetId: exampleSubnet.id, * routeTableId: exampleRouteTable.id, * }); * const exampleManagedInstance = new azure.mssql.ManagedInstance("example", { * name: "managedsqlinstance", * resourceGroupName: example.name, * location: example.location, * licenseType: "BasePrice", * skuName: "GP_Gen5", * storageSizeInGb: 32, * subnetId: exampleSubnet.id, * vcores: 4, * administratorLogin: "mradministrator", * administratorLoginPassword: "thisIsDog11", * }, { * dependsOn: [ * exampleSubnetNetworkSecurityGroupAssociation, * exampleSubnetRouteTableAssociation, * ], * }); * const exampleManagedInstanceStartStopSchedule = new azure.mssql.ManagedInstanceStartStopSchedule("example", { * managedInstanceId: exampleManagedInstance.id, * timezoneId: "Central European Standard Time", * schedules: [ * { * startDay: "Monday", * startTime: "08:00", * stopDay: "Monday", * stopTime: "11:00", * }, * { * startDay: "Tuesday", * startTime: "12:00", * stopDay: "Tuesday", * stopTime: "18:00", * }, * ], * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.Sql` - 2023-08-01-preview * * ## Import * * MS SQL Managed Instance Start Stop Schedule can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:mssql/managedInstanceStartStopSchedule:ManagedInstanceStartStopSchedule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Sql/managedInstances/managedInstance1/startStopSchedules/default * ``` */ export declare class ManagedInstanceStartStopSchedule extends pulumi.CustomResource { /** * Get an existing ManagedInstanceStartStopSchedule 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?: ManagedInstanceStartStopScheduleState, opts?: pulumi.CustomResourceOptions): ManagedInstanceStartStopSchedule; /** * Returns true if the given object is an instance of ManagedInstanceStartStopSchedule. 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 ManagedInstanceStartStopSchedule; /** * Specifies the description of the schedule. */ readonly description: pulumi.Output; /** * Specifies the ID of the Managed Instance. Changing this forces a new Sql Start Stop Managed Instance Schedule to be created. */ readonly managedInstanceId: pulumi.Output; /** * Timestamp when the next action will be executed in the corresponding schedule time zone. */ readonly nextExecutionTime: pulumi.Output; /** * Next action to be executed (Start or Stop). */ readonly nextRunAction: pulumi.Output; /** * A `schedule` block as defined below. */ readonly schedules: pulumi.Output; /** * Specifies the time zone of the schedule. Defaults to `UTC`. */ readonly timezoneId: pulumi.Output; /** * Create a ManagedInstanceStartStopSchedule 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: ManagedInstanceStartStopScheduleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ManagedInstanceStartStopSchedule resources. */ export interface ManagedInstanceStartStopScheduleState { /** * Specifies the description of the schedule. */ description?: pulumi.Input; /** * Specifies the ID of the Managed Instance. Changing this forces a new Sql Start Stop Managed Instance Schedule to be created. */ managedInstanceId?: pulumi.Input; /** * Timestamp when the next action will be executed in the corresponding schedule time zone. */ nextExecutionTime?: pulumi.Input; /** * Next action to be executed (Start or Stop). */ nextRunAction?: pulumi.Input; /** * A `schedule` block as defined below. */ schedules?: pulumi.Input[]>; /** * Specifies the time zone of the schedule. Defaults to `UTC`. */ timezoneId?: pulumi.Input; } /** * The set of arguments for constructing a ManagedInstanceStartStopSchedule resource. */ export interface ManagedInstanceStartStopScheduleArgs { /** * Specifies the description of the schedule. */ description?: pulumi.Input; /** * Specifies the ID of the Managed Instance. Changing this forces a new Sql Start Stop Managed Instance Schedule to be created. */ managedInstanceId: pulumi.Input; /** * A `schedule` block as defined below. */ schedules: pulumi.Input[]>; /** * Specifies the time zone of the schedule. Defaults to `UTC`. */ timezoneId?: pulumi.Input; }