diff --git a/provider/cmd/pulumi-resource-spotinst/schema.json b/provider/cmd/pulumi-resource-spotinst/schema.json index 3634cfe9..c8788be5 100644 --- a/provider/cmd/pulumi-resource-spotinst/schema.json +++ b/provider/cmd/pulumi-resource-spotinst/schema.json @@ -17847,7 +17847,7 @@ } }, "spotinst:index/statefulNodeAzure:StatefulNodeAzure": { - "description": "Provides a Spotinst stateful node Azure resource.\n\n", + "description": "Provides a Spotinst stateful node Azure resource.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as spotinst from \"@pulumi/spotinst\";\n\nconst testStatefulNodeAzure = new spotinst.StatefulNodeAzure(\"testStatefulNodeAzure\", {\n region: \"eastus\",\n resourceGroupName: \"spotinst-azure\",\n description: \"example_stateful_node_azure_description\",\n strategy: {\n drainingTimeout: 30,\n fallbackToOnDemand: true,\n optimizationWindows: [\"Tue:19:46-Tue:20:46\"],\n odWindows: [\"Wed:19:46-Wed:21:46\"],\n availabilityVsCost: 100,\n revertToSpot: {\n performAt: \"timeWindow\",\n },\n preferredLifeCycle: \"od\",\n capacityReservations: [{\n shouldUtilize: true,\n utilizationStrategy: \"utilizeOverOD\",\n capacityReservationGroups: [{\n crgName: \"crg name\",\n crgResourceGroupName: \"resourceGroupName\",\n crgShouldPrioritize: true,\n }],\n }],\n },\n os: \"Linux\",\n odSizes: [\n \"standard_ds1_v2\",\n \"standard_ds2_v2\",\n ],\n spotSizes: [\n \"standard_ds1_v2\",\n \"standard_ds2_v2\",\n ],\n preferredSpotSizes: [\"standard_ds1_v2\"],\n zones: [\n \"1\",\n \"3\",\n ],\n preferredZone: \"1\",\n customData: \"\",\n shutdownScript: \"\",\n userData: \"\",\n vmName: \"VMName\",\n vmNamePrefix: \"VMNamePrefix\",\n licenseType: \"SLES_BYOS\",\n bootDiagnostics: [{\n isEnabled: true,\n storageUrl: \"https://.blob.core.windows.net/test\",\n type: \"unmanaged\",\n }],\n dataDisks: [\n {\n sizeGb: 1,\n lun: 1,\n type: \"Standard_LRS\",\n },\n {\n sizeGb: 10,\n lun: 2,\n type: \"Standard_LRS\",\n },\n ],\n extensions: [{\n name: \"extensionName\",\n type: \"customScript\",\n publisher: \"Microsoft.Azure.Extensions\",\n apiVersion: \"2.0\",\n minorVersionAutoUpgrade: true,\n protectedSettings: {\n script: \"IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg==\",\n },\n publicSettings: {\n fileUris: [\"https://testspot/Azuretest.sh\"],\n },\n }],\n image: {\n marketplaceImages: [{\n publisher: \"Canonical\",\n offer: \"UbuntuServer\",\n sku: \"16.04-LTS\",\n version: \"latest\",\n }],\n customImages: [{\n customImageResourceGroupName: \"resourceGroupName\",\n name: \"imageName\",\n }],\n galleries: [{\n galleryResourceGroupName: \"resourceGroupName\",\n galleryName: \"galleryName\",\n imageName: \"imageName\",\n versionName: \"1.1.0\",\n }],\n },\n loadBalancers: [{\n type: \"loadBalancer\",\n resourceGroupName: \"testResourceGroup\",\n name: \"testLoadBalancer\",\n sku: \"Standard\",\n backendPoolNames: [\n \"testBackendPool1\",\n \"testBackendPool2\",\n ],\n }],\n login: {\n userName: \"admin\",\n sshPublicKey: \"33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==\",\n },\n managedServiceIdentities: [{\n name: \"mySI2\",\n resourceGroupName: \"myResourceGroup\",\n }],\n network: {\n networkResourceGroupName: \"subnetResourceGroup\",\n virtualNetworkName: \"vname\",\n networkInterfaces: [{\n isPrimary: true,\n subnetName: \"testSubnet\",\n assignPublicIp: true,\n publicIpSku: \"Standard\",\n networkSecurityGroups: [{\n networkResourceGroupName: \"test\",\n name: \"test\",\n }],\n enableIpForwarding: true,\n privateIpAddresses: [\"172.23.4.20\"],\n additionalIpConfigurations: [{\n name: \"test\",\n privateIpAddressVersion: \"IPv4\",\n }],\n publicIps: [{\n networkResourceGroupName: \"resourceGroup\",\n name: \"test\",\n }],\n applicationSecurityGroups: [{\n networkResourceGroupName: \"AsgResourceGroup\",\n name: \"AsgName\",\n }],\n }],\n },\n osDisk: {\n sizeGb: 30,\n type: \"Standard_LRS\",\n caching: \"ReadOnly\",\n },\n secrets: [{\n sourceVaults: [{\n name: \"string\",\n resourceGroupName: \"string\",\n }],\n vaultCertificates: [{\n certificateUrl: \"string\",\n certificateStore: \"string\",\n }],\n }],\n security: {\n securityType: \"Standard\",\n secureBootEnabled: false,\n vtpmEnabled: false,\n },\n tags: [{\n tagKey: \"Creator\",\n tagValue: \"string\",\n }],\n health: {\n healthCheckTypes: [\"vmState\"],\n unhealthyDuration: 300,\n gracePeriod: 120,\n autoHealing: true,\n },\n shouldPersistOsDisk: false,\n osDiskPersistenceMode: \"reattach\",\n shouldPersistDataDisks: true,\n dataDisksPersistenceMode: \"reattach\",\n shouldPersistNetwork: true,\n schedulingTasks: [\n {\n isEnabled: true,\n type: \"pause\",\n cronExpression: \"44 10 * * *\",\n },\n {\n isEnabled: true,\n type: \"resume\",\n cronExpression: \"48 10 * * *\",\n },\n {\n isEnabled: true,\n type: \"recycle\",\n cronExpression: \"52 10 * * *\",\n },\n ],\n signals: [\n {\n type: \"vmReady\",\n timeout: 20,\n },\n {\n type: \"vmReady\",\n timeout: 40,\n },\n ],\n proximityPlacementGroups: [{\n name: \"TestPPG\",\n resourceGroupName: \"TestResourceGroup\",\n }],\n deletes: [{\n shouldTerminateVm: true,\n networkShouldDeallocate: true,\n networkTtlInHours: 0,\n diskShouldDeallocate: true,\n diskTtlInHours: 0,\n snapshotShouldDeallocate: true,\n snapshotTtlInHours: 0,\n publicIpShouldDeallocate: true,\n publicIpTtlInHours: 0,\n }],\n});\n// -------------------------------------------------------------------\n```\n```python\nimport pulumi\nimport pulumi_spotinst as spotinst\n\ntest_stateful_node_azure = spotinst.StatefulNodeAzure(\"testStatefulNodeAzure\",\n region=\"eastus\",\n resource_group_name=\"spotinst-azure\",\n description=\"example_stateful_node_azure_description\",\n strategy=spotinst.StatefulNodeAzureStrategyArgs(\n draining_timeout=30,\n fallback_to_on_demand=True,\n optimization_windows=[\"Tue:19:46-Tue:20:46\"],\n od_windows=[\"Wed:19:46-Wed:21:46\"],\n availability_vs_cost=100,\n revert_to_spot=spotinst.StatefulNodeAzureStrategyRevertToSpotArgs(\n perform_at=\"timeWindow\",\n ),\n preferred_life_cycle=\"od\",\n capacity_reservations=[spotinst.StatefulNodeAzureStrategyCapacityReservationArgs(\n should_utilize=True,\n utilization_strategy=\"utilizeOverOD\",\n capacity_reservation_groups=[spotinst.StatefulNodeAzureStrategyCapacityReservationCapacityReservationGroupArgs(\n crg_name=\"crg name\",\n crg_resource_group_name=\"resourceGroupName\",\n crg_should_prioritize=True,\n )],\n )],\n ),\n os=\"Linux\",\n od_sizes=[\n \"standard_ds1_v2\",\n \"standard_ds2_v2\",\n ],\n spot_sizes=[\n \"standard_ds1_v2\",\n \"standard_ds2_v2\",\n ],\n preferred_spot_sizes=[\"standard_ds1_v2\"],\n zones=[\n \"1\",\n \"3\",\n ],\n preferred_zone=\"1\",\n custom_data=\"\",\n shutdown_script=\"\",\n user_data=\"\",\n vm_name=\"VMName\",\n vm_name_prefix=\"VMNamePrefix\",\n license_type=\"SLES_BYOS\",\n boot_diagnostics=[spotinst.StatefulNodeAzureBootDiagnosticArgs(\n is_enabled=True,\n storage_url=\"https://.blob.core.windows.net/test\",\n type=\"unmanaged\",\n )],\n data_disks=[\n spotinst.StatefulNodeAzureDataDiskArgs(\n size_gb=1,\n lun=1,\n type=\"Standard_LRS\",\n ),\n spotinst.StatefulNodeAzureDataDiskArgs(\n size_gb=10,\n lun=2,\n type=\"Standard_LRS\",\n ),\n ],\n extensions=[spotinst.StatefulNodeAzureExtensionArgs(\n name=\"extensionName\",\n type=\"customScript\",\n publisher=\"Microsoft.Azure.Extensions\",\n api_version=\"2.0\",\n minor_version_auto_upgrade=True,\n protected_settings={\n \"script\": \"IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg==\",\n },\n public_settings={\n \"fileUris\": [\"https://testspot/Azuretest.sh\"],\n },\n )],\n image=spotinst.StatefulNodeAzureImageArgs(\n marketplace_images=[spotinst.StatefulNodeAzureImageMarketplaceImageArgs(\n publisher=\"Canonical\",\n offer=\"UbuntuServer\",\n sku=\"16.04-LTS\",\n version=\"latest\",\n )],\n custom_images=[spotinst.StatefulNodeAzureImageCustomImageArgs(\n custom_image_resource_group_name=\"resourceGroupName\",\n name=\"imageName\",\n )],\n galleries=[spotinst.StatefulNodeAzureImageGalleryArgs(\n gallery_resource_group_name=\"resourceGroupName\",\n gallery_name=\"galleryName\",\n image_name=\"imageName\",\n version_name=\"1.1.0\",\n )],\n ),\n load_balancers=[spotinst.StatefulNodeAzureLoadBalancerArgs(\n type=\"loadBalancer\",\n resource_group_name=\"testResourceGroup\",\n name=\"testLoadBalancer\",\n sku=\"Standard\",\n backend_pool_names=[\n \"testBackendPool1\",\n \"testBackendPool2\",\n ],\n )],\n login=spotinst.StatefulNodeAzureLoginArgs(\n user_name=\"admin\",\n ssh_public_key=\"33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==\",\n ),\n managed_service_identities=[spotinst.StatefulNodeAzureManagedServiceIdentityArgs(\n name=\"mySI2\",\n resource_group_name=\"myResourceGroup\",\n )],\n network=spotinst.StatefulNodeAzureNetworkArgs(\n network_resource_group_name=\"subnetResourceGroup\",\n virtual_network_name=\"vname\",\n network_interfaces=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceArgs(\n is_primary=True,\n subnet_name=\"testSubnet\",\n assign_public_ip=True,\n public_ip_sku=\"Standard\",\n network_security_groups=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceNetworkSecurityGroupArgs(\n network_resource_group_name=\"test\",\n name=\"test\",\n )],\n enable_ip_forwarding=True,\n private_ip_addresses=[\"172.23.4.20\"],\n additional_ip_configurations=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceAdditionalIpConfigurationArgs(\n name=\"test\",\n private_ip_address_version=\"IPv4\",\n )],\n public_ips=[spotinst.StatefulNodeAzureNetworkNetworkInterfacePublicIpArgs(\n network_resource_group_name=\"resourceGroup\",\n name=\"test\",\n )],\n application_security_groups=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceApplicationSecurityGroupArgs(\n network_resource_group_name=\"AsgResourceGroup\",\n name=\"AsgName\",\n )],\n )],\n ),\n os_disk=spotinst.StatefulNodeAzureOsDiskArgs(\n size_gb=30,\n type=\"Standard_LRS\",\n caching=\"ReadOnly\",\n ),\n secrets=[spotinst.StatefulNodeAzureSecretArgs(\n source_vaults=[spotinst.StatefulNodeAzureSecretSourceVaultArgs(\n name=\"string\",\n resource_group_name=\"string\",\n )],\n vault_certificates=[spotinst.StatefulNodeAzureSecretVaultCertificateArgs(\n certificate_url=\"string\",\n certificate_store=\"string\",\n )],\n )],\n security=spotinst.StatefulNodeAzureSecurityArgs(\n security_type=\"Standard\",\n secure_boot_enabled=False,\n vtpm_enabled=False,\n ),\n tags=[spotinst.StatefulNodeAzureTagArgs(\n tag_key=\"Creator\",\n tag_value=\"string\",\n )],\n health=spotinst.StatefulNodeAzureHealthArgs(\n health_check_types=[\"vmState\"],\n unhealthy_duration=300,\n grace_period=120,\n auto_healing=True,\n ),\n should_persist_os_disk=False,\n os_disk_persistence_mode=\"reattach\",\n should_persist_data_disks=True,\n data_disks_persistence_mode=\"reattach\",\n should_persist_network=True,\n scheduling_tasks=[\n spotinst.StatefulNodeAzureSchedulingTaskArgs(\n is_enabled=True,\n type=\"pause\",\n cron_expression=\"44 10 * * *\",\n ),\n spotinst.StatefulNodeAzureSchedulingTaskArgs(\n is_enabled=True,\n type=\"resume\",\n cron_expression=\"48 10 * * *\",\n ),\n spotinst.StatefulNodeAzureSchedulingTaskArgs(\n is_enabled=True,\n type=\"recycle\",\n cron_expression=\"52 10 * * *\",\n ),\n ],\n signals=[\n spotinst.StatefulNodeAzureSignalArgs(\n type=\"vmReady\",\n timeout=20,\n ),\n spotinst.StatefulNodeAzureSignalArgs(\n type=\"vmReady\",\n timeout=40,\n ),\n ],\n proximity_placement_groups=[spotinst.StatefulNodeAzureProximityPlacementGroupArgs(\n name=\"TestPPG\",\n resource_group_name=\"TestResourceGroup\",\n )],\n deletes=[spotinst.StatefulNodeAzureDeleteArgs(\n should_terminate_vm=True,\n network_should_deallocate=True,\n network_ttl_in_hours=0,\n disk_should_deallocate=True,\n disk_ttl_in_hours=0,\n snapshot_should_deallocate=True,\n snapshot_ttl_in_hours=0,\n public_ip_should_deallocate=True,\n public_ip_ttl_in_hours=0,\n )])\n# -------------------------------------------------------------------\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing SpotInst = Pulumi.SpotInst;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var testStatefulNodeAzure = new SpotInst.StatefulNodeAzure(\"testStatefulNodeAzure\", new()\n {\n Region = \"eastus\",\n ResourceGroupName = \"spotinst-azure\",\n Description = \"example_stateful_node_azure_description\",\n Strategy = new SpotInst.Inputs.StatefulNodeAzureStrategyArgs\n {\n DrainingTimeout = 30,\n FallbackToOnDemand = true,\n OptimizationWindows = new[]\n {\n \"Tue:19:46-Tue:20:46\",\n },\n OdWindows = new[]\n {\n \"Wed:19:46-Wed:21:46\",\n },\n AvailabilityVsCost = 100,\n RevertToSpot = new SpotInst.Inputs.StatefulNodeAzureStrategyRevertToSpotArgs\n {\n PerformAt = \"timeWindow\",\n },\n PreferredLifeCycle = \"od\",\n CapacityReservations = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureStrategyCapacityReservationArgs\n {\n ShouldUtilize = true,\n UtilizationStrategy = \"utilizeOverOD\",\n CapacityReservationGroups = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureStrategyCapacityReservationCapacityReservationGroupArgs\n {\n CrgName = \"crg name\",\n CrgResourceGroupName = \"resourceGroupName\",\n CrgShouldPrioritize = true,\n },\n },\n },\n },\n },\n Os = \"Linux\",\n OdSizes = new[]\n {\n \"standard_ds1_v2\",\n \"standard_ds2_v2\",\n },\n SpotSizes = new[]\n {\n \"standard_ds1_v2\",\n \"standard_ds2_v2\",\n },\n PreferredSpotSizes = new[]\n {\n \"standard_ds1_v2\",\n },\n Zones = new[]\n {\n \"1\",\n \"3\",\n },\n PreferredZone = \"1\",\n CustomData = \"\",\n ShutdownScript = \"\",\n UserData = \"\",\n VmName = \"VMName\",\n VmNamePrefix = \"VMNamePrefix\",\n LicenseType = \"SLES_BYOS\",\n BootDiagnostics = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureBootDiagnosticArgs\n {\n IsEnabled = true,\n StorageUrl = \"https://.blob.core.windows.net/test\",\n Type = \"unmanaged\",\n },\n },\n DataDisks = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureDataDiskArgs\n {\n SizeGb = 1,\n Lun = 1,\n Type = \"Standard_LRS\",\n },\n new SpotInst.Inputs.StatefulNodeAzureDataDiskArgs\n {\n SizeGb = 10,\n Lun = 2,\n Type = \"Standard_LRS\",\n },\n },\n Extensions = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureExtensionArgs\n {\n Name = \"extensionName\",\n Type = \"customScript\",\n Publisher = \"Microsoft.Azure.Extensions\",\n ApiVersion = \"2.0\",\n MinorVersionAutoUpgrade = true,\n ProtectedSettings = \n {\n { \"script\", \"IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg==\" },\n },\n PublicSettings = \n {\n { \"fileUris\", new[]\n {\n \"https://testspot/Azuretest.sh\",\n } },\n },\n },\n },\n Image = new SpotInst.Inputs.StatefulNodeAzureImageArgs\n {\n MarketplaceImages = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureImageMarketplaceImageArgs\n {\n Publisher = \"Canonical\",\n Offer = \"UbuntuServer\",\n Sku = \"16.04-LTS\",\n Version = \"latest\",\n },\n },\n CustomImages = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureImageCustomImageArgs\n {\n CustomImageResourceGroupName = \"resourceGroupName\",\n Name = \"imageName\",\n },\n },\n Galleries = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureImageGalleryArgs\n {\n GalleryResourceGroupName = \"resourceGroupName\",\n GalleryName = \"galleryName\",\n ImageName = \"imageName\",\n VersionName = \"1.1.0\",\n },\n },\n },\n LoadBalancers = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureLoadBalancerArgs\n {\n Type = \"loadBalancer\",\n ResourceGroupName = \"testResourceGroup\",\n Name = \"testLoadBalancer\",\n Sku = \"Standard\",\n BackendPoolNames = new[]\n {\n \"testBackendPool1\",\n \"testBackendPool2\",\n },\n },\n },\n Login = new SpotInst.Inputs.StatefulNodeAzureLoginArgs\n {\n UserName = \"admin\",\n SshPublicKey = \"33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==\",\n },\n ManagedServiceIdentities = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureManagedServiceIdentityArgs\n {\n Name = \"mySI2\",\n ResourceGroupName = \"myResourceGroup\",\n },\n },\n Network = new SpotInst.Inputs.StatefulNodeAzureNetworkArgs\n {\n NetworkResourceGroupName = \"subnetResourceGroup\",\n VirtualNetworkName = \"vname\",\n NetworkInterfaces = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureNetworkNetworkInterfaceArgs\n {\n IsPrimary = true,\n SubnetName = \"testSubnet\",\n AssignPublicIp = true,\n PublicIpSku = \"Standard\",\n NetworkSecurityGroups = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureNetworkNetworkInterfaceNetworkSecurityGroupArgs\n {\n NetworkResourceGroupName = \"test\",\n Name = \"test\",\n },\n },\n EnableIpForwarding = true,\n PrivateIpAddresses = new[]\n {\n \"172.23.4.20\",\n },\n AdditionalIpConfigurations = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureNetworkNetworkInterfaceAdditionalIpConfigurationArgs\n {\n Name = \"test\",\n PrivateIpAddressVersion = \"IPv4\",\n },\n },\n PublicIps = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureNetworkNetworkInterfacePublicIpArgs\n {\n NetworkResourceGroupName = \"resourceGroup\",\n Name = \"test\",\n },\n },\n ApplicationSecurityGroups = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureNetworkNetworkInterfaceApplicationSecurityGroupArgs\n {\n NetworkResourceGroupName = \"AsgResourceGroup\",\n Name = \"AsgName\",\n },\n },\n },\n },\n },\n OsDisk = new SpotInst.Inputs.StatefulNodeAzureOsDiskArgs\n {\n SizeGb = 30,\n Type = \"Standard_LRS\",\n Caching = \"ReadOnly\",\n },\n Secrets = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureSecretArgs\n {\n SourceVaults = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureSecretSourceVaultArgs\n {\n Name = \"string\",\n ResourceGroupName = \"string\",\n },\n },\n VaultCertificates = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureSecretVaultCertificateArgs\n {\n CertificateUrl = \"string\",\n CertificateStore = \"string\",\n },\n },\n },\n },\n Security = new SpotInst.Inputs.StatefulNodeAzureSecurityArgs\n {\n SecurityType = \"Standard\",\n SecureBootEnabled = false,\n VtpmEnabled = false,\n },\n Tags = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureTagArgs\n {\n TagKey = \"Creator\",\n TagValue = \"string\",\n },\n },\n Health = new SpotInst.Inputs.StatefulNodeAzureHealthArgs\n {\n HealthCheckTypes = new[]\n {\n \"vmState\",\n },\n UnhealthyDuration = 300,\n GracePeriod = 120,\n AutoHealing = true,\n },\n ShouldPersistOsDisk = false,\n OsDiskPersistenceMode = \"reattach\",\n ShouldPersistDataDisks = true,\n DataDisksPersistenceMode = \"reattach\",\n ShouldPersistNetwork = true,\n SchedulingTasks = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureSchedulingTaskArgs\n {\n IsEnabled = true,\n Type = \"pause\",\n CronExpression = \"44 10 * * *\",\n },\n new SpotInst.Inputs.StatefulNodeAzureSchedulingTaskArgs\n {\n IsEnabled = true,\n Type = \"resume\",\n CronExpression = \"48 10 * * *\",\n },\n new SpotInst.Inputs.StatefulNodeAzureSchedulingTaskArgs\n {\n IsEnabled = true,\n Type = \"recycle\",\n CronExpression = \"52 10 * * *\",\n },\n },\n Signals = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureSignalArgs\n {\n Type = \"vmReady\",\n Timeout = 20,\n },\n new SpotInst.Inputs.StatefulNodeAzureSignalArgs\n {\n Type = \"vmReady\",\n Timeout = 40,\n },\n },\n ProximityPlacementGroups = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureProximityPlacementGroupArgs\n {\n Name = \"TestPPG\",\n ResourceGroupName = \"TestResourceGroup\",\n },\n },\n Deletes = new[]\n {\n new SpotInst.Inputs.StatefulNodeAzureDeleteArgs\n {\n ShouldTerminateVm = true,\n NetworkShouldDeallocate = true,\n NetworkTtlInHours = 0,\n DiskShouldDeallocate = true,\n DiskTtlInHours = 0,\n SnapshotShouldDeallocate = true,\n SnapshotTtlInHours = 0,\n PublicIpShouldDeallocate = true,\n PublicIpTtlInHours = 0,\n },\n },\n });\n\n // -------------------------------------------------------------------\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-spotinst/sdk/v3/go/spotinst\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := spotinst.NewStatefulNodeAzure(ctx, \"testStatefulNodeAzure\", \u0026spotinst.StatefulNodeAzureArgs{\n\t\t\tRegion: pulumi.String(\"eastus\"),\n\t\t\tResourceGroupName: pulumi.String(\"spotinst-azure\"),\n\t\t\tDescription: pulumi.String(\"example_stateful_node_azure_description\"),\n\t\t\tStrategy: \u0026spotinst.StatefulNodeAzureStrategyArgs{\n\t\t\t\tDrainingTimeout: pulumi.Int(30),\n\t\t\t\tFallbackToOnDemand: pulumi.Bool(true),\n\t\t\t\tOptimizationWindows: pulumi.StringArray{\n\t\t\t\t\tpulumi.String(\"Tue:19:46-Tue:20:46\"),\n\t\t\t\t},\n\t\t\t\tOdWindows: pulumi.StringArray{\n\t\t\t\t\tpulumi.String(\"Wed:19:46-Wed:21:46\"),\n\t\t\t\t},\n\t\t\t\tAvailabilityVsCost: pulumi.Int(100),\n\t\t\t\tRevertToSpot: \u0026spotinst.StatefulNodeAzureStrategyRevertToSpotArgs{\n\t\t\t\t\tPerformAt: pulumi.String(\"timeWindow\"),\n\t\t\t\t},\n\t\t\t\tPreferredLifeCycle: pulumi.String(\"od\"),\n\t\t\t\tCapacityReservations: spotinst.StatefulNodeAzureStrategyCapacityReservationArray{\n\t\t\t\t\t\u0026spotinst.StatefulNodeAzureStrategyCapacityReservationArgs{\n\t\t\t\t\t\tShouldUtilize: pulumi.Bool(true),\n\t\t\t\t\t\tUtilizationStrategy: pulumi.String(\"utilizeOverOD\"),\n\t\t\t\t\t\tCapacityReservationGroups: spotinst.StatefulNodeAzureStrategyCapacityReservationCapacityReservationGroupArray{\n\t\t\t\t\t\t\t\u0026spotinst.StatefulNodeAzureStrategyCapacityReservationCapacityReservationGroupArgs{\n\t\t\t\t\t\t\t\tCrgName: pulumi.String(\"crg name\"),\n\t\t\t\t\t\t\t\tCrgResourceGroupName: pulumi.String(\"resourceGroupName\"),\n\t\t\t\t\t\t\t\tCrgShouldPrioritize: pulumi.Bool(true),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tOs: pulumi.String(\"Linux\"),\n\t\t\tOdSizes: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"standard_ds1_v2\"),\n\t\t\t\tpulumi.String(\"standard_ds2_v2\"),\n\t\t\t},\n\t\t\tSpotSizes: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"standard_ds1_v2\"),\n\t\t\t\tpulumi.String(\"standard_ds2_v2\"),\n\t\t\t},\n\t\t\tPreferredSpotSizes: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"standard_ds1_v2\"),\n\t\t\t},\n\t\t\tZones: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"1\"),\n\t\t\t\tpulumi.String(\"3\"),\n\t\t\t},\n\t\t\tPreferredZone: pulumi.String(\"1\"),\n\t\t\tCustomData: pulumi.String(\"\"),\n\t\t\tShutdownScript: pulumi.String(\"\"),\n\t\t\tUserData: pulumi.String(\"\"),\n\t\t\tVmName: pulumi.String(\"VMName\"),\n\t\t\tVmNamePrefix: pulumi.String(\"VMNamePrefix\"),\n\t\t\tLicenseType: pulumi.String(\"SLES_BYOS\"),\n\t\t\tBootDiagnostics: spotinst.StatefulNodeAzureBootDiagnosticArray{\n\t\t\t\t\u0026spotinst.StatefulNodeAzureBootDiagnosticArgs{\n\t\t\t\t\tIsEnabled: pulumi.Bool(true),\n\t\t\t\t\tStorageUrl: pulumi.String(\"https://.blob.core.windows.net/test\"),\n\t\t\t\t\tType: pulumi.String(\"unmanaged\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tDataDisks: spotinst.StatefulNodeAzureDataDiskArray{\n\t\t\t\t\u0026spotinst.StatefulNodeAzureDataDiskArgs{\n\t\t\t\t\tSizeGb: pulumi.Int(1),\n\t\t\t\t\tLun: pulumi.Int(1),\n\t\t\t\t\tType: pulumi.String(\"Standard_LRS\"),\n\t\t\t\t},\n\t\t\t\t\u0026spotinst.StatefulNodeAzureDataDiskArgs{\n\t\t\t\t\tSizeGb: pulumi.Int(10),\n\t\t\t\t\tLun: pulumi.Int(2),\n\t\t\t\t\tType: pulumi.String(\"Standard_LRS\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tExtensions: spotinst.StatefulNodeAzureExtensionArray{\n\t\t\t\t\u0026spotinst.StatefulNodeAzureExtensionArgs{\n\t\t\t\t\tName: pulumi.String(\"extensionName\"),\n\t\t\t\t\tType: pulumi.String(\"customScript\"),\n\t\t\t\t\tPublisher: pulumi.String(\"Microsoft.Azure.Extensions\"),\n\t\t\t\t\tApiVersion: pulumi.String(\"2.0\"),\n\t\t\t\t\tMinorVersionAutoUpgrade: pulumi.Bool(true),\n\t\t\t\t\tProtectedSettings: pulumi.Map{\n\t\t\t\t\t\t\"script\": pulumi.Any(\"IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg==\"),\n\t\t\t\t\t},\n\t\t\t\t\tPublicSettings: pulumi.Map{\n\t\t\t\t\t\t\"fileUris\": pulumi.Any{\n\t\t\t\t\t\t\t\"https://testspot/Azuretest.sh\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tImage: \u0026spotinst.StatefulNodeAzureImageArgs{\n\t\t\t\tMarketplaceImages: spotinst.StatefulNodeAzureImageMarketplaceImageArray{\n\t\t\t\t\t\u0026spotinst.StatefulNodeAzureImageMarketplaceImageArgs{\n\t\t\t\t\t\tPublisher: pulumi.String(\"Canonical\"),\n\t\t\t\t\t\tOffer: pulumi.String(\"UbuntuServer\"),\n\t\t\t\t\t\tSku: pulumi.String(\"16.04-LTS\"),\n\t\t\t\t\t\tVersion: pulumi.String(\"latest\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCustomImages: spotinst.StatefulNodeAzureImageCustomImageArray{\n\t\t\t\t\t\u0026spotinst.StatefulNodeAzureImageCustomImageArgs{\n\t\t\t\t\t\tCustomImageResourceGroupName: pulumi.String(\"resourceGroupName\"),\n\t\t\t\t\t\tName: pulumi.String(\"imageName\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tGalleries: spotinst.StatefulNodeAzureImageGalleryArray{\n\t\t\t\t\t\u0026spotinst.StatefulNodeAzureImageGalleryArgs{\n\t\t\t\t\t\tGalleryResourceGroupName: pulumi.String(\"resourceGroupName\"),\n\t\t\t\t\t\tGalleryName: pulumi.String(\"galleryName\"),\n\t\t\t\t\t\tImageName: pulumi.String(\"imageName\"),\n\t\t\t\t\t\tVersionName: pulumi.String(\"1.1.0\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tLoadBalancers: spotinst.StatefulNodeAzureLoadBalancerArray{\n\t\t\t\t\u0026spotinst.StatefulNodeAzureLoadBalancerArgs{\n\t\t\t\t\tType: pulumi.String(\"loadBalancer\"),\n\t\t\t\t\tResourceGroupName: pulumi.String(\"testResourceGroup\"),\n\t\t\t\t\tName: pulumi.String(\"testLoadBalancer\"),\n\t\t\t\t\tSku: pulumi.String(\"Standard\"),\n\t\t\t\t\tBackendPoolNames: pulumi.StringArray{\n\t\t\t\t\t\tpulumi.String(\"testBackendPool1\"),\n\t\t\t\t\t\tpulumi.String(\"testBackendPool2\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tLogin: \u0026spotinst.StatefulNodeAzureLoginArgs{\n\t\t\t\tUserName: pulumi.String(\"admin\"),\n\t\t\t\tSshPublicKey: pulumi.String(\"33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==\"),\n\t\t\t},\n\t\t\tManagedServiceIdentities: spotinst.StatefulNodeAzureManagedServiceIdentityArray{\n\t\t\t\t\u0026spotinst.StatefulNodeAzureManagedServiceIdentityArgs{\n\t\t\t\t\tName: pulumi.String(\"mySI2\"),\n\t\t\t\t\tResourceGroupName: pulumi.String(\"myResourceGroup\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tNetwork: \u0026spotinst.StatefulNodeAzureNetworkArgs{\n\t\t\t\tNetworkResourceGroupName: pulumi.String(\"subnetResourceGroup\"),\n\t\t\t\tVirtualNetworkName: pulumi.String(\"vname\"),\n\t\t\t\tNetworkInterfaces: spotinst.StatefulNodeAzureNetworkNetworkInterfaceArray{\n\t\t\t\t\t\u0026spotinst.StatefulNodeAzureNetworkNetworkInterfaceArgs{\n\t\t\t\t\t\tIsPrimary: pulumi.Bool(true),\n\t\t\t\t\t\tSubnetName: pulumi.String(\"testSubnet\"),\n\t\t\t\t\t\tAssignPublicIp: pulumi.Bool(true),\n\t\t\t\t\t\tPublicIpSku: pulumi.String(\"Standard\"),\n\t\t\t\t\t\tNetworkSecurityGroups: spotinst.StatefulNodeAzureNetworkNetworkInterfaceNetworkSecurityGroupArray{\n\t\t\t\t\t\t\t\u0026spotinst.StatefulNodeAzureNetworkNetworkInterfaceNetworkSecurityGroupArgs{\n\t\t\t\t\t\t\t\tNetworkResourceGroupName: pulumi.String(\"test\"),\n\t\t\t\t\t\t\t\tName: pulumi.String(\"test\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tEnableIpForwarding: pulumi.Bool(true),\n\t\t\t\t\t\tPrivateIpAddresses: pulumi.StringArray{\n\t\t\t\t\t\t\tpulumi.String(\"172.23.4.20\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAdditionalIpConfigurations: spotinst.StatefulNodeAzureNetworkNetworkInterfaceAdditionalIpConfigurationArray{\n\t\t\t\t\t\t\t\u0026spotinst.StatefulNodeAzureNetworkNetworkInterfaceAdditionalIpConfigurationArgs{\n\t\t\t\t\t\t\t\tName: pulumi.String(\"test\"),\n\t\t\t\t\t\t\t\tPrivateIpAddressVersion: pulumi.String(\"IPv4\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tPublicIps: spotinst.StatefulNodeAzureNetworkNetworkInterfacePublicIpArray{\n\t\t\t\t\t\t\t\u0026spotinst.StatefulNodeAzureNetworkNetworkInterfacePublicIpArgs{\n\t\t\t\t\t\t\t\tNetworkResourceGroupName: pulumi.String(\"resourceGroup\"),\n\t\t\t\t\t\t\t\tName: pulumi.String(\"test\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApplicationSecurityGroups: spotinst.StatefulNodeAzureNetworkNetworkInterfaceApplicationSecurityGroupArray{\n\t\t\t\t\t\t\t\u0026spotinst.StatefulNodeAzureNetworkNetworkInterfaceApplicationSecurityGroupArgs{\n\t\t\t\t\t\t\t\tNetworkResourceGroupName: pulumi.String(\"AsgResourceGroup\"),\n\t\t\t\t\t\t\t\tName: pulumi.String(\"AsgName\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tOsDisk: \u0026spotinst.StatefulNodeAzureOsDiskArgs{\n\t\t\t\tSizeGb: pulumi.Int(30),\n\t\t\t\tType: pulumi.String(\"Standard_LRS\"),\n\t\t\t\tCaching: pulumi.String(\"ReadOnly\"),\n\t\t\t},\n\t\t\tSecrets: spotinst.StatefulNodeAzureSecretArray{\n\t\t\t\t\u0026spotinst.StatefulNodeAzureSecretArgs{\n\t\t\t\t\tSourceVaults: spotinst.StatefulNodeAzureSecretSourceVaultArray{\n\t\t\t\t\t\t\u0026spotinst.StatefulNodeAzureSecretSourceVaultArgs{\n\t\t\t\t\t\t\tName: pulumi.String(\"string\"),\n\t\t\t\t\t\t\tResourceGroupName: pulumi.String(\"string\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tVaultCertificates: spotinst.StatefulNodeAzureSecretVaultCertificateArray{\n\t\t\t\t\t\t\u0026spotinst.StatefulNodeAzureSecretVaultCertificateArgs{\n\t\t\t\t\t\t\tCertificateUrl: pulumi.String(\"string\"),\n\t\t\t\t\t\t\tCertificateStore: pulumi.String(\"string\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tSecurity: \u0026spotinst.StatefulNodeAzureSecurityArgs{\n\t\t\t\tSecurityType: pulumi.String(\"Standard\"),\n\t\t\t\tSecureBootEnabled: pulumi.Bool(false),\n\t\t\t\tVtpmEnabled: pulumi.Bool(false),\n\t\t\t},\n\t\t\tTags: spotinst.StatefulNodeAzureTagArray{\n\t\t\t\t\u0026spotinst.StatefulNodeAzureTagArgs{\n\t\t\t\t\tTagKey: pulumi.String(\"Creator\"),\n\t\t\t\t\tTagValue: pulumi.String(\"string\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tHealth: \u0026spotinst.StatefulNodeAzureHealthArgs{\n\t\t\t\tHealthCheckTypes: pulumi.StringArray{\n\t\t\t\t\tpulumi.String(\"vmState\"),\n\t\t\t\t},\n\t\t\t\tUnhealthyDuration: pulumi.Int(300),\n\t\t\t\tGracePeriod: pulumi.Int(120),\n\t\t\t\tAutoHealing: pulumi.Bool(true),\n\t\t\t},\n\t\t\tShouldPersistOsDisk: pulumi.Bool(false),\n\t\t\tOsDiskPersistenceMode: pulumi.String(\"reattach\"),\n\t\t\tShouldPersistDataDisks: pulumi.Bool(true),\n\t\t\tDataDisksPersistenceMode: pulumi.String(\"reattach\"),\n\t\t\tShouldPersistNetwork: pulumi.Bool(true),\n\t\t\tSchedulingTasks: spotinst.StatefulNodeAzureSchedulingTaskArray{\n\t\t\t\t\u0026spotinst.StatefulNodeAzureSchedulingTaskArgs{\n\t\t\t\t\tIsEnabled: pulumi.Bool(true),\n\t\t\t\t\tType: pulumi.String(\"pause\"),\n\t\t\t\t\tCronExpression: pulumi.String(\"44 10 * * *\"),\n\t\t\t\t},\n\t\t\t\t\u0026spotinst.StatefulNodeAzureSchedulingTaskArgs{\n\t\t\t\t\tIsEnabled: pulumi.Bool(true),\n\t\t\t\t\tType: pulumi.String(\"resume\"),\n\t\t\t\t\tCronExpression: pulumi.String(\"48 10 * * *\"),\n\t\t\t\t},\n\t\t\t\t\u0026spotinst.StatefulNodeAzureSchedulingTaskArgs{\n\t\t\t\t\tIsEnabled: pulumi.Bool(true),\n\t\t\t\t\tType: pulumi.String(\"recycle\"),\n\t\t\t\t\tCronExpression: pulumi.String(\"52 10 * * *\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tSignals: spotinst.StatefulNodeAzureSignalArray{\n\t\t\t\t\u0026spotinst.StatefulNodeAzureSignalArgs{\n\t\t\t\t\tType: pulumi.String(\"vmReady\"),\n\t\t\t\t\tTimeout: pulumi.Int(20),\n\t\t\t\t},\n\t\t\t\t\u0026spotinst.StatefulNodeAzureSignalArgs{\n\t\t\t\t\tType: pulumi.String(\"vmReady\"),\n\t\t\t\t\tTimeout: pulumi.Int(40),\n\t\t\t\t},\n\t\t\t},\n\t\t\tProximityPlacementGroups: spotinst.StatefulNodeAzureProximityPlacementGroupArray{\n\t\t\t\t\u0026spotinst.StatefulNodeAzureProximityPlacementGroupArgs{\n\t\t\t\t\tName: pulumi.String(\"TestPPG\"),\n\t\t\t\t\tResourceGroupName: pulumi.String(\"TestResourceGroup\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tDeletes: spotinst.StatefulNodeAzureDeleteArray{\n\t\t\t\t\u0026spotinst.StatefulNodeAzureDeleteArgs{\n\t\t\t\t\tShouldTerminateVm: pulumi.Bool(true),\n\t\t\t\t\tNetworkShouldDeallocate: pulumi.Bool(true),\n\t\t\t\t\tNetworkTtlInHours: pulumi.Int(0),\n\t\t\t\t\tDiskShouldDeallocate: pulumi.Bool(true),\n\t\t\t\t\tDiskTtlInHours: pulumi.Int(0),\n\t\t\t\t\tSnapshotShouldDeallocate: pulumi.Bool(true),\n\t\t\t\t\tSnapshotTtlInHours: pulumi.Int(0),\n\t\t\t\t\tPublicIpShouldDeallocate: pulumi.Bool(true),\n\t\t\t\t\tPublicIpTtlInHours: pulumi.Int(0),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.spotinst.StatefulNodeAzure;\nimport com.pulumi.spotinst.StatefulNodeAzureArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureStrategyArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureStrategyRevertToSpotArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureBootDiagnosticArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureDataDiskArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureExtensionArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureImageArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureLoadBalancerArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureLoginArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureManagedServiceIdentityArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureNetworkArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureOsDiskArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureSecretArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureSecurityArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureTagArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureHealthArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureSchedulingTaskArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureSignalArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureProximityPlacementGroupArgs;\nimport com.pulumi.spotinst.inputs.StatefulNodeAzureDeleteArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var testStatefulNodeAzure = new StatefulNodeAzure(\"testStatefulNodeAzure\", StatefulNodeAzureArgs.builder() \n .region(\"eastus\")\n .resourceGroupName(\"spotinst-azure\")\n .description(\"example_stateful_node_azure_description\")\n .strategy(StatefulNodeAzureStrategyArgs.builder()\n .drainingTimeout(30)\n .fallbackToOnDemand(true)\n .optimizationWindows(\"Tue:19:46-Tue:20:46\")\n .odWindows(\"Wed:19:46-Wed:21:46\")\n .availabilityVsCost(100)\n .revertToSpot(StatefulNodeAzureStrategyRevertToSpotArgs.builder()\n .performAt(\"timeWindow\")\n .build())\n .preferredLifeCycle(\"od\")\n .capacityReservations(StatefulNodeAzureStrategyCapacityReservationArgs.builder()\n .shouldUtilize(true)\n .utilizationStrategy(\"utilizeOverOD\")\n .capacityReservationGroups(StatefulNodeAzureStrategyCapacityReservationCapacityReservationGroupArgs.builder()\n .crgName(\"crg name\")\n .crgResourceGroupName(\"resourceGroupName\")\n .crgShouldPrioritize(true)\n .build())\n .build())\n .build())\n .os(\"Linux\")\n .odSizes( \n \"standard_ds1_v2\",\n \"standard_ds2_v2\")\n .spotSizes( \n \"standard_ds1_v2\",\n \"standard_ds2_v2\")\n .preferredSpotSizes(\"standard_ds1_v2\")\n .zones( \n \"1\",\n \"3\")\n .preferredZone(\"1\")\n .customData(\"\")\n .shutdownScript(\"\")\n .userData(\"\")\n .vmName(\"VMName\")\n .vmNamePrefix(\"VMNamePrefix\")\n .licenseType(\"SLES_BYOS\")\n .bootDiagnostics(StatefulNodeAzureBootDiagnosticArgs.builder()\n .isEnabled(true)\n .storageUrl(\"https://.blob.core.windows.net/test\")\n .type(\"unmanaged\")\n .build())\n .dataDisks( \n StatefulNodeAzureDataDiskArgs.builder()\n .sizeGb(1)\n .lun(1)\n .type(\"Standard_LRS\")\n .build(),\n StatefulNodeAzureDataDiskArgs.builder()\n .sizeGb(10)\n .lun(2)\n .type(\"Standard_LRS\")\n .build())\n .extensions(StatefulNodeAzureExtensionArgs.builder()\n .name(\"extensionName\")\n .type(\"customScript\")\n .publisher(\"Microsoft.Azure.Extensions\")\n .apiVersion(\"2.0\")\n .minorVersionAutoUpgrade(true)\n .protectedSettings(Map.of(\"script\", \"IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg==\"))\n .publicSettings(Map.of(\"fileUris\", \"https://testspot/Azuretest.sh\"))\n .build())\n .image(StatefulNodeAzureImageArgs.builder()\n .marketplaceImages(StatefulNodeAzureImageMarketplaceImageArgs.builder()\n .publisher(\"Canonical\")\n .offer(\"UbuntuServer\")\n .sku(\"16.04-LTS\")\n .version(\"latest\")\n .build())\n .customImages(StatefulNodeAzureImageCustomImageArgs.builder()\n .customImageResourceGroupName(\"resourceGroupName\")\n .name(\"imageName\")\n .build())\n .galleries(StatefulNodeAzureImageGalleryArgs.builder()\n .galleryResourceGroupName(\"resourceGroupName\")\n .galleryName(\"galleryName\")\n .imageName(\"imageName\")\n .versionName(\"1.1.0\")\n .build())\n .build())\n .loadBalancers(StatefulNodeAzureLoadBalancerArgs.builder()\n .type(\"loadBalancer\")\n .resourceGroupName(\"testResourceGroup\")\n .name(\"testLoadBalancer\")\n .sku(\"Standard\")\n .backendPoolNames( \n \"testBackendPool1\",\n \"testBackendPool2\")\n .build())\n .login(StatefulNodeAzureLoginArgs.builder()\n .userName(\"admin\")\n .sshPublicKey(\"33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==\")\n .build())\n .managedServiceIdentities(StatefulNodeAzureManagedServiceIdentityArgs.builder()\n .name(\"mySI2\")\n .resourceGroupName(\"myResourceGroup\")\n .build())\n .network(StatefulNodeAzureNetworkArgs.builder()\n .networkResourceGroupName(\"subnetResourceGroup\")\n .virtualNetworkName(\"vname\")\n .networkInterfaces(StatefulNodeAzureNetworkNetworkInterfaceArgs.builder()\n .isPrimary(true)\n .subnetName(\"testSubnet\")\n .assignPublicIp(true)\n .publicIpSku(\"Standard\")\n .networkSecurityGroups(StatefulNodeAzureNetworkNetworkInterfaceNetworkSecurityGroupArgs.builder()\n .networkResourceGroupName(\"test\")\n .name(\"test\")\n .build())\n .enableIpForwarding(true)\n .privateIpAddresses(\"172.23.4.20\")\n .additionalIpConfigurations(StatefulNodeAzureNetworkNetworkInterfaceAdditionalIpConfigurationArgs.builder()\n .name(\"test\")\n .privateIpAddressVersion(\"IPv4\")\n .build())\n .publicIps(StatefulNodeAzureNetworkNetworkInterfacePublicIpArgs.builder()\n .networkResourceGroupName(\"resourceGroup\")\n .name(\"test\")\n .build())\n .applicationSecurityGroups(StatefulNodeAzureNetworkNetworkInterfaceApplicationSecurityGroupArgs.builder()\n .networkResourceGroupName(\"AsgResourceGroup\")\n .name(\"AsgName\")\n .build())\n .build())\n .build())\n .osDisk(StatefulNodeAzureOsDiskArgs.builder()\n .sizeGb(30)\n .type(\"Standard_LRS\")\n .caching(\"ReadOnly\")\n .build())\n .secrets(StatefulNodeAzureSecretArgs.builder()\n .sourceVaults(StatefulNodeAzureSecretSourceVaultArgs.builder()\n .name(\"string\")\n .resourceGroupName(\"string\")\n .build())\n .vaultCertificates(StatefulNodeAzureSecretVaultCertificateArgs.builder()\n .certificateUrl(\"string\")\n .certificateStore(\"string\")\n .build())\n .build())\n .security(StatefulNodeAzureSecurityArgs.builder()\n .securityType(\"Standard\")\n .secureBootEnabled(false)\n .vtpmEnabled(false)\n .build())\n .tags(StatefulNodeAzureTagArgs.builder()\n .tagKey(\"Creator\")\n .tagValue(\"string\")\n .build())\n .health(StatefulNodeAzureHealthArgs.builder()\n .healthCheckTypes(\"vmState\")\n .unhealthyDuration(300)\n .gracePeriod(120)\n .autoHealing(true)\n .build())\n .shouldPersistOsDisk(false)\n .osDiskPersistenceMode(\"reattach\")\n .shouldPersistDataDisks(true)\n .dataDisksPersistenceMode(\"reattach\")\n .shouldPersistNetwork(true)\n .schedulingTasks( \n StatefulNodeAzureSchedulingTaskArgs.builder()\n .isEnabled(true)\n .type(\"pause\")\n .cronExpression(\"44 10 * * *\")\n .build(),\n StatefulNodeAzureSchedulingTaskArgs.builder()\n .isEnabled(true)\n .type(\"resume\")\n .cronExpression(\"48 10 * * *\")\n .build(),\n StatefulNodeAzureSchedulingTaskArgs.builder()\n .isEnabled(true)\n .type(\"recycle\")\n .cronExpression(\"52 10 * * *\")\n .build())\n .signals( \n StatefulNodeAzureSignalArgs.builder()\n .type(\"vmReady\")\n .timeout(20)\n .build(),\n StatefulNodeAzureSignalArgs.builder()\n .type(\"vmReady\")\n .timeout(40)\n .build())\n .proximityPlacementGroups(StatefulNodeAzureProximityPlacementGroupArgs.builder()\n .name(\"TestPPG\")\n .resourceGroupName(\"TestResourceGroup\")\n .build())\n .deletes(StatefulNodeAzureDeleteArgs.builder()\n .shouldTerminateVm(true)\n .networkShouldDeallocate(true)\n .networkTtlInHours(0)\n .diskShouldDeallocate(true)\n .diskTtlInHours(0)\n .snapshotShouldDeallocate(true)\n .snapshotTtlInHours(0)\n .publicIpShouldDeallocate(true)\n .publicIpTtlInHours(0)\n .build())\n .build());\n\n // -------------------------------------------------------------------\n }\n}\n```\n```yaml\nresources:\n testStatefulNodeAzure: # -------------------------------------------------------------------\n type: spotinst:StatefulNodeAzure\n properties:\n region: eastus\n resourceGroupName: spotinst-azure\n description: example_stateful_node_azure_description\n strategy: # -------------------------------------------------------------------\n drainingTimeout: 30\n fallbackToOnDemand: true\n optimizationWindows:\n - Tue:19:46-Tue:20:46\n odWindows:\n - Wed:19:46-Wed:21:46\n availabilityVsCost: 100\n revertToSpot:\n performAt: timeWindow\n preferredLifeCycle: od\n capacityReservations:\n - shouldUtilize: true\n utilizationStrategy: utilizeOverOD\n capacityReservationGroups:\n - crgName: crg name\n crgResourceGroupName: resourceGroupName\n crgShouldPrioritize: true\n # --- COMPUTE -------------------------------------------------------\n os: Linux\n odSizes:\n - standard_ds1_v2\n - standard_ds2_v2\n spotSizes:\n - standard_ds1_v2\n - standard_ds2_v2\n preferredSpotSizes:\n - standard_ds1_v2\n zones:\n - '1'\n - '3'\n preferredZone: '1'\n customData:\n shutdownScript:\n userData:\n vmName: VMName\n vmNamePrefix: VMNamePrefix\n licenseType: SLES_BYOS # -------------------------------------------------------------------\n # --- BOOT DIAGNOSTICS ----------------------------------------------\n bootDiagnostics: # -------------------------------------------------------------------\n - isEnabled: true\n storageUrl: https://.blob.core.windows.net/test\n type: unmanaged\n # --- DATA DISKS ----------------------------------------------------\n dataDisks: # -------------------------------------------------------------------\n - sizeGb: 1\n lun: 1\n type: Standard_LRS\n - sizeGb: 10\n lun: 2\n type: Standard_LRS\n # --- EXTENSIONS ----------------------------------------------------\n extensions: # -------------------------------------------------------------------\n - name: extensionName\n type: customScript\n publisher: Microsoft.Azure.Extensions\n apiVersion: '2.0'\n minorVersionAutoUpgrade: true\n protectedSettings:\n script: IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg==\n publicSettings:\n fileUris:\n - https://testspot/Azuretest.sh\n image: # -------------------------------------------------------------------\n marketplaceImages:\n - publisher: Canonical\n offer: UbuntuServer\n sku: 16.04-LTS\n version: latest\n customImages:\n - customImageResourceGroupName: resourceGroupName\n name: imageName\n galleries:\n - galleryResourceGroupName: resourceGroupName\n galleryName: galleryName\n imageName: imageName\n versionName: 1.1.0\n # --- LOAD BALANCERS ------------------------------------------------\n loadBalancers: # -------------------------------------------------------------------\n - type: loadBalancer\n resourceGroupName: testResourceGroup\n name: testLoadBalancer\n sku: Standard\n backendPoolNames:\n - testBackendPool1\n - testBackendPool2\n login: # -------------------------------------------------------------------\n userName: admin\n sshPublicKey: 33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==\n # --- MANAGED SERVICE IDENTITIES ------------------------------------\n managedServiceIdentities: # -------------------------------------------------------------------\n - name: mySI2\n resourceGroupName: myResourceGroup\n network: # -------------------------------------------------------------------\n networkResourceGroupName: subnetResourceGroup\n virtualNetworkName: vname\n networkInterfaces:\n - isPrimary: true\n subnetName: testSubnet\n assignPublicIp: true\n publicIpSku: Standard\n networkSecurityGroups:\n - networkResourceGroupName: test\n name: test\n enableIpForwarding: true\n privateIpAddresses:\n - 172.23.4.20\n additionalIpConfigurations:\n - name: test\n privateIpAddressVersion: IPv4\n publicIps:\n - networkResourceGroupName: resourceGroup\n name: test\n applicationSecurityGroups:\n - networkResourceGroupName: AsgResourceGroup\n name: AsgName\n osDisk: # -------------------------------------------------------------------\n sizeGb: 30\n type: Standard_LRS\n caching: ReadOnly\n # --- SECRETS -------------------------------------------------------\n secrets: # --- Security ------------------------------------------------------\n - sourceVaults:\n - name: string\n resourceGroupName: string\n vaultCertificates:\n - certificateUrl: string\n certificateStore: string\n security: # -------------------------------------------------------------------\n securityType: Standard\n secureBootEnabled: false\n vtpmEnabled: false\n # --- TAGS ----------------------------------------------------------\n tags:\n - tagKey: Creator\n tagValue: string\n health: # -------------------------------------------------------------------\n healthCheckTypes:\n - vmState\n unhealthyDuration: 300\n gracePeriod: 120\n autoHealing: true\n # --- PERSISTENCE ---------------------------------------------------\n shouldPersistOsDisk: false\n osDiskPersistenceMode: reattach\n shouldPersistDataDisks: true\n dataDisksPersistenceMode: reattach\n shouldPersistNetwork: true # -------------------------------------------------------------------\n # --- SCHEDULING TASKS ----------------------------------------------\n schedulingTasks: # -------------------------------------------------------------------\n - isEnabled: true\n type: pause\n cronExpression: 44 10 * * *\n - isEnabled: true\n type: resume\n cronExpression: 48 10 * * *\n - isEnabled: true\n type: recycle\n cronExpression: 52 10 * * *\n # --- SIGNALS -------------------------------------------------------\n signals: # -------------------------------------------------------------------\n - type: vmReady\n timeout: 20\n - type: vmReady\n timeout: 40\n # --- PROMXIMITY PLACEMENTS GROUPS -----------------------------------\n proximityPlacementGroups: # -------------------------------------------------------------------\n - name: TestPPG\n resourceGroupName: TestResourceGroup\n # ---DELETE----------------------------------------------------------\n deletes:\n - shouldTerminateVm: true\n networkShouldDeallocate: true\n networkTtlInHours: 0\n diskShouldDeallocate: true\n diskTtlInHours: 0\n snapshotShouldDeallocate: true\n snapshotTtlInHours: 0\n publicIpShouldDeallocate: true\n publicIpTtlInHours: 0\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n# Argument Reference\n\nThe following arguments are supported:\n\n* `name` - (Required) Azure stateful node name.\n* `region` - (Required) The Azure region your stateful node will be created in.\n* `resource_group_name` - (Required) Name of the Resource Group for stateful node.\n* `description` - (Optional) Describe your Azure stateful node.\n\n\u003ca id=\"strategy\"\u003e\u003c/a\u003e\n## Strategy\n\n* `strategy` - (Required) Strategy for stateful node.\n * `draining_timeout` - (Optional, Default `120`) Time (in seconds) to allow the VM be drained from incoming TCP connections and detached from MLB before terminating it during a scale down operation.\n * `availability_vs_cost` - (Optional) Set the desired preference for the Spot market VM selection. (100- Availability, 0- cost).\n * `fallback_to_on_demand` - (Required) In case of no spots available, Stateful Node will launch an On-demand instance instead.\n * `optimization_windows` - (Optional) Valid format: \"ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))\", not empty if revertToSpot.performAt = timeWindow.\n * `od_windows` - (Optional) Define the time windows in which the underlying VM will be set as an on-demand lifecycle type. During the entire time window, the rest of the strategy processes will be paused.\n Switching between on-demand and Spot VM types at the enter/exit of the time window will trigger the recycling of the stateful node. Valid format: \"ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))\".\n * `preferred_life_cycle` - (Optional, Enum `\"od\", \"spot\"`, Default `\"spot\"`) The desired type of VM.\n * `revert_to_spot` - (Optional) Hold settings for strategy correction - replacing On-Demand for Spot VMs.\n * `perform_at` - (Required, Enum `\"timeWindow\", \"never\", \"always\"`, Default `\"always\"`) Settings for maintenance strategy.\n * `capacity_reservation` - (Optional) On-demand Capacity Reservation group enables you to reserve Compute capacity in an Azure region or an Availability Zone for any duration of time. [CRG can only be created on the Azure end.](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-create)\n * `should_utilize` - (Required) Determines whether capacity reservations should be utilized.\n * `utilization_strategy` - (Required, Enum `\"utilizeOverSpot\", \"utilizeOverOD\"`) The priority requested for using CRG. This value will determine if CRG is used ahead of spot VMs or On-demand VMs. (`\"utilizeOverOD\"`- If picked, we will use CRG only in case On demand should be launched. `\"utilizeOverSpot\"`- CRG will be preferred over Spot. Only after CRG is fully used, spot VMs can be used.)\n * `capacity_reservation_groups` - (Optional) List of the desired CRGs to use under the associated Azure subscription. When null we will utilize any available reservation that matches the launch specification.\n * `crg_name` - (Required) The name of the CRG.\n * `crg_resource_group_name` - (Required) Azure resource group name\n * `crg_should_prioritize` - The desired CRG to utilize ahead of other CRGs in the subscription.\n\n\u003ca id=\"compute\"\u003e\u003c/a\u003e\n## Compute\n\n* `os` - (Required, Enum `\"Linux\", \"Windows\"`) Type of operating system.\n* `od_sizes` - (Required) Available On-Demand sizes.\n* `spot_sizes` - (Required) Available Spot-VM sizes.\n* `preferred_spot_sizes` - (Optional) Prioritize Spot VM sizes when launching Spot VMs for the group. If set, must be a sublist of compute.vmSizes.spotSizes.\n* `zones` - (Optional, Enum `\"1\", \"2\", \"3\"`) List of Azure Availability Zones in the defined region. If not defined, Virtual machines will be launched regionally.\n* `preferred_zone` - (Optional, Enum `\"1\", \"2\", \"3\"`) The AZ to prioritize when launching VMs. If no markets are available in the Preferred AZ, VMs are launched in the non-preferred AZ. Must be a sublist of compute.zones.\n* `custom_data` - (Optional) This value will hold the YAML in base64 and will be executed upon VM launch.\n* `shutdown_script` - (Optional) Shutdown script for the stateful node. Value should be passed as a string encoded at Base64 only.\n* `user_data` - (Optional) Define a set of scripts or other metadata that's inserted to an Azure virtual machine at provision time. (Base64 encoded)\n* `vm_name` - (Optional) Set a VM name that will be persisted throughout the entire node lifecycle. This can't be set if `vm_name_prefix` is set.\n* `vm_name_prefix` - (Optional) Set a VM name prefix to be used for all launched VMs and the VM resources. This can't be set if `vm_name` is set.\n* `license_type` - (Optional) Specify an existing Azure license type to use when launching new VMs. Valid values for Windows OS: \"Windows_Server\", \"Windows_Client\", Valid values for Linux OS: \"RHEL_BYOS\", \"SLES_BYOS\"\n\n\u003ca id=\"boot_diagnostics\"\u003e\u003c/a\u003e\n## Boot Diagnostics\n\n* `boot_diagnostics`\n * `is_enabled` - (Optional) Allows you to enable and disable the configuration of boot diagnostics at launch.\n * `storage_url` - (Optional) The storage URI that is used if a type is unmanaged. The storage URI must follow the blob storage URI format (\"https://.blob.core.windows.net/\"). StorageUri is required if the type is unmanaged. StorageUri must be ‘null’ in case the boot diagnostics type is managed.\n * `type` - (Optional, Enum `\"managed\", \"unmanaged\"`) Defines the storage type on VM launch in Azure.\n\n\u003ca id=\"data_disks\"\u003e\u003c/a\u003e\n## Data Disks\n\n* `data_disk` - (Optional) The definitions of data disks that will be created and attached to the stateful node's VM.\n * `size_gb` - (Required) The size of the data disk in GB, required if dataDisks is specified.\n * `lun` - (Required) The LUN of the data disk.\n * `type` - (Required, Enum `\"Standard_LRS\", \"Premium_LRS\", \"StandardSSD_LRS\", \"UltraSSD_LRS\"`) The type of the data disk.\n\n\u003ca id=\"extensions\"\u003e\u003c/a\u003e\n## Extensions\n\n* `extension` - (Optional) An object for an azure extension.\n * `name` - (Required) Required on compute.launchSpecification.extensions object.\n * `type` - (Required) Required on compute.launchSpecification.extensions object.\n * `publisher` - (Required) Required on compute.launchSpecification.extensions object.\n * `api_version` - (Required) The API version of the extension. Required if extension specified.\n * `minor_version_auto_upgrade` - (Required) Required on compute.launchSpecification.extensions object.\n * `protected_settings` - (Optional) Object for protected settings.\n * `public_settings` - (Optional) Object for public settings.\n \n\u003ca id=\"image\"\u003e\u003c/a\u003e\n## Image\n\n* `image`\n * `marketplace_image` - (Optional) Select an image from Azure's Marketplace image catalogue. Required if the custom image or gallery image are not specified.\n * `publisher` - (Required) Image publisher.\n * `offer` - (Required) Image offer.\n * `sku` - (Required) Image Stock Keeping Unit, which is the specific version of the image.\n * `version` - (Required, Default `\"latest\"`) Image's version. if version not provided we use \"latest\".\n * `gallery` - (Optional) Gallery image definitions. Required if custom image or marketplace image are not specified.\n * `gallery_resource_group_name` - (Required) The resource group name for gallery image.\n * `gallery_name` - (Required) Name of the gallery.\n * `image_name` - (Required) Name of the gallery image.\n * `version_name` - (Required) Image's version. Can be in the format x.x.x or 'latest'.\n * `custom_image` - (Optional) Custom image definitions. Required if marketplace image or gallery image are not specified.\n * `custom_image_resource_group_name` - (Required) The resource group name for custom image.\n * `name` - (Required) The name of the custom image.\n\n\u003ca id=\"load balancer\"\u003e\u003c/a\u003e\n## Load Balancer\n\n* `load_balancer` - (Optional) Add a load balancer. For Azure Gateway, each Backend Pool is a separate load balancer.\n * `type` - (Required, Enum `\"loadBalancer\", \"applicationGateway\"`) The type of load balancer.\n * `resource_group_name` - (Required) The Resource Group name of the Load Balancer.\n * `name` - (Required) Name of the Application Gateway/Load Balancer.\n * `sku` - (Optional)\n * if type is `\"LoadBalancer\"` then possible values are `“Standard\", \"Basic”`.\n * If ApplicationGateway then possible values are\n `“Standard_Large”, “Standard_Medium”, “Standard_Small”, “Standard_v2\", “WAF_Large”, “WAF_Medium\", “WAF_v2\"`.\n * `backend_pool_names` - (Optional) Name of the Backend Pool to register the Stateful Node VMs to. Each Backend Pool is a separate load balancer. Required if Type is APPLICATION_GATEWAY.\n\n\u003ca id=\"login\"\u003e\u003c/a\u003e\n## Login\n\n* `login` - (Required) Set admin access for accessing your VMs. Password/SSH is required for Linux.\n * `user_name` - (Required) username for admin access to VMs.\n * `ssh_public_key` - (Optional) SSH for admin access to Linux VMs. Optional for Linux.\n * `password` - (Optional) Password for admin access to Windows VMs. Required for Windows.\n\n\u003ca id=\"managed_service_identities\"\u003e\u003c/a\u003e\n## Managed Service Identities\n\n* `managed_service_identities` - (Optional) Add a user-assigned managed identity to the Stateful Node's VM.\n * `name` - (Required) name of the managed identity.\n * `resource_group_name` - (Required) The Resource Group that the user-assigned managed identity resides in.\n\n\u003ca id=\"proximity_placement_groups\"\u003e\u003c/a\u003e\n## Proximity Placement Groups\n\n* `proximity_placement_groups` - (Optional) Defines the proximity placement group in which the VM will be launched.\n * `name` - (Required) name of the proximity placement group.\n * `resource_group_name` - (Required) The Resource Group name of the proximity placement group.\n\n\u003ca id=\"network\"\u003e\u003c/a\u003e\n## Network\n\n* `network` - (Required) Define the Virtual Network and Subnet for your Stateful Node.\n * `network_resource_group_name` - (Required) Vnet Resource Group Name.\n * `virtual_network_name` - (Required) Virtual Network.\n * `network_interface` - (Required) Define a network interface\n * `is_primary` - (Required) Defines whether the network interface is primary or not.\n * `subnet_name` - (Required) Subnet name.\n * `assign_public_ip` - (Optional) Assign public IP.\n * `public_ip_sku` - (Optional) Required if assignPublicIp=true values=[Standard/Basic].\n * `network_security_group` - (Optional) Network Security Group.\n * `network_resource_group_name` - (Required) Requires valid security group name.\n * `name` - (Required) Requires valid resource group name.\n * `enable_ip_forwarding` - (Optional) Enable IP Forwarding.\n * `private_ip_addresses` - (Optional) A list with unique items that every item is a valid IP.\n * `additional_ip_configurations` - (Optional) Additional configuration of network interface.\n * `name` - (Required) Configuration name.\n * `private_ip_address_version` - (Required, Enum `\"IPv4\", \"IPv6\"` Default `\"IPv4\"`) Version of the private IP address.\n * `public_ips` - (Optional) Defined a pool of Public Ips (from Azure), that will be associated to the network interface. We will associate one public ip per instance until the pool is exhausted, in which case, we will create a new one.\n * `resource_group_name` - (Required) The resource group of the public ip.\n * `name` - (Required) - The name of the public ip.\n * `application_security_groups` - (Optional) Network Security Group.\n * `resource_group_name` - (Required) Requires valid security group name.\n * `name` - (Required) Requires valid resource group name.\n\n\u003ca id=\"os_disk\"\u003e\u003c/a\u003e\n## OS Disk\n\n* `os_disk` - (Optional) Specify OS disk specification other than default.\n * `size_gb` - (Optional, Default `\"30\"`) The size of the data disk in GB.\n * `type` - (Required, Enum `\"Standard_LRS\", \"Premium_LRS\", \"StandardSSD_LRS\"`) The type of the OS disk.\n * `caching` - (Optional, Enum `\"None\", \"ReadOnly\", \"ReadWrite\"`) Specifies the host caching requirements. With disk caching enabled, VMs can achieve higher levels of performance. If not specified, the Azure default behavior will be applied.\n\n\u003ca id=\"secret\"\u003e\u003c/a\u003e\n## Secret\n\n* `secret` - (Optional) Set of certificates that should be installed on the VM.\n * `source_vault` - (Required) The key vault reference, contains the required certificates.\n * `name` - (Required) The name of the key vault.\n * `resource_group_name` - (Required) The resource group name of the key vault.\n * `vault_certificates` - (Required) The required certificate references.\n * `certificate_url` - (Optional) The URL of the certificate under the key vault.\n * `certificate_store` - (Required) The certificate store directory the VM. The directory is created in the LocalMachine account.\n * This field is required only when using Windows OS type\n * This field must be ‘null’ when the OS type is Linux\n\n\u003ca id=\"secutiry\"\u003e\u003c/a\u003e\n## Security\n\n* `security` - (Optional) Specifies the Security related profile settings for the virtual machine.\n * `secure_boot_enabled` - (Optional) Specifies whether secure boot should be enabled on the virtual machine.\n * `security_type` - (Optional) Enum: `\"Standard\", \"TrustedLaunch\"` Security type refers to the different security features of a virtual machine. Security features like Trusted launch virtual machines help to improve the security of Azure generation 2 virtual machines.\n * `vtpm_enabled` - (Optional) Specifies whether vTPM should be enabled on the virtual machine.\n\n\n\u003ca id=\"tag\"\u003e\u003c/a\u003e\n## Tag\n\n* `tag` - (Optional) Unique Key-Value pair for all Stateful Node Resources.\n * `tag_key` - (Optional) Tag Key for Stateful Node Resources.\n * `tag_value` - (Optional) Tag Value for Stateful Node Resources.\n\n\u003ca id=\"health\"\u003e\u003c/a\u003e\n## Health\n\n* `health` - (Optional) Set the auto healing preferences for unhealthy VMs.\n * `health_check_types` - (Optional, Enum `\"vmState\", \"applicationGateway\"`) Healthcheck to use to validate VM health.\n * `unhealthy_duration` - (Optional) Amount of time to be unhealthy before a replacement is triggered.\n * `auto_healing` - (Required) Enable Autohealing of unhealthy VMs.\n * `grace_period` - (Optional) Period of time to wait for VM to reach healthiness before monitoring for unhealthiness.\n\n\u003ca id=\"persistence\"\u003e\u003c/a\u003e\n## Persistence\n\n* `should_persist_os_disk` - (Required) Should persist os disk.\n* `os_disk_persistence_mode` - (Optional, Enum `\"reattach\", \"onLaunch\"`)\n* `should_persist_data_disks` - (Required) Should persist data disks.\n* `data_disks_persistence_mode` - (Optional, Enum `\"reattach\", \"onLaunch\"`)\n* `should_persist_network` - (Required) Should persist network.\n\n\u003ca id=\"scheduling_tasks\"\u003e\u003c/a\u003e\n## Scheduling Tasks\n\n* `scheduling_task` - (Optional) Scheduling settings object for stateful node.\n * `is_enabled` - (Required) Is scheduled task enabled for stateful node.\n * `type` - (Required, Enum `\"pause\", \"resume\", \"recycle\") The type of the scheduled task\n * `cron_expression` (Required) A expression which describes when to execute the scheduled task (UTC).\n\n\u003ca id=\"signals\"\u003e\u003c/a\u003e\n## Signals\n\n* `signal` - (Optional) A signal object defined for the stateful node.\n * `type` - (Required, Enum `\"vmReady\", \"vmReadyToShutdown\"`) The type of the signal defined for the stateful node.\n * `timeout` - (Required, Default `\"1800\"`) The timeout in seconds to hold the vm until a signal is sent. If no signal is sent the vm will be replaced (vmReady) or we will terminate the vm (vmReadyToShutdown) after the timeout.\n\n---\n\n\u003ca id=\"attach_data_disk\"\u003e\u003c/a\u003e\n## Attach Data Disk\n\n* `attach_data_disk` - (Optional) Create a new data disk and attach it to the stateful node.\n * `data_disk_name` - (Required) The name of the created data disk.\n * `data_disk_resource_group_name` - (Required) The resource group name in which the data disk will be created.\n * `storage_account_type` - (Required, Enum `\"Standard_LRS\", \"Premium_LRS\", \"StandardSSD_LRS\", \"UltraSSD_LRS\"`) The type of the data disk.\n * `size_gb` - (Required) The size of the data disk in GB, Required if dataDisks is specified.\n * `zone` - (Optional, Enum `\"1\", \"2\", \"3\"`) The Availability Zone in which the data disk will be created. If not defined, the data disk will be created regionally.\n * `lun` - (Optional, Default `\"orginal\"`) The LUN of the data disk. If not defined, the LUN will be set in order.\n\n\u003ca id=\"detach_data_disk\"\u003e\u003c/a\u003e\n## Detach Data Disk\n\n* `detach_data_disk` - (Optional) Detach a data disk from a stateful node.\n * `data_disk_name` - (Required) The name of the detached data disk.\n * `data_disk_resource_group_name` - (Required) The resource group name in which the data disk exists.\n * `should_deallocate` - (Required) Indicates whether to delete the data disk in addition to detach.\n * `ttl_in_hours` - (Required, Default `\"0\"`) Hours to keep the disk alive before deletion.\n\n\u003ca id=\"update_state\"\u003e\u003c/a\u003e\n## Update State\n\n* `update_state` - (Optional) Update the stateful node state.\n * `state` - (Required, Enum `\"pause\", \"resume\", \"recycle\"`) New state for the stateful node.\n\n\u003ca id=\"import_vm\"\u003e\u003c/a\u003e\n## Import VM\n\n* `import_vm` - (Optional) Import an Azure VM and create a stateful node by providing a node configuration.\n * `resource_group_name` - (Required) Name of the Resource Group for Stateful Node.\n * `original_vm_name` - (Required) Azure Import Stateful Node Name.\n * `draining_timeout` - (Optional) Hours to keep resources alive.\n * `resources_retention_time` - (Optional) Hours to keep resources alive.\n\n\u003ca id=\"delete\"\u003e\u003c/a\u003e\n## Deallocation Config\n\n* `delete` - (Required) Specify deallocation parameters for stateful node deletion.\n * `should_terminate_vm` - (Required) Indicates whether to delete the stateful node's VM.\n * `network_should_deallocate` - (Required) Indicates whether to delete the stateful node's network resources.\n * `network_ttl_in_hours` - (Optional, Default: 96) Hours to keep the network resource alive before deletion.\n * `disk_should_deallocate` - (Required) Indicates whether to delete the stateful node's disk resources.\n * `disk_ttl_in_hours` - (Optional, Default: 96) Hours to keep the disk resource alive before deletion.\n * `snapshot_should_deallocate` - (Required) Indicates whether to delete the stateful node's snapshot resources.\n * `snapshot_ttl_in_hours` - (Optional, Default: 96) Hours to keep the snapshots alive before deletion.\n * `public_ip_should_deallocate` - (Required) Indicates whether to delete the stateful node's public ip resources.\n * `public_ip_ttl_in_hours` - (Optional, Default: 96) Hours to keep the public ip alive before deletion.\n", "properties": { "attachDataDisks": { "type": "array", diff --git a/provider/go.sum b/provider/go.sum index d63b4899..bdf595d1 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -1436,8 +1436,6 @@ github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA= -github.com/bflad/tfproviderlint v0.28.1/go.mod h1:7Z9Pyl1Z1UWJcPBuyjN89D2NaJGpjReQb5NoaaQCthQ= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= @@ -2161,9 +2159,7 @@ github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/S github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= -github.com/hashicorp/go-getter v1.5.2/go.mod h1:orNH3BTYLu/fIxGIdLjLoAJHWMDQ/UKQr5O4m3iBuoo= github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= -github.com/hashicorp/go-getter v1.6.2/go.mod h1:IZCrswsZPeWv9IkVnLElzRU/gz/QPi6pZHn4tv6vbwA= github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= @@ -2224,7 +2220,6 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= @@ -2261,24 +2256,19 @@ github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 github.com/hashicorp/terraform-exec v0.17.3 h1:MX14Kvnka/oWGmIkyuyvL6POx25ZmKrjlaclkx3eErU= github.com/hashicorp/terraform-exec v0.17.3/go.mod h1:+NELG0EqQekJzhvikkeQsOAZpsw0cv/03rbeQJqscAI= github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= -github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= github.com/hashicorp/terraform-json v0.10.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= -github.com/hashicorp/terraform-json v0.13.0/go.mod h1:y5OdLBCT+rxbwnpxZs9kGL7R9ExU76+cpdY8zHwoazk= github.com/hashicorp/terraform-json v0.14.0/go.mod h1:5A9HIWPkk4e5aeeXIBbkcOvaZbIYnAIkEyqP2pNSckM= github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= -github.com/hashicorp/terraform-plugin-docs v0.5.1/go.mod h1:SQwEgy0/B0UPQ07rNEG1Wpt6E3jvRcCwkVHPNybGgc0= github.com/hashicorp/terraform-plugin-go v0.22.0/go.mod h1:mPULV91VKss7sik6KFEcEu7HuTogMLLO/EvWCuFkRVE= github.com/hashicorp/terraform-plugin-go v0.22.1 h1:iTS7WHNVrn7uhe3cojtvWWn83cm2Z6ryIUDTRO0EV7w= github.com/hashicorp/terraform-plugin-go v0.22.1/go.mod h1:qrjnqRghvQ6KnDbB12XeZ4FluclYwptntoWCr9QaXTI= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-sdk v1.7.0/go.mod h1:OjgQmey5VxnPej/buEhe+YqKm0KNvV3QqU4hkqHqPCY= -github.com/hashicorp/terraform-plugin-sdk v1.16.1/go.mod h1:KSsGcuZ1JRqnmYzz+sWIiUwNvJkzXbGRIdefwFfOdyY= github.com/hashicorp/terraform-plugin-sdk v1.17.2 h1:V7DUR3yBWFrVB9z3ddpY7kiYVSsq4NYR67NiTs93NQo= github.com/hashicorp/terraform-plugin-sdk v1.17.2/go.mod h1:wkvldbraEMkz23NxkkAsFS88A1R9eUiooiaUZyS6TLw= github.com/hashicorp/terraform-plugin-test v1.2.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs= -github.com/hashicorp/terraform-plugin-test/v2 v2.1.3/go.mod h1:pmaUHiUtDL/8Mz3FuyZ/vRDb0LpaOWQjVRW9ORF7FHs= github.com/hashicorp/terraform-plugin-test/v2 v2.2.1/go.mod h1:eZ9JL3O69Cb71Skn6OhHyj17sLmHRb+H6VrDcJjKrYU= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= @@ -2490,7 +2480,6 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -2534,7 +2523,6 @@ github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8Ie github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= @@ -2876,7 +2864,6 @@ github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -3081,9 +3068,7 @@ github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLE github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.7.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= github.com/zclconf/go-cty v1.8.2/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty v1.9.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty v1.11.0/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= github.com/zclconf/go-cty v1.13.0/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= @@ -3649,7 +3634,6 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -3796,7 +3780,6 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200214201135-548b770e2dfa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= diff --git a/sdk/dotnet/StatefulNodeAzure.cs b/sdk/dotnet/StatefulNodeAzure.cs index cc72448e..7015551b 100644 --- a/sdk/dotnet/StatefulNodeAzure.cs +++ b/sdk/dotnet/StatefulNodeAzure.cs @@ -11,6 +11,636 @@ namespace Pulumi.SpotInst { /// /// Provides a Spotinst stateful node Azure resource. + /// + /// ## Example Usage + /// + /// <!--Start PulumiCodeChooser --> + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using SpotInst = Pulumi.SpotInst; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var testStatefulNodeAzure = new SpotInst.StatefulNodeAzure("testStatefulNodeAzure", new() + /// { + /// Region = "eastus", + /// ResourceGroupName = "spotinst-azure", + /// Description = "example_stateful_node_azure_description", + /// Strategy = new SpotInst.Inputs.StatefulNodeAzureStrategyArgs + /// { + /// DrainingTimeout = 30, + /// FallbackToOnDemand = true, + /// OptimizationWindows = new[] + /// { + /// "Tue:19:46-Tue:20:46", + /// }, + /// OdWindows = new[] + /// { + /// "Wed:19:46-Wed:21:46", + /// }, + /// AvailabilityVsCost = 100, + /// RevertToSpot = new SpotInst.Inputs.StatefulNodeAzureStrategyRevertToSpotArgs + /// { + /// PerformAt = "timeWindow", + /// }, + /// PreferredLifeCycle = "od", + /// CapacityReservations = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureStrategyCapacityReservationArgs + /// { + /// ShouldUtilize = true, + /// UtilizationStrategy = "utilizeOverOD", + /// CapacityReservationGroups = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureStrategyCapacityReservationCapacityReservationGroupArgs + /// { + /// CrgName = "crg name", + /// CrgResourceGroupName = "resourceGroupName", + /// CrgShouldPrioritize = true, + /// }, + /// }, + /// }, + /// }, + /// }, + /// Os = "Linux", + /// OdSizes = new[] + /// { + /// "standard_ds1_v2", + /// "standard_ds2_v2", + /// }, + /// SpotSizes = new[] + /// { + /// "standard_ds1_v2", + /// "standard_ds2_v2", + /// }, + /// PreferredSpotSizes = new[] + /// { + /// "standard_ds1_v2", + /// }, + /// Zones = new[] + /// { + /// "1", + /// "3", + /// }, + /// PreferredZone = "1", + /// CustomData = "", + /// ShutdownScript = "", + /// UserData = "", + /// VmName = "VMName", + /// VmNamePrefix = "VMNamePrefix", + /// LicenseType = "SLES_BYOS", + /// BootDiagnostics = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureBootDiagnosticArgs + /// { + /// IsEnabled = true, + /// StorageUrl = "https://.blob.core.windows.net/test", + /// Type = "unmanaged", + /// }, + /// }, + /// DataDisks = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureDataDiskArgs + /// { + /// SizeGb = 1, + /// Lun = 1, + /// Type = "Standard_LRS", + /// }, + /// new SpotInst.Inputs.StatefulNodeAzureDataDiskArgs + /// { + /// SizeGb = 10, + /// Lun = 2, + /// Type = "Standard_LRS", + /// }, + /// }, + /// Extensions = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureExtensionArgs + /// { + /// Name = "extensionName", + /// Type = "customScript", + /// Publisher = "Microsoft.Azure.Extensions", + /// ApiVersion = "2.0", + /// MinorVersionAutoUpgrade = true, + /// ProtectedSettings = + /// { + /// { "script", "IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg==" }, + /// }, + /// PublicSettings = + /// { + /// { "fileUris", new[] + /// { + /// "https://testspot/Azuretest.sh", + /// } }, + /// }, + /// }, + /// }, + /// Image = new SpotInst.Inputs.StatefulNodeAzureImageArgs + /// { + /// MarketplaceImages = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureImageMarketplaceImageArgs + /// { + /// Publisher = "Canonical", + /// Offer = "UbuntuServer", + /// Sku = "16.04-LTS", + /// Version = "latest", + /// }, + /// }, + /// CustomImages = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureImageCustomImageArgs + /// { + /// CustomImageResourceGroupName = "resourceGroupName", + /// Name = "imageName", + /// }, + /// }, + /// Galleries = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureImageGalleryArgs + /// { + /// GalleryResourceGroupName = "resourceGroupName", + /// GalleryName = "galleryName", + /// ImageName = "imageName", + /// VersionName = "1.1.0", + /// }, + /// }, + /// }, + /// LoadBalancers = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureLoadBalancerArgs + /// { + /// Type = "loadBalancer", + /// ResourceGroupName = "testResourceGroup", + /// Name = "testLoadBalancer", + /// Sku = "Standard", + /// BackendPoolNames = new[] + /// { + /// "testBackendPool1", + /// "testBackendPool2", + /// }, + /// }, + /// }, + /// Login = new SpotInst.Inputs.StatefulNodeAzureLoginArgs + /// { + /// UserName = "admin", + /// SshPublicKey = "33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==", + /// }, + /// ManagedServiceIdentities = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureManagedServiceIdentityArgs + /// { + /// Name = "mySI2", + /// ResourceGroupName = "myResourceGroup", + /// }, + /// }, + /// Network = new SpotInst.Inputs.StatefulNodeAzureNetworkArgs + /// { + /// NetworkResourceGroupName = "subnetResourceGroup", + /// VirtualNetworkName = "vname", + /// NetworkInterfaces = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureNetworkNetworkInterfaceArgs + /// { + /// IsPrimary = true, + /// SubnetName = "testSubnet", + /// AssignPublicIp = true, + /// PublicIpSku = "Standard", + /// NetworkSecurityGroups = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureNetworkNetworkInterfaceNetworkSecurityGroupArgs + /// { + /// NetworkResourceGroupName = "test", + /// Name = "test", + /// }, + /// }, + /// EnableIpForwarding = true, + /// PrivateIpAddresses = new[] + /// { + /// "172.23.4.20", + /// }, + /// AdditionalIpConfigurations = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureNetworkNetworkInterfaceAdditionalIpConfigurationArgs + /// { + /// Name = "test", + /// PrivateIpAddressVersion = "IPv4", + /// }, + /// }, + /// PublicIps = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureNetworkNetworkInterfacePublicIpArgs + /// { + /// NetworkResourceGroupName = "resourceGroup", + /// Name = "test", + /// }, + /// }, + /// ApplicationSecurityGroups = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureNetworkNetworkInterfaceApplicationSecurityGroupArgs + /// { + /// NetworkResourceGroupName = "AsgResourceGroup", + /// Name = "AsgName", + /// }, + /// }, + /// }, + /// }, + /// }, + /// OsDisk = new SpotInst.Inputs.StatefulNodeAzureOsDiskArgs + /// { + /// SizeGb = 30, + /// Type = "Standard_LRS", + /// Caching = "ReadOnly", + /// }, + /// Secrets = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureSecretArgs + /// { + /// SourceVaults = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureSecretSourceVaultArgs + /// { + /// Name = "string", + /// ResourceGroupName = "string", + /// }, + /// }, + /// VaultCertificates = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureSecretVaultCertificateArgs + /// { + /// CertificateUrl = "string", + /// CertificateStore = "string", + /// }, + /// }, + /// }, + /// }, + /// Security = new SpotInst.Inputs.StatefulNodeAzureSecurityArgs + /// { + /// SecurityType = "Standard", + /// SecureBootEnabled = false, + /// VtpmEnabled = false, + /// }, + /// Tags = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureTagArgs + /// { + /// TagKey = "Creator", + /// TagValue = "string", + /// }, + /// }, + /// Health = new SpotInst.Inputs.StatefulNodeAzureHealthArgs + /// { + /// HealthCheckTypes = new[] + /// { + /// "vmState", + /// }, + /// UnhealthyDuration = 300, + /// GracePeriod = 120, + /// AutoHealing = true, + /// }, + /// ShouldPersistOsDisk = false, + /// OsDiskPersistenceMode = "reattach", + /// ShouldPersistDataDisks = true, + /// DataDisksPersistenceMode = "reattach", + /// ShouldPersistNetwork = true, + /// SchedulingTasks = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureSchedulingTaskArgs + /// { + /// IsEnabled = true, + /// Type = "pause", + /// CronExpression = "44 10 * * *", + /// }, + /// new SpotInst.Inputs.StatefulNodeAzureSchedulingTaskArgs + /// { + /// IsEnabled = true, + /// Type = "resume", + /// CronExpression = "48 10 * * *", + /// }, + /// new SpotInst.Inputs.StatefulNodeAzureSchedulingTaskArgs + /// { + /// IsEnabled = true, + /// Type = "recycle", + /// CronExpression = "52 10 * * *", + /// }, + /// }, + /// Signals = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureSignalArgs + /// { + /// Type = "vmReady", + /// Timeout = 20, + /// }, + /// new SpotInst.Inputs.StatefulNodeAzureSignalArgs + /// { + /// Type = "vmReady", + /// Timeout = 40, + /// }, + /// }, + /// ProximityPlacementGroups = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureProximityPlacementGroupArgs + /// { + /// Name = "TestPPG", + /// ResourceGroupName = "TestResourceGroup", + /// }, + /// }, + /// Deletes = new[] + /// { + /// new SpotInst.Inputs.StatefulNodeAzureDeleteArgs + /// { + /// ShouldTerminateVm = true, + /// NetworkShouldDeallocate = true, + /// NetworkTtlInHours = 0, + /// DiskShouldDeallocate = true, + /// DiskTtlInHours = 0, + /// SnapshotShouldDeallocate = true, + /// SnapshotTtlInHours = 0, + /// PublicIpShouldDeallocate = true, + /// PublicIpTtlInHours = 0, + /// }, + /// }, + /// }); + /// + /// // ------------------------------------------------------------------- + /// }); + /// ``` + /// <!--End PulumiCodeChooser --> + /// + /// # Argument Reference + /// + /// The following arguments are supported: + /// + /// * `name` - (Required) Azure stateful node name. + /// * `region` - (Required) The Azure region your stateful node will be created in. + /// * `resource_group_name` - (Required) Name of the Resource Group for stateful node. + /// * `description` - (Optional) Describe your Azure stateful node. + /// + /// <a id="strategy"></a> + /// ## Strategy + /// + /// * `strategy` - (Required) Strategy for stateful node. + /// * `draining_timeout` - (Optional, Default `120`) Time (in seconds) to allow the VM be drained from incoming TCP connections and detached from MLB before terminating it during a scale down operation. + /// * `availability_vs_cost` - (Optional) Set the desired preference for the Spot market VM selection. (100- Availability, 0- cost). + /// * `fallback_to_on_demand` - (Required) In case of no spots available, Stateful Node will launch an On-demand instance instead. + /// * `optimization_windows` - (Optional) Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))", not empty if revertToSpot.performAt = timeWindow. + /// * `od_windows` - (Optional) Define the time windows in which the underlying VM will be set as an on-demand lifecycle type. During the entire time window, the rest of the strategy processes will be paused. + /// Switching between on-demand and Spot VM types at the enter/exit of the time window will trigger the recycling of the stateful node. Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))". + /// * `preferred_life_cycle` - (Optional, Enum `"od", "spot"`, Default `"spot"`) The desired type of VM. + /// * `revert_to_spot` - (Optional) Hold settings for strategy correction - replacing On-Demand for Spot VMs. + /// * `perform_at` - (Required, Enum `"timeWindow", "never", "always"`, Default `"always"`) Settings for maintenance strategy. + /// * `capacity_reservation` - (Optional) On-demand Capacity Reservation group enables you to reserve Compute capacity in an Azure region or an Availability Zone for any duration of time. [CRG can only be created on the Azure end.](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-create) + /// * `should_utilize` - (Required) Determines whether capacity reservations should be utilized. + /// * `utilization_strategy` - (Required, Enum `"utilizeOverSpot", "utilizeOverOD"`) The priority requested for using CRG. This value will determine if CRG is used ahead of spot VMs or On-demand VMs. (`"utilizeOverOD"`- If picked, we will use CRG only in case On demand should be launched. `"utilizeOverSpot"`- CRG will be preferred over Spot. Only after CRG is fully used, spot VMs can be used.) + /// * `capacity_reservation_groups` - (Optional) List of the desired CRGs to use under the associated Azure subscription. When null we will utilize any available reservation that matches the launch specification. + /// * `crg_name` - (Required) The name of the CRG. + /// * `crg_resource_group_name` - (Required) Azure resource group name + /// * `crg_should_prioritize` - The desired CRG to utilize ahead of other CRGs in the subscription. + /// + /// <a id="compute"></a> + /// ## Compute + /// + /// * `os` - (Required, Enum `"Linux", "Windows"`) Type of operating system. + /// * `od_sizes` - (Required) Available On-Demand sizes. + /// * `spot_sizes` - (Required) Available Spot-VM sizes. + /// * `preferred_spot_sizes` - (Optional) Prioritize Spot VM sizes when launching Spot VMs for the group. If set, must be a sublist of compute.vmSizes.spotSizes. + /// * `zones` - (Optional, Enum `"1", "2", "3"`) List of Azure Availability Zones in the defined region. If not defined, Virtual machines will be launched regionally. + /// * `preferred_zone` - (Optional, Enum `"1", "2", "3"`) The AZ to prioritize when launching VMs. If no markets are available in the Preferred AZ, VMs are launched in the non-preferred AZ. Must be a sublist of compute.zones. + /// * `custom_data` - (Optional) This value will hold the YAML in base64 and will be executed upon VM launch. + /// * `shutdown_script` - (Optional) Shutdown script for the stateful node. Value should be passed as a string encoded at Base64 only. + /// * `user_data` - (Optional) Define a set of scripts or other metadata that's inserted to an Azure virtual machine at provision time. (Base64 encoded) + /// * `vm_name` - (Optional) Set a VM name that will be persisted throughout the entire node lifecycle. This can't be set if `vm_name_prefix` is set. + /// * `vm_name_prefix` - (Optional) Set a VM name prefix to be used for all launched VMs and the VM resources. This can't be set if `vm_name` is set. + /// * `license_type` - (Optional) Specify an existing Azure license type to use when launching new VMs. Valid values for Windows OS: "Windows_Server", "Windows_Client", Valid values for Linux OS: "RHEL_BYOS", "SLES_BYOS" + /// + /// <a id="boot_diagnostics"></a> + /// ## Boot Diagnostics + /// + /// * `boot_diagnostics` + /// * `is_enabled` - (Optional) Allows you to enable and disable the configuration of boot diagnostics at launch. + /// * `storage_url` - (Optional) The storage URI that is used if a type is unmanaged. The storage URI must follow the blob storage URI format ("https://.blob.core.windows.net/"). StorageUri is required if the type is unmanaged. StorageUri must be ‘null’ in case the boot diagnostics type is managed. + /// * `type` - (Optional, Enum `"managed", "unmanaged"`) Defines the storage type on VM launch in Azure. + /// + /// <a id="data_disks"></a> + /// ## Data Disks + /// + /// * `data_disk` - (Optional) The definitions of data disks that will be created and attached to the stateful node's VM. + /// * `size_gb` - (Required) The size of the data disk in GB, required if dataDisks is specified. + /// * `lun` - (Required) The LUN of the data disk. + /// * `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. + /// + /// <a id="extensions"></a> + /// ## Extensions + /// + /// * `extension` - (Optional) An object for an azure extension. + /// * `name` - (Required) Required on compute.launchSpecification.extensions object. + /// * `type` - (Required) Required on compute.launchSpecification.extensions object. + /// * `publisher` - (Required) Required on compute.launchSpecification.extensions object. + /// * `api_version` - (Required) The API version of the extension. Required if extension specified. + /// * `minor_version_auto_upgrade` - (Required) Required on compute.launchSpecification.extensions object. + /// * `protected_settings` - (Optional) Object for protected settings. + /// * `public_settings` - (Optional) Object for public settings. + /// + /// <a id="image"></a> + /// ## Image + /// + /// * `image` + /// * `marketplace_image` - (Optional) Select an image from Azure's Marketplace image catalogue. Required if the custom image or gallery image are not specified. + /// * `publisher` - (Required) Image publisher. + /// * `offer` - (Required) Image offer. + /// * `sku` - (Required) Image Stock Keeping Unit, which is the specific version of the image. + /// * `version` - (Required, Default `"latest"`) Image's version. if version not provided we use "latest". + /// * `gallery` - (Optional) Gallery image definitions. Required if custom image or marketplace image are not specified. + /// * `gallery_resource_group_name` - (Required) The resource group name for gallery image. + /// * `gallery_name` - (Required) Name of the gallery. + /// * `image_name` - (Required) Name of the gallery image. + /// * `version_name` - (Required) Image's version. Can be in the format x.x.x or 'latest'. + /// * `custom_image` - (Optional) Custom image definitions. Required if marketplace image or gallery image are not specified. + /// * `custom_image_resource_group_name` - (Required) The resource group name for custom image. + /// * `name` - (Required) The name of the custom image. + /// + /// <a id="load balancer"></a> + /// ## Load Balancer + /// + /// * `load_balancer` - (Optional) Add a load balancer. For Azure Gateway, each Backend Pool is a separate load balancer. + /// * `type` - (Required, Enum `"loadBalancer", "applicationGateway"`) The type of load balancer. + /// * `resource_group_name` - (Required) The Resource Group name of the Load Balancer. + /// * `name` - (Required) Name of the Application Gateway/Load Balancer. + /// * `sku` - (Optional) + /// * if type is `"LoadBalancer"` then possible values are `“Standard", "Basic”`. + /// * If ApplicationGateway then possible values are + /// `“Standard_Large”, “Standard_Medium”, “Standard_Small”, “Standard_v2", “WAF_Large”, “WAF_Medium", “WAF_v2"`. + /// * `backend_pool_names` - (Optional) Name of the Backend Pool to register the Stateful Node VMs to. Each Backend Pool is a separate load balancer. Required if Type is APPLICATION_GATEWAY. + /// + /// <a id="login"></a> + /// ## Login + /// + /// * `login` - (Required) Set admin access for accessing your VMs. Password/SSH is required for Linux. + /// * `user_name` - (Required) username for admin access to VMs. + /// * `ssh_public_key` - (Optional) SSH for admin access to Linux VMs. Optional for Linux. + /// * `password` - (Optional) Password for admin access to Windows VMs. Required for Windows. + /// + /// <a id="managed_service_identities"></a> + /// ## Managed Service Identities + /// + /// * `managed_service_identities` - (Optional) Add a user-assigned managed identity to the Stateful Node's VM. + /// * `name` - (Required) name of the managed identity. + /// * `resource_group_name` - (Required) The Resource Group that the user-assigned managed identity resides in. + /// + /// <a id="proximity_placement_groups"></a> + /// ## Proximity Placement Groups + /// + /// * `proximity_placement_groups` - (Optional) Defines the proximity placement group in which the VM will be launched. + /// * `name` - (Required) name of the proximity placement group. + /// * `resource_group_name` - (Required) The Resource Group name of the proximity placement group. + /// + /// <a id="network"></a> + /// ## Network + /// + /// * `network` - (Required) Define the Virtual Network and Subnet for your Stateful Node. + /// * `network_resource_group_name` - (Required) Vnet Resource Group Name. + /// * `virtual_network_name` - (Required) Virtual Network. + /// * `network_interface` - (Required) Define a network interface + /// * `is_primary` - (Required) Defines whether the network interface is primary or not. + /// * `subnet_name` - (Required) Subnet name. + /// * `assign_public_ip` - (Optional) Assign public IP. + /// * `public_ip_sku` - (Optional) Required if assignPublicIp=true values=[Standard/Basic]. + /// * `network_security_group` - (Optional) Network Security Group. + /// * `network_resource_group_name` - (Required) Requires valid security group name. + /// * `name` - (Required) Requires valid resource group name. + /// * `enable_ip_forwarding` - (Optional) Enable IP Forwarding. + /// * `private_ip_addresses` - (Optional) A list with unique items that every item is a valid IP. + /// * `additional_ip_configurations` - (Optional) Additional configuration of network interface. + /// * `name` - (Required) Configuration name. + /// * `private_ip_address_version` - (Required, Enum `"IPv4", "IPv6"` Default `"IPv4"`) Version of the private IP address. + /// * `public_ips` - (Optional) Defined a pool of Public Ips (from Azure), that will be associated to the network interface. We will associate one public ip per instance until the pool is exhausted, in which case, we will create a new one. + /// * `resource_group_name` - (Required) The resource group of the public ip. + /// * `name` - (Required) - The name of the public ip. + /// * `application_security_groups` - (Optional) Network Security Group. + /// * `resource_group_name` - (Required) Requires valid security group name. + /// * `name` - (Required) Requires valid resource group name. + /// + /// <a id="os_disk"></a> + /// ## OS Disk + /// + /// * `os_disk` - (Optional) Specify OS disk specification other than default. + /// * `size_gb` - (Optional, Default `"30"`) The size of the data disk in GB. + /// * `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS"`) The type of the OS disk. + /// * `caching` - (Optional, Enum `"None", "ReadOnly", "ReadWrite"`) Specifies the host caching requirements. With disk caching enabled, VMs can achieve higher levels of performance. If not specified, the Azure default behavior will be applied. + /// + /// <a id="secret"></a> + /// ## Secret + /// + /// * `secret` - (Optional) Set of certificates that should be installed on the VM. + /// * `source_vault` - (Required) The key vault reference, contains the required certificates. + /// * `name` - (Required) The name of the key vault. + /// * `resource_group_name` - (Required) The resource group name of the key vault. + /// * `vault_certificates` - (Required) The required certificate references. + /// * `certificate_url` - (Optional) The URL of the certificate under the key vault. + /// * `certificate_store` - (Required) The certificate store directory the VM. The directory is created in the LocalMachine account. + /// * This field is required only when using Windows OS type + /// * This field must be ‘null’ when the OS type is Linux + /// + /// <a id="secutiry"></a> + /// ## Security + /// + /// * `security` - (Optional) Specifies the Security related profile settings for the virtual machine. + /// * `secure_boot_enabled` - (Optional) Specifies whether secure boot should be enabled on the virtual machine. + /// * `security_type` - (Optional) Enum: `"Standard", "TrustedLaunch"` Security type refers to the different security features of a virtual machine. Security features like Trusted launch virtual machines help to improve the security of Azure generation 2 virtual machines. + /// * `vtpm_enabled` - (Optional) Specifies whether vTPM should be enabled on the virtual machine. + /// + /// <a id="tag"></a> + /// ## Tag + /// + /// * `tag` - (Optional) Unique Key-Value pair for all Stateful Node Resources. + /// * `tag_key` - (Optional) Tag Key for Stateful Node Resources. + /// * `tag_value` - (Optional) Tag Value for Stateful Node Resources. + /// + /// <a id="health"></a> + /// ## Health + /// + /// * `health` - (Optional) Set the auto healing preferences for unhealthy VMs. + /// * `health_check_types` - (Optional, Enum `"vmState", "applicationGateway"`) Healthcheck to use to validate VM health. + /// * `unhealthy_duration` - (Optional) Amount of time to be unhealthy before a replacement is triggered. + /// * `auto_healing` - (Required) Enable Autohealing of unhealthy VMs. + /// * `grace_period` - (Optional) Period of time to wait for VM to reach healthiness before monitoring for unhealthiness. + /// + /// <a id="persistence"></a> + /// ## Persistence + /// + /// * `should_persist_os_disk` - (Required) Should persist os disk. + /// * `os_disk_persistence_mode` - (Optional, Enum `"reattach", "onLaunch"`) + /// * `should_persist_data_disks` - (Required) Should persist data disks. + /// * `data_disks_persistence_mode` - (Optional, Enum `"reattach", "onLaunch"`) + /// * `should_persist_network` - (Required) Should persist network. + /// + /// <a id="scheduling_tasks"></a> + /// ## Scheduling Tasks + /// + /// * `scheduling_task` - (Optional) Scheduling settings object for stateful node. + /// * `is_enabled` - (Required) Is scheduled task enabled for stateful node. + /// * `type` - (Required, Enum `"pause", "resume", "recycle") The type of the scheduled task + /// * `cron_expression` (Required) A expression which describes when to execute the scheduled task (UTC). + /// + /// <a id="signals"></a> + /// ## Signals + /// + /// * `signal` - (Optional) A signal object defined for the stateful node. + /// * `type` - (Required, Enum `"vmReady", "vmReadyToShutdown"`) The type of the signal defined for the stateful node. + /// * `timeout` - (Required, Default `"1800"`) The timeout in seconds to hold the vm until a signal is sent. If no signal is sent the vm will be replaced (vmReady) or we will terminate the vm (vmReadyToShutdown) after the timeout. + /// + /// *** + /// + /// <a id="attach_data_disk"></a> + /// ## Attach Data Disk + /// + /// * `attach_data_disk` - (Optional) Create a new data disk and attach it to the stateful node. + /// * `data_disk_name` - (Required) The name of the created data disk. + /// * `data_disk_resource_group_name` - (Required) The resource group name in which the data disk will be created. + /// * `storage_account_type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. + /// * `size_gb` - (Required) The size of the data disk in GB, Required if dataDisks is specified. + /// * `zone` - (Optional, Enum `"1", "2", "3"`) The Availability Zone in which the data disk will be created. If not defined, the data disk will be created regionally. + /// * `lun` - (Optional, Default `"orginal"`) The LUN of the data disk. If not defined, the LUN will be set in order. + /// + /// <a id="detach_data_disk"></a> + /// ## Detach Data Disk + /// + /// * `detach_data_disk` - (Optional) Detach a data disk from a stateful node. + /// * `data_disk_name` - (Required) The name of the detached data disk. + /// * `data_disk_resource_group_name` - (Required) The resource group name in which the data disk exists. + /// * `should_deallocate` - (Required) Indicates whether to delete the data disk in addition to detach. + /// * `ttl_in_hours` - (Required, Default `"0"`) Hours to keep the disk alive before deletion. + /// + /// <a id="update_state"></a> + /// ## Update State + /// + /// * `update_state` - (Optional) Update the stateful node state. + /// * `state` - (Required, Enum `"pause", "resume", "recycle"`) New state for the stateful node. + /// + /// <a id="import_vm"></a> + /// ## Import VM + /// + /// * `import_vm` - (Optional) Import an Azure VM and create a stateful node by providing a node configuration. + /// * `resource_group_name` - (Required) Name of the Resource Group for Stateful Node. + /// * `original_vm_name` - (Required) Azure Import Stateful Node Name. + /// * `draining_timeout` - (Optional) Hours to keep resources alive. + /// * `resources_retention_time` - (Optional) Hours to keep resources alive. + /// + /// <a id="delete"></a> + /// ## Deallocation Config + /// + /// * `delete` - (Required) Specify deallocation parameters for stateful node deletion. + /// * `should_terminate_vm` - (Required) Indicates whether to delete the stateful node's VM. + /// * `network_should_deallocate` - (Required) Indicates whether to delete the stateful node's network resources. + /// * `network_ttl_in_hours` - (Optional, Default: 96) Hours to keep the network resource alive before deletion. + /// * `disk_should_deallocate` - (Required) Indicates whether to delete the stateful node's disk resources. + /// * `disk_ttl_in_hours` - (Optional, Default: 96) Hours to keep the disk resource alive before deletion. + /// * `snapshot_should_deallocate` - (Required) Indicates whether to delete the stateful node's snapshot resources. + /// * `snapshot_ttl_in_hours` - (Optional, Default: 96) Hours to keep the snapshots alive before deletion. + /// * `public_ip_should_deallocate` - (Required) Indicates whether to delete the stateful node's public ip resources. + /// * `public_ip_ttl_in_hours` - (Optional, Default: 96) Hours to keep the public ip alive before deletion. /// [SpotInstResourceType("spotinst:index/statefulNodeAzure:StatefulNodeAzure")] public partial class StatefulNodeAzure : global::Pulumi.CustomResource diff --git a/sdk/go/spotinst/statefulNodeAzure.go b/sdk/go/spotinst/statefulNodeAzure.go index d05f9a77..b2aea336 100644 --- a/sdk/go/spotinst/statefulNodeAzure.go +++ b/sdk/go/spotinst/statefulNodeAzure.go @@ -13,6 +13,573 @@ import ( ) // Provides a Spotinst stateful node Azure resource. +// +// ## Example Usage +// +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-spotinst/sdk/v3/go/spotinst" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := spotinst.NewStatefulNodeAzure(ctx, "testStatefulNodeAzure", &spotinst.StatefulNodeAzureArgs{ +// Region: pulumi.String("eastus"), +// ResourceGroupName: pulumi.String("spotinst-azure"), +// Description: pulumi.String("example_stateful_node_azure_description"), +// Strategy: &spotinst.StatefulNodeAzureStrategyArgs{ +// DrainingTimeout: pulumi.Int(30), +// FallbackToOnDemand: pulumi.Bool(true), +// OptimizationWindows: pulumi.StringArray{ +// pulumi.String("Tue:19:46-Tue:20:46"), +// }, +// OdWindows: pulumi.StringArray{ +// pulumi.String("Wed:19:46-Wed:21:46"), +// }, +// AvailabilityVsCost: pulumi.Int(100), +// RevertToSpot: &spotinst.StatefulNodeAzureStrategyRevertToSpotArgs{ +// PerformAt: pulumi.String("timeWindow"), +// }, +// PreferredLifeCycle: pulumi.String("od"), +// CapacityReservations: spotinst.StatefulNodeAzureStrategyCapacityReservationArray{ +// &spotinst.StatefulNodeAzureStrategyCapacityReservationArgs{ +// ShouldUtilize: pulumi.Bool(true), +// UtilizationStrategy: pulumi.String("utilizeOverOD"), +// CapacityReservationGroups: spotinst.StatefulNodeAzureStrategyCapacityReservationCapacityReservationGroupArray{ +// &spotinst.StatefulNodeAzureStrategyCapacityReservationCapacityReservationGroupArgs{ +// CrgName: pulumi.String("crg name"), +// CrgResourceGroupName: pulumi.String("resourceGroupName"), +// CrgShouldPrioritize: pulumi.Bool(true), +// }, +// }, +// }, +// }, +// }, +// Os: pulumi.String("Linux"), +// OdSizes: pulumi.StringArray{ +// pulumi.String("standard_ds1_v2"), +// pulumi.String("standard_ds2_v2"), +// }, +// SpotSizes: pulumi.StringArray{ +// pulumi.String("standard_ds1_v2"), +// pulumi.String("standard_ds2_v2"), +// }, +// PreferredSpotSizes: pulumi.StringArray{ +// pulumi.String("standard_ds1_v2"), +// }, +// Zones: pulumi.StringArray{ +// pulumi.String("1"), +// pulumi.String("3"), +// }, +// PreferredZone: pulumi.String("1"), +// CustomData: pulumi.String(""), +// ShutdownScript: pulumi.String(""), +// UserData: pulumi.String(""), +// VmName: pulumi.String("VMName"), +// VmNamePrefix: pulumi.String("VMNamePrefix"), +// LicenseType: pulumi.String("SLES_BYOS"), +// BootDiagnostics: spotinst.StatefulNodeAzureBootDiagnosticArray{ +// &spotinst.StatefulNodeAzureBootDiagnosticArgs{ +// IsEnabled: pulumi.Bool(true), +// StorageUrl: pulumi.String("https://.blob.core.windows.net/test"), +// Type: pulumi.String("unmanaged"), +// }, +// }, +// DataDisks: spotinst.StatefulNodeAzureDataDiskArray{ +// &spotinst.StatefulNodeAzureDataDiskArgs{ +// SizeGb: pulumi.Int(1), +// Lun: pulumi.Int(1), +// Type: pulumi.String("Standard_LRS"), +// }, +// &spotinst.StatefulNodeAzureDataDiskArgs{ +// SizeGb: pulumi.Int(10), +// Lun: pulumi.Int(2), +// Type: pulumi.String("Standard_LRS"), +// }, +// }, +// Extensions: spotinst.StatefulNodeAzureExtensionArray{ +// &spotinst.StatefulNodeAzureExtensionArgs{ +// Name: pulumi.String("extensionName"), +// Type: pulumi.String("customScript"), +// Publisher: pulumi.String("Microsoft.Azure.Extensions"), +// ApiVersion: pulumi.String("2.0"), +// MinorVersionAutoUpgrade: pulumi.Bool(true), +// ProtectedSettings: pulumi.Map{ +// "script": pulumi.Any("IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg=="), +// }, +// PublicSettings: pulumi.Map{ +// "fileUris": pulumi.Any{ +// "https://testspot/Azuretest.sh", +// }, +// }, +// }, +// }, +// Image: &spotinst.StatefulNodeAzureImageArgs{ +// MarketplaceImages: spotinst.StatefulNodeAzureImageMarketplaceImageArray{ +// &spotinst.StatefulNodeAzureImageMarketplaceImageArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("UbuntuServer"), +// Sku: pulumi.String("16.04-LTS"), +// Version: pulumi.String("latest"), +// }, +// }, +// CustomImages: spotinst.StatefulNodeAzureImageCustomImageArray{ +// &spotinst.StatefulNodeAzureImageCustomImageArgs{ +// CustomImageResourceGroupName: pulumi.String("resourceGroupName"), +// Name: pulumi.String("imageName"), +// }, +// }, +// Galleries: spotinst.StatefulNodeAzureImageGalleryArray{ +// &spotinst.StatefulNodeAzureImageGalleryArgs{ +// GalleryResourceGroupName: pulumi.String("resourceGroupName"), +// GalleryName: pulumi.String("galleryName"), +// ImageName: pulumi.String("imageName"), +// VersionName: pulumi.String("1.1.0"), +// }, +// }, +// }, +// LoadBalancers: spotinst.StatefulNodeAzureLoadBalancerArray{ +// &spotinst.StatefulNodeAzureLoadBalancerArgs{ +// Type: pulumi.String("loadBalancer"), +// ResourceGroupName: pulumi.String("testResourceGroup"), +// Name: pulumi.String("testLoadBalancer"), +// Sku: pulumi.String("Standard"), +// BackendPoolNames: pulumi.StringArray{ +// pulumi.String("testBackendPool1"), +// pulumi.String("testBackendPool2"), +// }, +// }, +// }, +// Login: &spotinst.StatefulNodeAzureLoginArgs{ +// UserName: pulumi.String("admin"), +// SshPublicKey: pulumi.String("33a2s1f3g5a1df5g1ad3f2g1adfg56dfg=="), +// }, +// ManagedServiceIdentities: spotinst.StatefulNodeAzureManagedServiceIdentityArray{ +// &spotinst.StatefulNodeAzureManagedServiceIdentityArgs{ +// Name: pulumi.String("mySI2"), +// ResourceGroupName: pulumi.String("myResourceGroup"), +// }, +// }, +// Network: &spotinst.StatefulNodeAzureNetworkArgs{ +// NetworkResourceGroupName: pulumi.String("subnetResourceGroup"), +// VirtualNetworkName: pulumi.String("vname"), +// NetworkInterfaces: spotinst.StatefulNodeAzureNetworkNetworkInterfaceArray{ +// &spotinst.StatefulNodeAzureNetworkNetworkInterfaceArgs{ +// IsPrimary: pulumi.Bool(true), +// SubnetName: pulumi.String("testSubnet"), +// AssignPublicIp: pulumi.Bool(true), +// PublicIpSku: pulumi.String("Standard"), +// NetworkSecurityGroups: spotinst.StatefulNodeAzureNetworkNetworkInterfaceNetworkSecurityGroupArray{ +// &spotinst.StatefulNodeAzureNetworkNetworkInterfaceNetworkSecurityGroupArgs{ +// NetworkResourceGroupName: pulumi.String("test"), +// Name: pulumi.String("test"), +// }, +// }, +// EnableIpForwarding: pulumi.Bool(true), +// PrivateIpAddresses: pulumi.StringArray{ +// pulumi.String("172.23.4.20"), +// }, +// AdditionalIpConfigurations: spotinst.StatefulNodeAzureNetworkNetworkInterfaceAdditionalIpConfigurationArray{ +// &spotinst.StatefulNodeAzureNetworkNetworkInterfaceAdditionalIpConfigurationArgs{ +// Name: pulumi.String("test"), +// PrivateIpAddressVersion: pulumi.String("IPv4"), +// }, +// }, +// PublicIps: spotinst.StatefulNodeAzureNetworkNetworkInterfacePublicIpArray{ +// &spotinst.StatefulNodeAzureNetworkNetworkInterfacePublicIpArgs{ +// NetworkResourceGroupName: pulumi.String("resourceGroup"), +// Name: pulumi.String("test"), +// }, +// }, +// ApplicationSecurityGroups: spotinst.StatefulNodeAzureNetworkNetworkInterfaceApplicationSecurityGroupArray{ +// &spotinst.StatefulNodeAzureNetworkNetworkInterfaceApplicationSecurityGroupArgs{ +// NetworkResourceGroupName: pulumi.String("AsgResourceGroup"), +// Name: pulumi.String("AsgName"), +// }, +// }, +// }, +// }, +// }, +// OsDisk: &spotinst.StatefulNodeAzureOsDiskArgs{ +// SizeGb: pulumi.Int(30), +// Type: pulumi.String("Standard_LRS"), +// Caching: pulumi.String("ReadOnly"), +// }, +// Secrets: spotinst.StatefulNodeAzureSecretArray{ +// &spotinst.StatefulNodeAzureSecretArgs{ +// SourceVaults: spotinst.StatefulNodeAzureSecretSourceVaultArray{ +// &spotinst.StatefulNodeAzureSecretSourceVaultArgs{ +// Name: pulumi.String("string"), +// ResourceGroupName: pulumi.String("string"), +// }, +// }, +// VaultCertificates: spotinst.StatefulNodeAzureSecretVaultCertificateArray{ +// &spotinst.StatefulNodeAzureSecretVaultCertificateArgs{ +// CertificateUrl: pulumi.String("string"), +// CertificateStore: pulumi.String("string"), +// }, +// }, +// }, +// }, +// Security: &spotinst.StatefulNodeAzureSecurityArgs{ +// SecurityType: pulumi.String("Standard"), +// SecureBootEnabled: pulumi.Bool(false), +// VtpmEnabled: pulumi.Bool(false), +// }, +// Tags: spotinst.StatefulNodeAzureTagArray{ +// &spotinst.StatefulNodeAzureTagArgs{ +// TagKey: pulumi.String("Creator"), +// TagValue: pulumi.String("string"), +// }, +// }, +// Health: &spotinst.StatefulNodeAzureHealthArgs{ +// HealthCheckTypes: pulumi.StringArray{ +// pulumi.String("vmState"), +// }, +// UnhealthyDuration: pulumi.Int(300), +// GracePeriod: pulumi.Int(120), +// AutoHealing: pulumi.Bool(true), +// }, +// ShouldPersistOsDisk: pulumi.Bool(false), +// OsDiskPersistenceMode: pulumi.String("reattach"), +// ShouldPersistDataDisks: pulumi.Bool(true), +// DataDisksPersistenceMode: pulumi.String("reattach"), +// ShouldPersistNetwork: pulumi.Bool(true), +// SchedulingTasks: spotinst.StatefulNodeAzureSchedulingTaskArray{ +// &spotinst.StatefulNodeAzureSchedulingTaskArgs{ +// IsEnabled: pulumi.Bool(true), +// Type: pulumi.String("pause"), +// CronExpression: pulumi.String("44 10 * * *"), +// }, +// &spotinst.StatefulNodeAzureSchedulingTaskArgs{ +// IsEnabled: pulumi.Bool(true), +// Type: pulumi.String("resume"), +// CronExpression: pulumi.String("48 10 * * *"), +// }, +// &spotinst.StatefulNodeAzureSchedulingTaskArgs{ +// IsEnabled: pulumi.Bool(true), +// Type: pulumi.String("recycle"), +// CronExpression: pulumi.String("52 10 * * *"), +// }, +// }, +// Signals: spotinst.StatefulNodeAzureSignalArray{ +// &spotinst.StatefulNodeAzureSignalArgs{ +// Type: pulumi.String("vmReady"), +// Timeout: pulumi.Int(20), +// }, +// &spotinst.StatefulNodeAzureSignalArgs{ +// Type: pulumi.String("vmReady"), +// Timeout: pulumi.Int(40), +// }, +// }, +// ProximityPlacementGroups: spotinst.StatefulNodeAzureProximityPlacementGroupArray{ +// &spotinst.StatefulNodeAzureProximityPlacementGroupArgs{ +// Name: pulumi.String("TestPPG"), +// ResourceGroupName: pulumi.String("TestResourceGroup"), +// }, +// }, +// Deletes: spotinst.StatefulNodeAzureDeleteArray{ +// &spotinst.StatefulNodeAzureDeleteArgs{ +// ShouldTerminateVm: pulumi.Bool(true), +// NetworkShouldDeallocate: pulumi.Bool(true), +// NetworkTtlInHours: pulumi.Int(0), +// DiskShouldDeallocate: pulumi.Bool(true), +// DiskTtlInHours: pulumi.Int(0), +// SnapshotShouldDeallocate: pulumi.Bool(true), +// SnapshotTtlInHours: pulumi.Int(0), +// PublicIpShouldDeallocate: pulumi.Bool(true), +// PublicIpTtlInHours: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// +// # Argument Reference +// +// The following arguments are supported: +// +// * `name` - (Required) Azure stateful node name. +// * `region` - (Required) The Azure region your stateful node will be created in. +// * `resourceGroupName` - (Required) Name of the Resource Group for stateful node. +// * `description` - (Optional) Describe your Azure stateful node. +// +// +// ## Strategy +// +// * `strategy` - (Required) Strategy for stateful node. +// - `drainingTimeout` - (Optional, Default `120`) Time (in seconds) to allow the VM be drained from incoming TCP connections and detached from MLB before terminating it during a scale down operation. +// - `availabilityVsCost` - (Optional) Set the desired preference for the Spot market VM selection. (100- Availability, 0- cost). +// - `fallbackToOnDemand` - (Required) In case of no spots available, Stateful Node will launch an On-demand instance instead. +// - `optimizationWindows` - (Optional) Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))", not empty if revertToSpot.performAt = timeWindow. +// - `odWindows` - (Optional) Define the time windows in which the underlying VM will be set as an on-demand lifecycle type. During the entire time window, the rest of the strategy processes will be paused. +// Switching between on-demand and Spot VM types at the enter/exit of the time window will trigger the recycling of the stateful node. Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))". +// - `preferredLifeCycle` - (Optional, Enum `"od", "spot"`, Default `"spot"`) The desired type of VM. +// - `revertToSpot` - (Optional) Hold settings for strategy correction - replacing On-Demand for Spot VMs. +// - `performAt` - (Required, Enum `"timeWindow", "never", "always"`, Default `"always"`) Settings for maintenance strategy. +// - `capacityReservation` - (Optional) On-demand Capacity Reservation group enables you to reserve Compute capacity in an Azure region or an Availability Zone for any duration of time. [CRG can only be created on the Azure end.](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-create) +// - `shouldUtilize` - (Required) Determines whether capacity reservations should be utilized. +// - `utilizationStrategy` - (Required, Enum `"utilizeOverSpot", "utilizeOverOD"`) The priority requested for using CRG. This value will determine if CRG is used ahead of spot VMs or On-demand VMs. (`"utilizeOverOD"`- If picked, we will use CRG only in case On demand should be launched. `"utilizeOverSpot"`- CRG will be preferred over Spot. Only after CRG is fully used, spot VMs can be used.) +// - `capacityReservationGroups` - (Optional) List of the desired CRGs to use under the associated Azure subscription. When null we will utilize any available reservation that matches the launch specification. +// - `crgName` - (Required) The name of the CRG. +// - `crgResourceGroupName` - (Required) Azure resource group name +// - `crgShouldPrioritize` - The desired CRG to utilize ahead of other CRGs in the subscription. +// +// +// ## Compute +// +// * `os` - (Required, Enum `"Linux", "Windows"`) Type of operating system. +// * `odSizes` - (Required) Available On-Demand sizes. +// * `spotSizes` - (Required) Available Spot-VM sizes. +// * `preferredSpotSizes` - (Optional) Prioritize Spot VM sizes when launching Spot VMs for the group. If set, must be a sublist of compute.vmSizes.spotSizes. +// * `zones` - (Optional, Enum `"1", "2", "3"`) List of Azure Availability Zones in the defined region. If not defined, Virtual machines will be launched regionally. +// * `preferredZone` - (Optional, Enum `"1", "2", "3"`) The AZ to prioritize when launching VMs. If no markets are available in the Preferred AZ, VMs are launched in the non-preferred AZ. Must be a sublist of compute.zones. +// * `customData` - (Optional) This value will hold the YAML in base64 and will be executed upon VM launch. +// * `shutdownScript` - (Optional) Shutdown script for the stateful node. Value should be passed as a string encoded at Base64 only. +// * `userData` - (Optional) Define a set of scripts or other metadata that's inserted to an Azure virtual machine at provision time. (Base64 encoded) +// * `vmName` - (Optional) Set a VM name that will be persisted throughout the entire node lifecycle. This can't be set if `vmNamePrefix` is set. +// * `vmNamePrefix` - (Optional) Set a VM name prefix to be used for all launched VMs and the VM resources. This can't be set if `vmName` is set. +// * `licenseType` - (Optional) Specify an existing Azure license type to use when launching new VMs. Valid values for Windows OS: "Windows_Server", "Windows_Client", Valid values for Linux OS: "RHEL_BYOS", "SLES_BYOS" +// +// +// ## Boot Diagnostics +// +// * `bootDiagnostics` +// - `isEnabled` - (Optional) Allows you to enable and disable the configuration of boot diagnostics at launch. +// - `storageUrl` - (Optional) The storage URI that is used if a type is unmanaged. The storage URI must follow the blob storage URI format ("https://.blob.core.windows.net/"). StorageUri is required if the type is unmanaged. StorageUri must be ‘null’ in case the boot diagnostics type is managed. +// - `type` - (Optional, Enum `"managed", "unmanaged"`) Defines the storage type on VM launch in Azure. +// +// +// ## Data Disks +// +// * `dataDisk` - (Optional) The definitions of data disks that will be created and attached to the stateful node's VM. +// - `sizeGb` - (Required) The size of the data disk in GB, required if dataDisks is specified. +// - `lun` - (Required) The LUN of the data disk. +// - `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. +// +// +// ## Extensions +// +// * `extension` - (Optional) An object for an azure extension. +// - `name` - (Required) Required on compute.launchSpecification.extensions object. +// - `type` - (Required) Required on compute.launchSpecification.extensions object. +// - `publisher` - (Required) Required on compute.launchSpecification.extensions object. +// - `apiVersion` - (Required) The API version of the extension. Required if extension specified. +// - `minorVersionAutoUpgrade` - (Required) Required on compute.launchSpecification.extensions object. +// - `protectedSettings` - (Optional) Object for protected settings. +// - `publicSettings` - (Optional) Object for public settings. +// +// +// ## Image +// +// * `image` +// - `marketplaceImage` - (Optional) Select an image from Azure's Marketplace image catalogue. Required if the custom image or gallery image are not specified. +// - `publisher` - (Required) Image publisher. +// - `offer` - (Required) Image offer. +// - `sku` - (Required) Image Stock Keeping Unit, which is the specific version of the image. +// - `version` - (Required, Default `"latest"`) Image's version. if version not provided we use "latest". +// - `gallery` - (Optional) Gallery image definitions. Required if custom image or marketplace image are not specified. +// - `galleryResourceGroupName` - (Required) The resource group name for gallery image. +// - `galleryName` - (Required) Name of the gallery. +// - `imageName` - (Required) Name of the gallery image. +// - `versionName` - (Required) Image's version. Can be in the format x.x.x or 'latest'. +// - `customImage` - (Optional) Custom image definitions. Required if marketplace image or gallery image are not specified. +// - `customImageResourceGroupName` - (Required) The resource group name for custom image. +// - `name` - (Required) The name of the custom image. +// +// +// ## Load Balancer +// +// * `loadBalancer` - (Optional) Add a load balancer. For Azure Gateway, each Backend Pool is a separate load balancer. +// - `type` - (Required, Enum `"loadBalancer", "applicationGateway"`) The type of load balancer. +// - `resourceGroupName` - (Required) The Resource Group name of the Load Balancer. +// - `name` - (Required) Name of the Application Gateway/Load Balancer. +// - `sku` - (Optional) +// - if type is `"LoadBalancer"` then possible values are `“Standard", "Basic”`. +// - If ApplicationGateway then possible values are +// `“Standard_Large”, “Standard_Medium”, “Standard_Small”, “Standard_v2", “WAF_Large”, “WAF_Medium", “WAF_v2"`. +// - `backendPoolNames` - (Optional) Name of the Backend Pool to register the Stateful Node VMs to. Each Backend Pool is a separate load balancer. Required if Type is APPLICATION_GATEWAY. +// +// +// ## Login +// +// * `login` - (Required) Set admin access for accessing your VMs. Password/SSH is required for Linux. +// - `userName` - (Required) username for admin access to VMs. +// - `sshPublicKey` - (Optional) SSH for admin access to Linux VMs. Optional for Linux. +// - `password` - (Optional) Password for admin access to Windows VMs. Required for Windows. +// +// +// ## Managed Service Identities +// +// * `managedServiceIdentities` - (Optional) Add a user-assigned managed identity to the Stateful Node's VM. +// - `name` - (Required) name of the managed identity. +// - `resourceGroupName` - (Required) The Resource Group that the user-assigned managed identity resides in. +// +// +// ## Proximity Placement Groups +// +// * `proximityPlacementGroups` - (Optional) Defines the proximity placement group in which the VM will be launched. +// - `name` - (Required) name of the proximity placement group. +// - `resourceGroupName` - (Required) The Resource Group name of the proximity placement group. +// +// +// ## Network +// +// * `network` - (Required) Define the Virtual Network and Subnet for your Stateful Node. +// - `networkResourceGroupName` - (Required) Vnet Resource Group Name. +// - `virtualNetworkName` - (Required) Virtual Network. +// - `networkInterface` - (Required) Define a network interface +// - `isPrimary` - (Required) Defines whether the network interface is primary or not. +// - `subnetName` - (Required) Subnet name. +// - `assignPublicIp` - (Optional) Assign public IP. +// - `publicIpSku` - (Optional) Required if assignPublicIp=true values=[Standard/Basic]. +// - `networkSecurityGroup` - (Optional) Network Security Group. +// - `networkResourceGroupName` - (Required) Requires valid security group name. +// - `name` - (Required) Requires valid resource group name. +// - `enableIpForwarding` - (Optional) Enable IP Forwarding. +// - `privateIpAddresses` - (Optional) A list with unique items that every item is a valid IP. +// - `additionalIpConfigurations` - (Optional) Additional configuration of network interface. +// - `name` - (Required) Configuration name. +// - `privateIpAddressVersion` - (Required, Enum `"IPv4", "IPv6"` Default `"IPv4"`) Version of the private IP address. +// - `publicIps` - (Optional) Defined a pool of Public Ips (from Azure), that will be associated to the network interface. We will associate one public ip per instance until the pool is exhausted, in which case, we will create a new one. +// - `resourceGroupName` - (Required) The resource group of the public ip. +// - `name` - (Required) - The name of the public ip. +// - `applicationSecurityGroups` - (Optional) Network Security Group. +// - `resourceGroupName` - (Required) Requires valid security group name. +// - `name` - (Required) Requires valid resource group name. +// +// +// ## OS Disk +// +// * `osDisk` - (Optional) Specify OS disk specification other than default. +// - `sizeGb` - (Optional, Default `"30"`) The size of the data disk in GB. +// - `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS"`) The type of the OS disk. +// - `caching` - (Optional, Enum `"None", "ReadOnly", "ReadWrite"`) Specifies the host caching requirements. With disk caching enabled, VMs can achieve higher levels of performance. If not specified, the Azure default behavior will be applied. +// +// +// ## Secret +// +// * `secret` - (Optional) Set of certificates that should be installed on the VM. +// - `sourceVault` - (Required) The key vault reference, contains the required certificates. +// - `name` - (Required) The name of the key vault. +// - `resourceGroupName` - (Required) The resource group name of the key vault. +// - `vaultCertificates` - (Required) The required certificate references. +// - `certificateUrl` - (Optional) The URL of the certificate under the key vault. +// - `certificateStore` - (Required) The certificate store directory the VM. The directory is created in the LocalMachine account. +// - This field is required only when using Windows OS type +// - This field must be ‘null’ when the OS type is Linux +// +// +// ## Security +// +// * `security` - (Optional) Specifies the Security related profile settings for the virtual machine. +// - `secureBootEnabled` - (Optional) Specifies whether secure boot should be enabled on the virtual machine. +// - `securityType` - (Optional) Enum: `"Standard", "TrustedLaunch"` Security type refers to the different security features of a virtual machine. Security features like Trusted launch virtual machines help to improve the security of Azure generation 2 virtual machines. +// - `vtpmEnabled` - (Optional) Specifies whether vTPM should be enabled on the virtual machine. +// +// +// ## Tag +// +// * `tag` - (Optional) Unique Key-Value pair for all Stateful Node Resources. +// - `tagKey` - (Optional) Tag Key for Stateful Node Resources. +// - `tagValue` - (Optional) Tag Value for Stateful Node Resources. +// +// +// ## Health +// +// * `health` - (Optional) Set the auto healing preferences for unhealthy VMs. +// - `healthCheckTypes` - (Optional, Enum `"vmState", "applicationGateway"`) Healthcheck to use to validate VM health. +// - `unhealthyDuration` - (Optional) Amount of time to be unhealthy before a replacement is triggered. +// - `autoHealing` - (Required) Enable Autohealing of unhealthy VMs. +// - `gracePeriod` - (Optional) Period of time to wait for VM to reach healthiness before monitoring for unhealthiness. +// +// +// ## Persistence +// +// * `shouldPersistOsDisk` - (Required) Should persist os disk. +// * `osDiskPersistenceMode` - (Optional, Enum `"reattach", "onLaunch"`) +// * `shouldPersistDataDisks` - (Required) Should persist data disks. +// * `dataDisksPersistenceMode` - (Optional, Enum `"reattach", "onLaunch"`) +// * `shouldPersistNetwork` - (Required) Should persist network. +// +// +// ## Scheduling Tasks +// +// * `schedulingTask` - (Optional) Scheduling settings object for stateful node. +// - `isEnabled` - (Required) Is scheduled task enabled for stateful node. +// - `type` - (Required, Enum `"pause", "resume", "recycle") The type of the scheduled task +// - `cronExpression` (Required) A expression which describes when to execute the scheduled task (UTC). +// +// +// ## Signals +// +// * `signal` - (Optional) A signal object defined for the stateful node. +// - `type` - (Required, Enum `"vmReady", "vmReadyToShutdown"`) The type of the signal defined for the stateful node. +// - `timeout` - (Required, Default `"1800"`) The timeout in seconds to hold the vm until a signal is sent. If no signal is sent the vm will be replaced (vmReady) or we will terminate the vm (vmReadyToShutdown) after the timeout. +// +// *** +// +// +// ## Attach Data Disk +// +// * `attachDataDisk` - (Optional) Create a new data disk and attach it to the stateful node. +// - `dataDiskName` - (Required) The name of the created data disk. +// - `dataDiskResourceGroupName` - (Required) The resource group name in which the data disk will be created. +// - `storageAccountType` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. +// - `sizeGb` - (Required) The size of the data disk in GB, Required if dataDisks is specified. +// - `zone` - (Optional, Enum `"1", "2", "3"`) The Availability Zone in which the data disk will be created. If not defined, the data disk will be created regionally. +// - `lun` - (Optional, Default `"orginal"`) The LUN of the data disk. If not defined, the LUN will be set in order. +// +// +// ## Detach Data Disk +// +// * `detachDataDisk` - (Optional) Detach a data disk from a stateful node. +// - `dataDiskName` - (Required) The name of the detached data disk. +// - `dataDiskResourceGroupName` - (Required) The resource group name in which the data disk exists. +// - `shouldDeallocate` - (Required) Indicates whether to delete the data disk in addition to detach. +// - `ttlInHours` - (Required, Default `"0"`) Hours to keep the disk alive before deletion. +// +// +// ## Update State +// +// * `updateState` - (Optional) Update the stateful node state. +// - `state` - (Required, Enum `"pause", "resume", "recycle"`) New state for the stateful node. +// +// +// ## Import VM +// +// * `importVm` - (Optional) Import an Azure VM and create a stateful node by providing a node configuration. +// - `resourceGroupName` - (Required) Name of the Resource Group for Stateful Node. +// - `originalVmName` - (Required) Azure Import Stateful Node Name. +// - `drainingTimeout` - (Optional) Hours to keep resources alive. +// - `resourcesRetentionTime` - (Optional) Hours to keep resources alive. +// +// +// ## Deallocation Config +// +// * `delete` - (Required) Specify deallocation parameters for stateful node deletion. +// - `shouldTerminateVm` - (Required) Indicates whether to delete the stateful node's VM. +// - `networkShouldDeallocate` - (Required) Indicates whether to delete the stateful node's network resources. +// - `networkTtlInHours` - (Optional, Default: 96) Hours to keep the network resource alive before deletion. +// - `diskShouldDeallocate` - (Required) Indicates whether to delete the stateful node's disk resources. +// - `diskTtlInHours` - (Optional, Default: 96) Hours to keep the disk resource alive before deletion. +// - `snapshotShouldDeallocate` - (Required) Indicates whether to delete the stateful node's snapshot resources. +// - `snapshotTtlInHours` - (Optional, Default: 96) Hours to keep the snapshots alive before deletion. +// - `publicIpShouldDeallocate` - (Required) Indicates whether to delete the stateful node's public ip resources. +// - `publicIpTtlInHours` - (Optional, Default: 96) Hours to keep the public ip alive before deletion. type StatefulNodeAzure struct { pulumi.CustomResourceState diff --git a/sdk/java/src/main/java/com/pulumi/spotinst/StatefulNodeAzure.java b/sdk/java/src/main/java/com/pulumi/spotinst/StatefulNodeAzure.java index 4ccddb57..897fff58 100644 --- a/sdk/java/src/main/java/com/pulumi/spotinst/StatefulNodeAzure.java +++ b/sdk/java/src/main/java/com/pulumi/spotinst/StatefulNodeAzure.java @@ -41,6 +41,535 @@ /** * Provides a Spotinst stateful node Azure resource. * + * ## Example Usage + * + * <!--Start PulumiCodeChooser --> + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.spotinst.StatefulNodeAzure; + * import com.pulumi.spotinst.StatefulNodeAzureArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureStrategyArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureStrategyRevertToSpotArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureBootDiagnosticArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureDataDiskArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureExtensionArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureImageArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureLoadBalancerArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureLoginArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureManagedServiceIdentityArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureNetworkArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureOsDiskArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureSecretArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureSecurityArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureTagArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureHealthArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureSchedulingTaskArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureSignalArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureProximityPlacementGroupArgs; + * import com.pulumi.spotinst.inputs.StatefulNodeAzureDeleteArgs; + * 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 testStatefulNodeAzure = new StatefulNodeAzure("testStatefulNodeAzure", StatefulNodeAzureArgs.builder() + * .region("eastus") + * .resourceGroupName("spotinst-azure") + * .description("example_stateful_node_azure_description") + * .strategy(StatefulNodeAzureStrategyArgs.builder() + * .drainingTimeout(30) + * .fallbackToOnDemand(true) + * .optimizationWindows("Tue:19:46-Tue:20:46") + * .odWindows("Wed:19:46-Wed:21:46") + * .availabilityVsCost(100) + * .revertToSpot(StatefulNodeAzureStrategyRevertToSpotArgs.builder() + * .performAt("timeWindow") + * .build()) + * .preferredLifeCycle("od") + * .capacityReservations(StatefulNodeAzureStrategyCapacityReservationArgs.builder() + * .shouldUtilize(true) + * .utilizationStrategy("utilizeOverOD") + * .capacityReservationGroups(StatefulNodeAzureStrategyCapacityReservationCapacityReservationGroupArgs.builder() + * .crgName("crg name") + * .crgResourceGroupName("resourceGroupName") + * .crgShouldPrioritize(true) + * .build()) + * .build()) + * .build()) + * .os("Linux") + * .odSizes( + * "standard_ds1_v2", + * "standard_ds2_v2") + * .spotSizes( + * "standard_ds1_v2", + * "standard_ds2_v2") + * .preferredSpotSizes("standard_ds1_v2") + * .zones( + * "1", + * "3") + * .preferredZone("1") + * .customData("") + * .shutdownScript("") + * .userData("") + * .vmName("VMName") + * .vmNamePrefix("VMNamePrefix") + * .licenseType("SLES_BYOS") + * .bootDiagnostics(StatefulNodeAzureBootDiagnosticArgs.builder() + * .isEnabled(true) + * .storageUrl("https://.blob.core.windows.net/test") + * .type("unmanaged") + * .build()) + * .dataDisks( + * StatefulNodeAzureDataDiskArgs.builder() + * .sizeGb(1) + * .lun(1) + * .type("Standard_LRS") + * .build(), + * StatefulNodeAzureDataDiskArgs.builder() + * .sizeGb(10) + * .lun(2) + * .type("Standard_LRS") + * .build()) + * .extensions(StatefulNodeAzureExtensionArgs.builder() + * .name("extensionName") + * .type("customScript") + * .publisher("Microsoft.Azure.Extensions") + * .apiVersion("2.0") + * .minorVersionAutoUpgrade(true) + * .protectedSettings(Map.of("script", "IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg==")) + * .publicSettings(Map.of("fileUris", "https://testspot/Azuretest.sh")) + * .build()) + * .image(StatefulNodeAzureImageArgs.builder() + * .marketplaceImages(StatefulNodeAzureImageMarketplaceImageArgs.builder() + * .publisher("Canonical") + * .offer("UbuntuServer") + * .sku("16.04-LTS") + * .version("latest") + * .build()) + * .customImages(StatefulNodeAzureImageCustomImageArgs.builder() + * .customImageResourceGroupName("resourceGroupName") + * .name("imageName") + * .build()) + * .galleries(StatefulNodeAzureImageGalleryArgs.builder() + * .galleryResourceGroupName("resourceGroupName") + * .galleryName("galleryName") + * .imageName("imageName") + * .versionName("1.1.0") + * .build()) + * .build()) + * .loadBalancers(StatefulNodeAzureLoadBalancerArgs.builder() + * .type("loadBalancer") + * .resourceGroupName("testResourceGroup") + * .name("testLoadBalancer") + * .sku("Standard") + * .backendPoolNames( + * "testBackendPool1", + * "testBackendPool2") + * .build()) + * .login(StatefulNodeAzureLoginArgs.builder() + * .userName("admin") + * .sshPublicKey("33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==") + * .build()) + * .managedServiceIdentities(StatefulNodeAzureManagedServiceIdentityArgs.builder() + * .name("mySI2") + * .resourceGroupName("myResourceGroup") + * .build()) + * .network(StatefulNodeAzureNetworkArgs.builder() + * .networkResourceGroupName("subnetResourceGroup") + * .virtualNetworkName("vname") + * .networkInterfaces(StatefulNodeAzureNetworkNetworkInterfaceArgs.builder() + * .isPrimary(true) + * .subnetName("testSubnet") + * .assignPublicIp(true) + * .publicIpSku("Standard") + * .networkSecurityGroups(StatefulNodeAzureNetworkNetworkInterfaceNetworkSecurityGroupArgs.builder() + * .networkResourceGroupName("test") + * .name("test") + * .build()) + * .enableIpForwarding(true) + * .privateIpAddresses("172.23.4.20") + * .additionalIpConfigurations(StatefulNodeAzureNetworkNetworkInterfaceAdditionalIpConfigurationArgs.builder() + * .name("test") + * .privateIpAddressVersion("IPv4") + * .build()) + * .publicIps(StatefulNodeAzureNetworkNetworkInterfacePublicIpArgs.builder() + * .networkResourceGroupName("resourceGroup") + * .name("test") + * .build()) + * .applicationSecurityGroups(StatefulNodeAzureNetworkNetworkInterfaceApplicationSecurityGroupArgs.builder() + * .networkResourceGroupName("AsgResourceGroup") + * .name("AsgName") + * .build()) + * .build()) + * .build()) + * .osDisk(StatefulNodeAzureOsDiskArgs.builder() + * .sizeGb(30) + * .type("Standard_LRS") + * .caching("ReadOnly") + * .build()) + * .secrets(StatefulNodeAzureSecretArgs.builder() + * .sourceVaults(StatefulNodeAzureSecretSourceVaultArgs.builder() + * .name("string") + * .resourceGroupName("string") + * .build()) + * .vaultCertificates(StatefulNodeAzureSecretVaultCertificateArgs.builder() + * .certificateUrl("string") + * .certificateStore("string") + * .build()) + * .build()) + * .security(StatefulNodeAzureSecurityArgs.builder() + * .securityType("Standard") + * .secureBootEnabled(false) + * .vtpmEnabled(false) + * .build()) + * .tags(StatefulNodeAzureTagArgs.builder() + * .tagKey("Creator") + * .tagValue("string") + * .build()) + * .health(StatefulNodeAzureHealthArgs.builder() + * .healthCheckTypes("vmState") + * .unhealthyDuration(300) + * .gracePeriod(120) + * .autoHealing(true) + * .build()) + * .shouldPersistOsDisk(false) + * .osDiskPersistenceMode("reattach") + * .shouldPersistDataDisks(true) + * .dataDisksPersistenceMode("reattach") + * .shouldPersistNetwork(true) + * .schedulingTasks( + * StatefulNodeAzureSchedulingTaskArgs.builder() + * .isEnabled(true) + * .type("pause") + * .cronExpression("44 10 * * *") + * .build(), + * StatefulNodeAzureSchedulingTaskArgs.builder() + * .isEnabled(true) + * .type("resume") + * .cronExpression("48 10 * * *") + * .build(), + * StatefulNodeAzureSchedulingTaskArgs.builder() + * .isEnabled(true) + * .type("recycle") + * .cronExpression("52 10 * * *") + * .build()) + * .signals( + * StatefulNodeAzureSignalArgs.builder() + * .type("vmReady") + * .timeout(20) + * .build(), + * StatefulNodeAzureSignalArgs.builder() + * .type("vmReady") + * .timeout(40) + * .build()) + * .proximityPlacementGroups(StatefulNodeAzureProximityPlacementGroupArgs.builder() + * .name("TestPPG") + * .resourceGroupName("TestResourceGroup") + * .build()) + * .deletes(StatefulNodeAzureDeleteArgs.builder() + * .shouldTerminateVm(true) + * .networkShouldDeallocate(true) + * .networkTtlInHours(0) + * .diskShouldDeallocate(true) + * .diskTtlInHours(0) + * .snapshotShouldDeallocate(true) + * .snapshotTtlInHours(0) + * .publicIpShouldDeallocate(true) + * .publicIpTtlInHours(0) + * .build()) + * .build()); + * + * // ------------------------------------------------------------------- + * } + * } + * ``` + * <!--End PulumiCodeChooser --> + * + * # Argument Reference + * + * The following arguments are supported: + * + * * `name` - (Required) Azure stateful node name. + * * `region` - (Required) The Azure region your stateful node will be created in. + * * `resource_group_name` - (Required) Name of the Resource Group for stateful node. + * * `description` - (Optional) Describe your Azure stateful node. + * + * <a id="strategy"></a> + * ## Strategy + * + * * `strategy` - (Required) Strategy for stateful node. + * * `draining_timeout` - (Optional, Default `120`) Time (in seconds) to allow the VM be drained from incoming TCP connections and detached from MLB before terminating it during a scale down operation. + * * `availability_vs_cost` - (Optional) Set the desired preference for the Spot market VM selection. (100- Availability, 0- cost). + * * `fallback_to_on_demand` - (Required) In case of no spots available, Stateful Node will launch an On-demand instance instead. + * * `optimization_windows` - (Optional) Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))", not empty if revertToSpot.performAt = timeWindow. + * * `od_windows` - (Optional) Define the time windows in which the underlying VM will be set as an on-demand lifecycle type. During the entire time window, the rest of the strategy processes will be paused. + * Switching between on-demand and Spot VM types at the enter/exit of the time window will trigger the recycling of the stateful node. Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))". + * * `preferred_life_cycle` - (Optional, Enum `"od", "spot"`, Default `"spot"`) The desired type of VM. + * * `revert_to_spot` - (Optional) Hold settings for strategy correction - replacing On-Demand for Spot VMs. + * * `perform_at` - (Required, Enum `"timeWindow", "never", "always"`, Default `"always"`) Settings for maintenance strategy. + * * `capacity_reservation` - (Optional) On-demand Capacity Reservation group enables you to reserve Compute capacity in an Azure region or an Availability Zone for any duration of time. [CRG can only be created on the Azure end.](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-create) + * * `should_utilize` - (Required) Determines whether capacity reservations should be utilized. + * * `utilization_strategy` - (Required, Enum `"utilizeOverSpot", "utilizeOverOD"`) The priority requested for using CRG. This value will determine if CRG is used ahead of spot VMs or On-demand VMs. (`"utilizeOverOD"`- If picked, we will use CRG only in case On demand should be launched. `"utilizeOverSpot"`- CRG will be preferred over Spot. Only after CRG is fully used, spot VMs can be used.) + * * `capacity_reservation_groups` - (Optional) List of the desired CRGs to use under the associated Azure subscription. When null we will utilize any available reservation that matches the launch specification. + * * `crg_name` - (Required) The name of the CRG. + * * `crg_resource_group_name` - (Required) Azure resource group name + * * `crg_should_prioritize` - The desired CRG to utilize ahead of other CRGs in the subscription. + * + * <a id="compute"></a> + * ## Compute + * + * * `os` - (Required, Enum `"Linux", "Windows"`) Type of operating system. + * * `od_sizes` - (Required) Available On-Demand sizes. + * * `spot_sizes` - (Required) Available Spot-VM sizes. + * * `preferred_spot_sizes` - (Optional) Prioritize Spot VM sizes when launching Spot VMs for the group. If set, must be a sublist of compute.vmSizes.spotSizes. + * * `zones` - (Optional, Enum `"1", "2", "3"`) List of Azure Availability Zones in the defined region. If not defined, Virtual machines will be launched regionally. + * * `preferred_zone` - (Optional, Enum `"1", "2", "3"`) The AZ to prioritize when launching VMs. If no markets are available in the Preferred AZ, VMs are launched in the non-preferred AZ. Must be a sublist of compute.zones. + * * `custom_data` - (Optional) This value will hold the YAML in base64 and will be executed upon VM launch. + * * `shutdown_script` - (Optional) Shutdown script for the stateful node. Value should be passed as a string encoded at Base64 only. + * * `user_data` - (Optional) Define a set of scripts or other metadata that's inserted to an Azure virtual machine at provision time. (Base64 encoded) + * * `vm_name` - (Optional) Set a VM name that will be persisted throughout the entire node lifecycle. This can't be set if `vm_name_prefix` is set. + * * `vm_name_prefix` - (Optional) Set a VM name prefix to be used for all launched VMs and the VM resources. This can't be set if `vm_name` is set. + * * `license_type` - (Optional) Specify an existing Azure license type to use when launching new VMs. Valid values for Windows OS: "Windows_Server", "Windows_Client", Valid values for Linux OS: "RHEL_BYOS", "SLES_BYOS" + * + * <a id="boot_diagnostics"></a> + * ## Boot Diagnostics + * + * * `boot_diagnostics` + * * `is_enabled` - (Optional) Allows you to enable and disable the configuration of boot diagnostics at launch. + * * `storage_url` - (Optional) The storage URI that is used if a type is unmanaged. The storage URI must follow the blob storage URI format ("https://.blob.core.windows.net/"). StorageUri is required if the type is unmanaged. StorageUri must be ‘null’ in case the boot diagnostics type is managed. + * * `type` - (Optional, Enum `"managed", "unmanaged"`) Defines the storage type on VM launch in Azure. + * + * <a id="data_disks"></a> + * ## Data Disks + * + * * `data_disk` - (Optional) The definitions of data disks that will be created and attached to the stateful node's VM. + * * `size_gb` - (Required) The size of the data disk in GB, required if dataDisks is specified. + * * `lun` - (Required) The LUN of the data disk. + * * `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. + * + * <a id="extensions"></a> + * ## Extensions + * + * * `extension` - (Optional) An object for an azure extension. + * * `name` - (Required) Required on compute.launchSpecification.extensions object. + * * `type` - (Required) Required on compute.launchSpecification.extensions object. + * * `publisher` - (Required) Required on compute.launchSpecification.extensions object. + * * `api_version` - (Required) The API version of the extension. Required if extension specified. + * * `minor_version_auto_upgrade` - (Required) Required on compute.launchSpecification.extensions object. + * * `protected_settings` - (Optional) Object for protected settings. + * * `public_settings` - (Optional) Object for public settings. + * + * <a id="image"></a> + * ## Image + * + * * `image` + * * `marketplace_image` - (Optional) Select an image from Azure's Marketplace image catalogue. Required if the custom image or gallery image are not specified. + * * `publisher` - (Required) Image publisher. + * * `offer` - (Required) Image offer. + * * `sku` - (Required) Image Stock Keeping Unit, which is the specific version of the image. + * * `version` - (Required, Default `"latest"`) Image's version. if version not provided we use "latest". + * * `gallery` - (Optional) Gallery image definitions. Required if custom image or marketplace image are not specified. + * * `gallery_resource_group_name` - (Required) The resource group name for gallery image. + * * `gallery_name` - (Required) Name of the gallery. + * * `image_name` - (Required) Name of the gallery image. + * * `version_name` - (Required) Image's version. Can be in the format x.x.x or 'latest'. + * * `custom_image` - (Optional) Custom image definitions. Required if marketplace image or gallery image are not specified. + * * `custom_image_resource_group_name` - (Required) The resource group name for custom image. + * * `name` - (Required) The name of the custom image. + * + * <a id="load balancer"></a> + * ## Load Balancer + * + * * `load_balancer` - (Optional) Add a load balancer. For Azure Gateway, each Backend Pool is a separate load balancer. + * * `type` - (Required, Enum `"loadBalancer", "applicationGateway"`) The type of load balancer. + * * `resource_group_name` - (Required) The Resource Group name of the Load Balancer. + * * `name` - (Required) Name of the Application Gateway/Load Balancer. + * * `sku` - (Optional) + * * if type is `"LoadBalancer"` then possible values are `“Standard", "Basic”`. + * * If ApplicationGateway then possible values are + * `“Standard_Large”, “Standard_Medium”, “Standard_Small”, “Standard_v2", “WAF_Large”, “WAF_Medium", “WAF_v2"`. + * * `backend_pool_names` - (Optional) Name of the Backend Pool to register the Stateful Node VMs to. Each Backend Pool is a separate load balancer. Required if Type is APPLICATION_GATEWAY. + * + * <a id="login"></a> + * ## Login + * + * * `login` - (Required) Set admin access for accessing your VMs. Password/SSH is required for Linux. + * * `user_name` - (Required) username for admin access to VMs. + * * `ssh_public_key` - (Optional) SSH for admin access to Linux VMs. Optional for Linux. + * * `password` - (Optional) Password for admin access to Windows VMs. Required for Windows. + * + * <a id="managed_service_identities"></a> + * ## Managed Service Identities + * + * * `managed_service_identities` - (Optional) Add a user-assigned managed identity to the Stateful Node's VM. + * * `name` - (Required) name of the managed identity. + * * `resource_group_name` - (Required) The Resource Group that the user-assigned managed identity resides in. + * + * <a id="proximity_placement_groups"></a> + * ## Proximity Placement Groups + * + * * `proximity_placement_groups` - (Optional) Defines the proximity placement group in which the VM will be launched. + * * `name` - (Required) name of the proximity placement group. + * * `resource_group_name` - (Required) The Resource Group name of the proximity placement group. + * + * <a id="network"></a> + * ## Network + * + * * `network` - (Required) Define the Virtual Network and Subnet for your Stateful Node. + * * `network_resource_group_name` - (Required) Vnet Resource Group Name. + * * `virtual_network_name` - (Required) Virtual Network. + * * `network_interface` - (Required) Define a network interface + * * `is_primary` - (Required) Defines whether the network interface is primary or not. + * * `subnet_name` - (Required) Subnet name. + * * `assign_public_ip` - (Optional) Assign public IP. + * * `public_ip_sku` - (Optional) Required if assignPublicIp=true values=[Standard/Basic]. + * * `network_security_group` - (Optional) Network Security Group. + * * `network_resource_group_name` - (Required) Requires valid security group name. + * * `name` - (Required) Requires valid resource group name. + * * `enable_ip_forwarding` - (Optional) Enable IP Forwarding. + * * `private_ip_addresses` - (Optional) A list with unique items that every item is a valid IP. + * * `additional_ip_configurations` - (Optional) Additional configuration of network interface. + * * `name` - (Required) Configuration name. + * * `private_ip_address_version` - (Required, Enum `"IPv4", "IPv6"` Default `"IPv4"`) Version of the private IP address. + * * `public_ips` - (Optional) Defined a pool of Public Ips (from Azure), that will be associated to the network interface. We will associate one public ip per instance until the pool is exhausted, in which case, we will create a new one. + * * `resource_group_name` - (Required) The resource group of the public ip. + * * `name` - (Required) - The name of the public ip. + * * `application_security_groups` - (Optional) Network Security Group. + * * `resource_group_name` - (Required) Requires valid security group name. + * * `name` - (Required) Requires valid resource group name. + * + * <a id="os_disk"></a> + * ## OS Disk + * + * * `os_disk` - (Optional) Specify OS disk specification other than default. + * * `size_gb` - (Optional, Default `"30"`) The size of the data disk in GB. + * * `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS"`) The type of the OS disk. + * * `caching` - (Optional, Enum `"None", "ReadOnly", "ReadWrite"`) Specifies the host caching requirements. With disk caching enabled, VMs can achieve higher levels of performance. If not specified, the Azure default behavior will be applied. + * + * <a id="secret"></a> + * ## Secret + * + * * `secret` - (Optional) Set of certificates that should be installed on the VM. + * * `source_vault` - (Required) The key vault reference, contains the required certificates. + * * `name` - (Required) The name of the key vault. + * * `resource_group_name` - (Required) The resource group name of the key vault. + * * `vault_certificates` - (Required) The required certificate references. + * * `certificate_url` - (Optional) The URL of the certificate under the key vault. + * * `certificate_store` - (Required) The certificate store directory the VM. The directory is created in the LocalMachine account. + * * This field is required only when using Windows OS type + * * This field must be ‘null’ when the OS type is Linux + * + * <a id="secutiry"></a> + * ## Security + * + * * `security` - (Optional) Specifies the Security related profile settings for the virtual machine. + * * `secure_boot_enabled` - (Optional) Specifies whether secure boot should be enabled on the virtual machine. + * * `security_type` - (Optional) Enum: `"Standard", "TrustedLaunch"` Security type refers to the different security features of a virtual machine. Security features like Trusted launch virtual machines help to improve the security of Azure generation 2 virtual machines. + * * `vtpm_enabled` - (Optional) Specifies whether vTPM should be enabled on the virtual machine. + * + * <a id="tag"></a> + * ## Tag + * + * * `tag` - (Optional) Unique Key-Value pair for all Stateful Node Resources. + * * `tag_key` - (Optional) Tag Key for Stateful Node Resources. + * * `tag_value` - (Optional) Tag Value for Stateful Node Resources. + * + * <a id="health"></a> + * ## Health + * + * * `health` - (Optional) Set the auto healing preferences for unhealthy VMs. + * * `health_check_types` - (Optional, Enum `"vmState", "applicationGateway"`) Healthcheck to use to validate VM health. + * * `unhealthy_duration` - (Optional) Amount of time to be unhealthy before a replacement is triggered. + * * `auto_healing` - (Required) Enable Autohealing of unhealthy VMs. + * * `grace_period` - (Optional) Period of time to wait for VM to reach healthiness before monitoring for unhealthiness. + * + * <a id="persistence"></a> + * ## Persistence + * + * * `should_persist_os_disk` - (Required) Should persist os disk. + * * `os_disk_persistence_mode` - (Optional, Enum `"reattach", "onLaunch"`) + * * `should_persist_data_disks` - (Required) Should persist data disks. + * * `data_disks_persistence_mode` - (Optional, Enum `"reattach", "onLaunch"`) + * * `should_persist_network` - (Required) Should persist network. + * + * <a id="scheduling_tasks"></a> + * ## Scheduling Tasks + * + * * `scheduling_task` - (Optional) Scheduling settings object for stateful node. + * * `is_enabled` - (Required) Is scheduled task enabled for stateful node. + * * `type` - (Required, Enum `"pause", "resume", "recycle") The type of the scheduled task + * * `cron_expression` (Required) A expression which describes when to execute the scheduled task (UTC). + * + * <a id="signals"></a> + * ## Signals + * + * * `signal` - (Optional) A signal object defined for the stateful node. + * * `type` - (Required, Enum `"vmReady", "vmReadyToShutdown"`) The type of the signal defined for the stateful node. + * * `timeout` - (Required, Default `"1800"`) The timeout in seconds to hold the vm until a signal is sent. If no signal is sent the vm will be replaced (vmReady) or we will terminate the vm (vmReadyToShutdown) after the timeout. + * + * *** + * + * <a id="attach_data_disk"></a> + * ## Attach Data Disk + * + * * `attach_data_disk` - (Optional) Create a new data disk and attach it to the stateful node. + * * `data_disk_name` - (Required) The name of the created data disk. + * * `data_disk_resource_group_name` - (Required) The resource group name in which the data disk will be created. + * * `storage_account_type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. + * * `size_gb` - (Required) The size of the data disk in GB, Required if dataDisks is specified. + * * `zone` - (Optional, Enum `"1", "2", "3"`) The Availability Zone in which the data disk will be created. If not defined, the data disk will be created regionally. + * * `lun` - (Optional, Default `"orginal"`) The LUN of the data disk. If not defined, the LUN will be set in order. + * + * <a id="detach_data_disk"></a> + * ## Detach Data Disk + * + * * `detach_data_disk` - (Optional) Detach a data disk from a stateful node. + * * `data_disk_name` - (Required) The name of the detached data disk. + * * `data_disk_resource_group_name` - (Required) The resource group name in which the data disk exists. + * * `should_deallocate` - (Required) Indicates whether to delete the data disk in addition to detach. + * * `ttl_in_hours` - (Required, Default `"0"`) Hours to keep the disk alive before deletion. + * + * <a id="update_state"></a> + * ## Update State + * + * * `update_state` - (Optional) Update the stateful node state. + * * `state` - (Required, Enum `"pause", "resume", "recycle"`) New state for the stateful node. + * + * <a id="import_vm"></a> + * ## Import VM + * + * * `import_vm` - (Optional) Import an Azure VM and create a stateful node by providing a node configuration. + * * `resource_group_name` - (Required) Name of the Resource Group for Stateful Node. + * * `original_vm_name` - (Required) Azure Import Stateful Node Name. + * * `draining_timeout` - (Optional) Hours to keep resources alive. + * * `resources_retention_time` - (Optional) Hours to keep resources alive. + * + * <a id="delete"></a> + * ## Deallocation Config + * + * * `delete` - (Required) Specify deallocation parameters for stateful node deletion. + * * `should_terminate_vm` - (Required) Indicates whether to delete the stateful node's VM. + * * `network_should_deallocate` - (Required) Indicates whether to delete the stateful node's network resources. + * * `network_ttl_in_hours` - (Optional, Default: 96) Hours to keep the network resource alive before deletion. + * * `disk_should_deallocate` - (Required) Indicates whether to delete the stateful node's disk resources. + * * `disk_ttl_in_hours` - (Optional, Default: 96) Hours to keep the disk resource alive before deletion. + * * `snapshot_should_deallocate` - (Required) Indicates whether to delete the stateful node's snapshot resources. + * * `snapshot_ttl_in_hours` - (Optional, Default: 96) Hours to keep the snapshots alive before deletion. + * * `public_ip_should_deallocate` - (Required) Indicates whether to delete the stateful node's public ip resources. + * * `public_ip_ttl_in_hours` - (Optional, Default: 96) Hours to keep the public ip alive before deletion. + * */ @ResourceType(type="spotinst:index/statefulNodeAzure:StatefulNodeAzure") public class StatefulNodeAzure extends com.pulumi.resources.CustomResource { diff --git a/sdk/nodejs/statefulNodeAzure.ts b/sdk/nodejs/statefulNodeAzure.ts index 9c8b972c..ff7faf64 100644 --- a/sdk/nodejs/statefulNodeAzure.ts +++ b/sdk/nodejs/statefulNodeAzure.ts @@ -8,6 +8,507 @@ import * as utilities from "./utilities"; /** * Provides a Spotinst stateful node Azure resource. + * + * ## Example Usage + * + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as spotinst from "@pulumi/spotinst"; + * + * const testStatefulNodeAzure = new spotinst.StatefulNodeAzure("testStatefulNodeAzure", { + * region: "eastus", + * resourceGroupName: "spotinst-azure", + * description: "example_stateful_node_azure_description", + * strategy: { + * drainingTimeout: 30, + * fallbackToOnDemand: true, + * optimizationWindows: ["Tue:19:46-Tue:20:46"], + * odWindows: ["Wed:19:46-Wed:21:46"], + * availabilityVsCost: 100, + * revertToSpot: { + * performAt: "timeWindow", + * }, + * preferredLifeCycle: "od", + * capacityReservations: [{ + * shouldUtilize: true, + * utilizationStrategy: "utilizeOverOD", + * capacityReservationGroups: [{ + * crgName: "crg name", + * crgResourceGroupName: "resourceGroupName", + * crgShouldPrioritize: true, + * }], + * }], + * }, + * os: "Linux", + * odSizes: [ + * "standard_ds1_v2", + * "standard_ds2_v2", + * ], + * spotSizes: [ + * "standard_ds1_v2", + * "standard_ds2_v2", + * ], + * preferredSpotSizes: ["standard_ds1_v2"], + * zones: [ + * "1", + * "3", + * ], + * preferredZone: "1", + * customData: "", + * shutdownScript: "", + * userData: "", + * vmName: "VMName", + * vmNamePrefix: "VMNamePrefix", + * licenseType: "SLES_BYOS", + * bootDiagnostics: [{ + * isEnabled: true, + * storageUrl: "https://.blob.core.windows.net/test", + * type: "unmanaged", + * }], + * dataDisks: [ + * { + * sizeGb: 1, + * lun: 1, + * type: "Standard_LRS", + * }, + * { + * sizeGb: 10, + * lun: 2, + * type: "Standard_LRS", + * }, + * ], + * extensions: [{ + * name: "extensionName", + * type: "customScript", + * publisher: "Microsoft.Azure.Extensions", + * apiVersion: "2.0", + * minorVersionAutoUpgrade: true, + * protectedSettings: { + * script: "IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg==", + * }, + * publicSettings: { + * fileUris: ["https://testspot/Azuretest.sh"], + * }, + * }], + * image: { + * marketplaceImages: [{ + * publisher: "Canonical", + * offer: "UbuntuServer", + * sku: "16.04-LTS", + * version: "latest", + * }], + * customImages: [{ + * customImageResourceGroupName: "resourceGroupName", + * name: "imageName", + * }], + * galleries: [{ + * galleryResourceGroupName: "resourceGroupName", + * galleryName: "galleryName", + * imageName: "imageName", + * versionName: "1.1.0", + * }], + * }, + * loadBalancers: [{ + * type: "loadBalancer", + * resourceGroupName: "testResourceGroup", + * name: "testLoadBalancer", + * sku: "Standard", + * backendPoolNames: [ + * "testBackendPool1", + * "testBackendPool2", + * ], + * }], + * login: { + * userName: "admin", + * sshPublicKey: "33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==", + * }, + * managedServiceIdentities: [{ + * name: "mySI2", + * resourceGroupName: "myResourceGroup", + * }], + * network: { + * networkResourceGroupName: "subnetResourceGroup", + * virtualNetworkName: "vname", + * networkInterfaces: [{ + * isPrimary: true, + * subnetName: "testSubnet", + * assignPublicIp: true, + * publicIpSku: "Standard", + * networkSecurityGroups: [{ + * networkResourceGroupName: "test", + * name: "test", + * }], + * enableIpForwarding: true, + * privateIpAddresses: ["172.23.4.20"], + * additionalIpConfigurations: [{ + * name: "test", + * privateIpAddressVersion: "IPv4", + * }], + * publicIps: [{ + * networkResourceGroupName: "resourceGroup", + * name: "test", + * }], + * applicationSecurityGroups: [{ + * networkResourceGroupName: "AsgResourceGroup", + * name: "AsgName", + * }], + * }], + * }, + * osDisk: { + * sizeGb: 30, + * type: "Standard_LRS", + * caching: "ReadOnly", + * }, + * secrets: [{ + * sourceVaults: [{ + * name: "string", + * resourceGroupName: "string", + * }], + * vaultCertificates: [{ + * certificateUrl: "string", + * certificateStore: "string", + * }], + * }], + * security: { + * securityType: "Standard", + * secureBootEnabled: false, + * vtpmEnabled: false, + * }, + * tags: [{ + * tagKey: "Creator", + * tagValue: "string", + * }], + * health: { + * healthCheckTypes: ["vmState"], + * unhealthyDuration: 300, + * gracePeriod: 120, + * autoHealing: true, + * }, + * shouldPersistOsDisk: false, + * osDiskPersistenceMode: "reattach", + * shouldPersistDataDisks: true, + * dataDisksPersistenceMode: "reattach", + * shouldPersistNetwork: true, + * schedulingTasks: [ + * { + * isEnabled: true, + * type: "pause", + * cronExpression: "44 10 * * *", + * }, + * { + * isEnabled: true, + * type: "resume", + * cronExpression: "48 10 * * *", + * }, + * { + * isEnabled: true, + * type: "recycle", + * cronExpression: "52 10 * * *", + * }, + * ], + * signals: [ + * { + * type: "vmReady", + * timeout: 20, + * }, + * { + * type: "vmReady", + * timeout: 40, + * }, + * ], + * proximityPlacementGroups: [{ + * name: "TestPPG", + * resourceGroupName: "TestResourceGroup", + * }], + * deletes: [{ + * shouldTerminateVm: true, + * networkShouldDeallocate: true, + * networkTtlInHours: 0, + * diskShouldDeallocate: true, + * diskTtlInHours: 0, + * snapshotShouldDeallocate: true, + * snapshotTtlInHours: 0, + * publicIpShouldDeallocate: true, + * publicIpTtlInHours: 0, + * }], + * }); + * // ------------------------------------------------------------------- + * ``` + * + * + * # Argument Reference + * + * The following arguments are supported: + * + * * `name` - (Required) Azure stateful node name. + * * `region` - (Required) The Azure region your stateful node will be created in. + * * `resourceGroupName` - (Required) Name of the Resource Group for stateful node. + * * `description` - (Optional) Describe your Azure stateful node. + * + * + * ## Strategy + * + * * `strategy` - (Required) Strategy for stateful node. + * * `drainingTimeout` - (Optional, Default `120`) Time (in seconds) to allow the VM be drained from incoming TCP connections and detached from MLB before terminating it during a scale down operation. + * * `availabilityVsCost` - (Optional) Set the desired preference for the Spot market VM selection. (100- Availability, 0- cost). + * * `fallbackToOnDemand` - (Required) In case of no spots available, Stateful Node will launch an On-demand instance instead. + * * `optimizationWindows` - (Optional) Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))", not empty if revertToSpot.performAt = timeWindow. + * * `odWindows` - (Optional) Define the time windows in which the underlying VM will be set as an on-demand lifecycle type. During the entire time window, the rest of the strategy processes will be paused. + * Switching between on-demand and Spot VM types at the enter/exit of the time window will trigger the recycling of the stateful node. Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))". + * * `preferredLifeCycle` - (Optional, Enum `"od", "spot"`, Default `"spot"`) The desired type of VM. + * * `revertToSpot` - (Optional) Hold settings for strategy correction - replacing On-Demand for Spot VMs. + * * `performAt` - (Required, Enum `"timeWindow", "never", "always"`, Default `"always"`) Settings for maintenance strategy. + * * `capacityReservation` - (Optional) On-demand Capacity Reservation group enables you to reserve Compute capacity in an Azure region or an Availability Zone for any duration of time. [CRG can only be created on the Azure end.](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-create) + * * `shouldUtilize` - (Required) Determines whether capacity reservations should be utilized. + * * `utilizationStrategy` - (Required, Enum `"utilizeOverSpot", "utilizeOverOD"`) The priority requested for using CRG. This value will determine if CRG is used ahead of spot VMs or On-demand VMs. (`"utilizeOverOD"`- If picked, we will use CRG only in case On demand should be launched. `"utilizeOverSpot"`- CRG will be preferred over Spot. Only after CRG is fully used, spot VMs can be used.) + * * `capacityReservationGroups` - (Optional) List of the desired CRGs to use under the associated Azure subscription. When null we will utilize any available reservation that matches the launch specification. + * * `crgName` - (Required) The name of the CRG. + * * `crgResourceGroupName` - (Required) Azure resource group name + * * `crgShouldPrioritize` - The desired CRG to utilize ahead of other CRGs in the subscription. + * + * + * ## Compute + * + * * `os` - (Required, Enum `"Linux", "Windows"`) Type of operating system. + * * `odSizes` - (Required) Available On-Demand sizes. + * * `spotSizes` - (Required) Available Spot-VM sizes. + * * `preferredSpotSizes` - (Optional) Prioritize Spot VM sizes when launching Spot VMs for the group. If set, must be a sublist of compute.vmSizes.spotSizes. + * * `zones` - (Optional, Enum `"1", "2", "3"`) List of Azure Availability Zones in the defined region. If not defined, Virtual machines will be launched regionally. + * * `preferredZone` - (Optional, Enum `"1", "2", "3"`) The AZ to prioritize when launching VMs. If no markets are available in the Preferred AZ, VMs are launched in the non-preferred AZ. Must be a sublist of compute.zones. + * * `customData` - (Optional) This value will hold the YAML in base64 and will be executed upon VM launch. + * * `shutdownScript` - (Optional) Shutdown script for the stateful node. Value should be passed as a string encoded at Base64 only. + * * `userData` - (Optional) Define a set of scripts or other metadata that's inserted to an Azure virtual machine at provision time. (Base64 encoded) + * * `vmName` - (Optional) Set a VM name that will be persisted throughout the entire node lifecycle. This can't be set if `vmNamePrefix` is set. + * * `vmNamePrefix` - (Optional) Set a VM name prefix to be used for all launched VMs and the VM resources. This can't be set if `vmName` is set. + * * `licenseType` - (Optional) Specify an existing Azure license type to use when launching new VMs. Valid values for Windows OS: "Windows_Server", "Windows_Client", Valid values for Linux OS: "RHEL_BYOS", "SLES_BYOS" + * + * + * ## Boot Diagnostics + * + * * `bootDiagnostics` + * * `isEnabled` - (Optional) Allows you to enable and disable the configuration of boot diagnostics at launch. + * * `storageUrl` - (Optional) The storage URI that is used if a type is unmanaged. The storage URI must follow the blob storage URI format ("https://.blob.core.windows.net/"). StorageUri is required if the type is unmanaged. StorageUri must be ‘null’ in case the boot diagnostics type is managed. + * * `type` - (Optional, Enum `"managed", "unmanaged"`) Defines the storage type on VM launch in Azure. + * + * + * ## Data Disks + * + * * `dataDisk` - (Optional) The definitions of data disks that will be created and attached to the stateful node's VM. + * * `sizeGb` - (Required) The size of the data disk in GB, required if dataDisks is specified. + * * `lun` - (Required) The LUN of the data disk. + * * `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. + * + * + * ## Extensions + * + * * `extension` - (Optional) An object for an azure extension. + * * `name` - (Required) Required on compute.launchSpecification.extensions object. + * * `type` - (Required) Required on compute.launchSpecification.extensions object. + * * `publisher` - (Required) Required on compute.launchSpecification.extensions object. + * * `apiVersion` - (Required) The API version of the extension. Required if extension specified. + * * `minorVersionAutoUpgrade` - (Required) Required on compute.launchSpecification.extensions object. + * * `protectedSettings` - (Optional) Object for protected settings. + * * `publicSettings` - (Optional) Object for public settings. + * + * + * ## Image + * + * * `image` + * * `marketplaceImage` - (Optional) Select an image from Azure's Marketplace image catalogue. Required if the custom image or gallery image are not specified. + * * `publisher` - (Required) Image publisher. + * * `offer` - (Required) Image offer. + * * `sku` - (Required) Image Stock Keeping Unit, which is the specific version of the image. + * * `version` - (Required, Default `"latest"`) Image's version. if version not provided we use "latest". + * * `gallery` - (Optional) Gallery image definitions. Required if custom image or marketplace image are not specified. + * * `galleryResourceGroupName` - (Required) The resource group name for gallery image. + * * `galleryName` - (Required) Name of the gallery. + * * `imageName` - (Required) Name of the gallery image. + * * `versionName` - (Required) Image's version. Can be in the format x.x.x or 'latest'. + * * `customImage` - (Optional) Custom image definitions. Required if marketplace image or gallery image are not specified. + * * `customImageResourceGroupName` - (Required) The resource group name for custom image. + * * `name` - (Required) The name of the custom image. + * + * + * ## Load Balancer + * + * * `loadBalancer` - (Optional) Add a load balancer. For Azure Gateway, each Backend Pool is a separate load balancer. + * * `type` - (Required, Enum `"loadBalancer", "applicationGateway"`) The type of load balancer. + * * `resourceGroupName` - (Required) The Resource Group name of the Load Balancer. + * * `name` - (Required) Name of the Application Gateway/Load Balancer. + * * `sku` - (Optional) + * * if type is `"LoadBalancer"` then possible values are `“Standard", "Basic”`. + * * If ApplicationGateway then possible values are + * `“Standard_Large”, “Standard_Medium”, “Standard_Small”, “Standard_v2", “WAF_Large”, “WAF_Medium", “WAF_v2"`. + * * `backendPoolNames` - (Optional) Name of the Backend Pool to register the Stateful Node VMs to. Each Backend Pool is a separate load balancer. Required if Type is APPLICATION_GATEWAY. + * + * + * ## Login + * + * * `login` - (Required) Set admin access for accessing your VMs. Password/SSH is required for Linux. + * * `userName` - (Required) username for admin access to VMs. + * * `sshPublicKey` - (Optional) SSH for admin access to Linux VMs. Optional for Linux. + * * `password` - (Optional) Password for admin access to Windows VMs. Required for Windows. + * + * + * ## Managed Service Identities + * + * * `managedServiceIdentities` - (Optional) Add a user-assigned managed identity to the Stateful Node's VM. + * * `name` - (Required) name of the managed identity. + * * `resourceGroupName` - (Required) The Resource Group that the user-assigned managed identity resides in. + * + * + * ## Proximity Placement Groups + * + * * `proximityPlacementGroups` - (Optional) Defines the proximity placement group in which the VM will be launched. + * * `name` - (Required) name of the proximity placement group. + * * `resourceGroupName` - (Required) The Resource Group name of the proximity placement group. + * + * + * ## Network + * + * * `network` - (Required) Define the Virtual Network and Subnet for your Stateful Node. + * * `networkResourceGroupName` - (Required) Vnet Resource Group Name. + * * `virtualNetworkName` - (Required) Virtual Network. + * * `networkInterface` - (Required) Define a network interface + * * `isPrimary` - (Required) Defines whether the network interface is primary or not. + * * `subnetName` - (Required) Subnet name. + * * `assignPublicIp` - (Optional) Assign public IP. + * * `publicIpSku` - (Optional) Required if assignPublicIp=true values=[Standard/Basic]. + * * `networkSecurityGroup` - (Optional) Network Security Group. + * * `networkResourceGroupName` - (Required) Requires valid security group name. + * * `name` - (Required) Requires valid resource group name. + * * `enableIpForwarding` - (Optional) Enable IP Forwarding. + * * `privateIpAddresses` - (Optional) A list with unique items that every item is a valid IP. + * * `additionalIpConfigurations` - (Optional) Additional configuration of network interface. + * * `name` - (Required) Configuration name. + * * `privateIpAddressVersion` - (Required, Enum `"IPv4", "IPv6"` Default `"IPv4"`) Version of the private IP address. + * * `publicIps` - (Optional) Defined a pool of Public Ips (from Azure), that will be associated to the network interface. We will associate one public ip per instance until the pool is exhausted, in which case, we will create a new one. + * * `resourceGroupName` - (Required) The resource group of the public ip. + * * `name` - (Required) - The name of the public ip. + * * `applicationSecurityGroups` - (Optional) Network Security Group. + * * `resourceGroupName` - (Required) Requires valid security group name. + * * `name` - (Required) Requires valid resource group name. + * + * + * ## OS Disk + * + * * `osDisk` - (Optional) Specify OS disk specification other than default. + * * `sizeGb` - (Optional, Default `"30"`) The size of the data disk in GB. + * * `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS"`) The type of the OS disk. + * * `caching` - (Optional, Enum `"None", "ReadOnly", "ReadWrite"`) Specifies the host caching requirements. With disk caching enabled, VMs can achieve higher levels of performance. If not specified, the Azure default behavior will be applied. + * + * + * ## Secret + * + * * `secret` - (Optional) Set of certificates that should be installed on the VM. + * * `sourceVault` - (Required) The key vault reference, contains the required certificates. + * * `name` - (Required) The name of the key vault. + * * `resourceGroupName` - (Required) The resource group name of the key vault. + * * `vaultCertificates` - (Required) The required certificate references. + * * `certificateUrl` - (Optional) The URL of the certificate under the key vault. + * * `certificateStore` - (Required) The certificate store directory the VM. The directory is created in the LocalMachine account. + * * This field is required only when using Windows OS type + * * This field must be ‘null’ when the OS type is Linux + * + * + * ## Security + * + * * `security` - (Optional) Specifies the Security related profile settings for the virtual machine. + * * `secureBootEnabled` - (Optional) Specifies whether secure boot should be enabled on the virtual machine. + * * `securityType` - (Optional) Enum: `"Standard", "TrustedLaunch"` Security type refers to the different security features of a virtual machine. Security features like Trusted launch virtual machines help to improve the security of Azure generation 2 virtual machines. + * * `vtpmEnabled` - (Optional) Specifies whether vTPM should be enabled on the virtual machine. + * + * + * ## Tag + * + * * `tag` - (Optional) Unique Key-Value pair for all Stateful Node Resources. + * * `tagKey` - (Optional) Tag Key for Stateful Node Resources. + * * `tagValue` - (Optional) Tag Value for Stateful Node Resources. + * + * + * ## Health + * + * * `health` - (Optional) Set the auto healing preferences for unhealthy VMs. + * * `healthCheckTypes` - (Optional, Enum `"vmState", "applicationGateway"`) Healthcheck to use to validate VM health. + * * `unhealthyDuration` - (Optional) Amount of time to be unhealthy before a replacement is triggered. + * * `autoHealing` - (Required) Enable Autohealing of unhealthy VMs. + * * `gracePeriod` - (Optional) Period of time to wait for VM to reach healthiness before monitoring for unhealthiness. + * + * + * ## Persistence + * + * * `shouldPersistOsDisk` - (Required) Should persist os disk. + * * `osDiskPersistenceMode` - (Optional, Enum `"reattach", "onLaunch"`) + * * `shouldPersistDataDisks` - (Required) Should persist data disks. + * * `dataDisksPersistenceMode` - (Optional, Enum `"reattach", "onLaunch"`) + * * `shouldPersistNetwork` - (Required) Should persist network. + * + * + * ## Scheduling Tasks + * + * * `schedulingTask` - (Optional) Scheduling settings object for stateful node. + * * `isEnabled` - (Required) Is scheduled task enabled for stateful node. + * * `type` - (Required, Enum `"pause", "resume", "recycle") The type of the scheduled task + * * `cronExpression` (Required) A expression which describes when to execute the scheduled task (UTC). + * + * + * ## Signals + * + * * `signal` - (Optional) A signal object defined for the stateful node. + * * `type` - (Required, Enum `"vmReady", "vmReadyToShutdown"`) The type of the signal defined for the stateful node. + * * `timeout` - (Required, Default `"1800"`) The timeout in seconds to hold the vm until a signal is sent. If no signal is sent the vm will be replaced (vmReady) or we will terminate the vm (vmReadyToShutdown) after the timeout. + * + * *** + * + * + * ## Attach Data Disk + * + * * `attachDataDisk` - (Optional) Create a new data disk and attach it to the stateful node. + * * `dataDiskName` - (Required) The name of the created data disk. + * * `dataDiskResourceGroupName` - (Required) The resource group name in which the data disk will be created. + * * `storageAccountType` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. + * * `sizeGb` - (Required) The size of the data disk in GB, Required if dataDisks is specified. + * * `zone` - (Optional, Enum `"1", "2", "3"`) The Availability Zone in which the data disk will be created. If not defined, the data disk will be created regionally. + * * `lun` - (Optional, Default `"orginal"`) The LUN of the data disk. If not defined, the LUN will be set in order. + * + * + * ## Detach Data Disk + * + * * `detachDataDisk` - (Optional) Detach a data disk from a stateful node. + * * `dataDiskName` - (Required) The name of the detached data disk. + * * `dataDiskResourceGroupName` - (Required) The resource group name in which the data disk exists. + * * `shouldDeallocate` - (Required) Indicates whether to delete the data disk in addition to detach. + * * `ttlInHours` - (Required, Default `"0"`) Hours to keep the disk alive before deletion. + * + * + * ## Update State + * + * * `updateState` - (Optional) Update the stateful node state. + * * `state` - (Required, Enum `"pause", "resume", "recycle"`) New state for the stateful node. + * + * + * ## Import VM + * + * * `importVm` - (Optional) Import an Azure VM and create a stateful node by providing a node configuration. + * * `resourceGroupName` - (Required) Name of the Resource Group for Stateful Node. + * * `originalVmName` - (Required) Azure Import Stateful Node Name. + * * `drainingTimeout` - (Optional) Hours to keep resources alive. + * * `resourcesRetentionTime` - (Optional) Hours to keep resources alive. + * + * + * ## Deallocation Config + * + * * `delete` - (Required) Specify deallocation parameters for stateful node deletion. + * * `shouldTerminateVm` - (Required) Indicates whether to delete the stateful node's VM. + * * `networkShouldDeallocate` - (Required) Indicates whether to delete the stateful node's network resources. + * * `networkTtlInHours` - (Optional, Default: 96) Hours to keep the network resource alive before deletion. + * * `diskShouldDeallocate` - (Required) Indicates whether to delete the stateful node's disk resources. + * * `diskTtlInHours` - (Optional, Default: 96) Hours to keep the disk resource alive before deletion. + * * `snapshotShouldDeallocate` - (Required) Indicates whether to delete the stateful node's snapshot resources. + * * `snapshotTtlInHours` - (Optional, Default: 96) Hours to keep the snapshots alive before deletion. + * * `publicIpShouldDeallocate` - (Required) Indicates whether to delete the stateful node's public ip resources. + * * `publicIpTtlInHours` - (Optional, Default: 96) Hours to keep the public ip alive before deletion. */ export class StatefulNodeAzure extends pulumi.CustomResource { /** diff --git a/sdk/python/pulumi_spotinst/stateful_node_azure.py b/sdk/python/pulumi_spotinst/stateful_node_azure.py index fcc915c5..e89f8a20 100644 --- a/sdk/python/pulumi_spotinst/stateful_node_azure.py +++ b/sdk/python/pulumi_spotinst/stateful_node_azure.py @@ -1129,6 +1129,506 @@ def __init__(__self__, """ Provides a Spotinst stateful node Azure resource. + ## Example Usage + + + ```python + import pulumi + import pulumi_spotinst as spotinst + + test_stateful_node_azure = spotinst.StatefulNodeAzure("testStatefulNodeAzure", + region="eastus", + resource_group_name="spotinst-azure", + description="example_stateful_node_azure_description", + strategy=spotinst.StatefulNodeAzureStrategyArgs( + draining_timeout=30, + fallback_to_on_demand=True, + optimization_windows=["Tue:19:46-Tue:20:46"], + od_windows=["Wed:19:46-Wed:21:46"], + availability_vs_cost=100, + revert_to_spot=spotinst.StatefulNodeAzureStrategyRevertToSpotArgs( + perform_at="timeWindow", + ), + preferred_life_cycle="od", + capacity_reservations=[spotinst.StatefulNodeAzureStrategyCapacityReservationArgs( + should_utilize=True, + utilization_strategy="utilizeOverOD", + capacity_reservation_groups=[spotinst.StatefulNodeAzureStrategyCapacityReservationCapacityReservationGroupArgs( + crg_name="crg name", + crg_resource_group_name="resourceGroupName", + crg_should_prioritize=True, + )], + )], + ), + os="Linux", + od_sizes=[ + "standard_ds1_v2", + "standard_ds2_v2", + ], + spot_sizes=[ + "standard_ds1_v2", + "standard_ds2_v2", + ], + preferred_spot_sizes=["standard_ds1_v2"], + zones=[ + "1", + "3", + ], + preferred_zone="1", + custom_data="", + shutdown_script="", + user_data="", + vm_name="VMName", + vm_name_prefix="VMNamePrefix", + license_type="SLES_BYOS", + boot_diagnostics=[spotinst.StatefulNodeAzureBootDiagnosticArgs( + is_enabled=True, + storage_url="https://.blob.core.windows.net/test", + type="unmanaged", + )], + data_disks=[ + spotinst.StatefulNodeAzureDataDiskArgs( + size_gb=1, + lun=1, + type="Standard_LRS", + ), + spotinst.StatefulNodeAzureDataDiskArgs( + size_gb=10, + lun=2, + type="Standard_LRS", + ), + ], + extensions=[spotinst.StatefulNodeAzureExtensionArgs( + name="extensionName", + type="customScript", + publisher="Microsoft.Azure.Extensions", + api_version="2.0", + minor_version_auto_upgrade=True, + protected_settings={ + "script": "IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg==", + }, + public_settings={ + "fileUris": ["https://testspot/Azuretest.sh"], + }, + )], + image=spotinst.StatefulNodeAzureImageArgs( + marketplace_images=[spotinst.StatefulNodeAzureImageMarketplaceImageArgs( + publisher="Canonical", + offer="UbuntuServer", + sku="16.04-LTS", + version="latest", + )], + custom_images=[spotinst.StatefulNodeAzureImageCustomImageArgs( + custom_image_resource_group_name="resourceGroupName", + name="imageName", + )], + galleries=[spotinst.StatefulNodeAzureImageGalleryArgs( + gallery_resource_group_name="resourceGroupName", + gallery_name="galleryName", + image_name="imageName", + version_name="1.1.0", + )], + ), + load_balancers=[spotinst.StatefulNodeAzureLoadBalancerArgs( + type="loadBalancer", + resource_group_name="testResourceGroup", + name="testLoadBalancer", + sku="Standard", + backend_pool_names=[ + "testBackendPool1", + "testBackendPool2", + ], + )], + login=spotinst.StatefulNodeAzureLoginArgs( + user_name="admin", + ssh_public_key="33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==", + ), + managed_service_identities=[spotinst.StatefulNodeAzureManagedServiceIdentityArgs( + name="mySI2", + resource_group_name="myResourceGroup", + )], + network=spotinst.StatefulNodeAzureNetworkArgs( + network_resource_group_name="subnetResourceGroup", + virtual_network_name="vname", + network_interfaces=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceArgs( + is_primary=True, + subnet_name="testSubnet", + assign_public_ip=True, + public_ip_sku="Standard", + network_security_groups=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceNetworkSecurityGroupArgs( + network_resource_group_name="test", + name="test", + )], + enable_ip_forwarding=True, + private_ip_addresses=["172.23.4.20"], + additional_ip_configurations=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceAdditionalIpConfigurationArgs( + name="test", + private_ip_address_version="IPv4", + )], + public_ips=[spotinst.StatefulNodeAzureNetworkNetworkInterfacePublicIpArgs( + network_resource_group_name="resourceGroup", + name="test", + )], + application_security_groups=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceApplicationSecurityGroupArgs( + network_resource_group_name="AsgResourceGroup", + name="AsgName", + )], + )], + ), + os_disk=spotinst.StatefulNodeAzureOsDiskArgs( + size_gb=30, + type="Standard_LRS", + caching="ReadOnly", + ), + secrets=[spotinst.StatefulNodeAzureSecretArgs( + source_vaults=[spotinst.StatefulNodeAzureSecretSourceVaultArgs( + name="string", + resource_group_name="string", + )], + vault_certificates=[spotinst.StatefulNodeAzureSecretVaultCertificateArgs( + certificate_url="string", + certificate_store="string", + )], + )], + security=spotinst.StatefulNodeAzureSecurityArgs( + security_type="Standard", + secure_boot_enabled=False, + vtpm_enabled=False, + ), + tags=[spotinst.StatefulNodeAzureTagArgs( + tag_key="Creator", + tag_value="string", + )], + health=spotinst.StatefulNodeAzureHealthArgs( + health_check_types=["vmState"], + unhealthy_duration=300, + grace_period=120, + auto_healing=True, + ), + should_persist_os_disk=False, + os_disk_persistence_mode="reattach", + should_persist_data_disks=True, + data_disks_persistence_mode="reattach", + should_persist_network=True, + scheduling_tasks=[ + spotinst.StatefulNodeAzureSchedulingTaskArgs( + is_enabled=True, + type="pause", + cron_expression="44 10 * * *", + ), + spotinst.StatefulNodeAzureSchedulingTaskArgs( + is_enabled=True, + type="resume", + cron_expression="48 10 * * *", + ), + spotinst.StatefulNodeAzureSchedulingTaskArgs( + is_enabled=True, + type="recycle", + cron_expression="52 10 * * *", + ), + ], + signals=[ + spotinst.StatefulNodeAzureSignalArgs( + type="vmReady", + timeout=20, + ), + spotinst.StatefulNodeAzureSignalArgs( + type="vmReady", + timeout=40, + ), + ], + proximity_placement_groups=[spotinst.StatefulNodeAzureProximityPlacementGroupArgs( + name="TestPPG", + resource_group_name="TestResourceGroup", + )], + deletes=[spotinst.StatefulNodeAzureDeleteArgs( + should_terminate_vm=True, + network_should_deallocate=True, + network_ttl_in_hours=0, + disk_should_deallocate=True, + disk_ttl_in_hours=0, + snapshot_should_deallocate=True, + snapshot_ttl_in_hours=0, + public_ip_should_deallocate=True, + public_ip_ttl_in_hours=0, + )]) + # ------------------------------------------------------------------- + ``` + + + # Argument Reference + + The following arguments are supported: + + * `name` - (Required) Azure stateful node name. + * `region` - (Required) The Azure region your stateful node will be created in. + * `resource_group_name` - (Required) Name of the Resource Group for stateful node. + * `description` - (Optional) Describe your Azure stateful node. + + + ## Strategy + + * `strategy` - (Required) Strategy for stateful node. + * `draining_timeout` - (Optional, Default `120`) Time (in seconds) to allow the VM be drained from incoming TCP connections and detached from MLB before terminating it during a scale down operation. + * `availability_vs_cost` - (Optional) Set the desired preference for the Spot market VM selection. (100- Availability, 0- cost). + * `fallback_to_on_demand` - (Required) In case of no spots available, Stateful Node will launch an On-demand instance instead. + * `optimization_windows` - (Optional) Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))", not empty if revertToSpot.performAt = timeWindow. + * `od_windows` - (Optional) Define the time windows in which the underlying VM will be set as an on-demand lifecycle type. During the entire time window, the rest of the strategy processes will be paused. + Switching between on-demand and Spot VM types at the enter/exit of the time window will trigger the recycling of the stateful node. Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))". + * `preferred_life_cycle` - (Optional, Enum `"od", "spot"`, Default `"spot"`) The desired type of VM. + * `revert_to_spot` - (Optional) Hold settings for strategy correction - replacing On-Demand for Spot VMs. + * `perform_at` - (Required, Enum `"timeWindow", "never", "always"`, Default `"always"`) Settings for maintenance strategy. + * `capacity_reservation` - (Optional) On-demand Capacity Reservation group enables you to reserve Compute capacity in an Azure region or an Availability Zone for any duration of time. [CRG can only be created on the Azure end.](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-create) + * `should_utilize` - (Required) Determines whether capacity reservations should be utilized. + * `utilization_strategy` - (Required, Enum `"utilizeOverSpot", "utilizeOverOD"`) The priority requested for using CRG. This value will determine if CRG is used ahead of spot VMs or On-demand VMs. (`"utilizeOverOD"`- If picked, we will use CRG only in case On demand should be launched. `"utilizeOverSpot"`- CRG will be preferred over Spot. Only after CRG is fully used, spot VMs can be used.) + * `capacity_reservation_groups` - (Optional) List of the desired CRGs to use under the associated Azure subscription. When null we will utilize any available reservation that matches the launch specification. + * `crg_name` - (Required) The name of the CRG. + * `crg_resource_group_name` - (Required) Azure resource group name + * `crg_should_prioritize` - The desired CRG to utilize ahead of other CRGs in the subscription. + + + ## Compute + + * `os` - (Required, Enum `"Linux", "Windows"`) Type of operating system. + * `od_sizes` - (Required) Available On-Demand sizes. + * `spot_sizes` - (Required) Available Spot-VM sizes. + * `preferred_spot_sizes` - (Optional) Prioritize Spot VM sizes when launching Spot VMs for the group. If set, must be a sublist of compute.vmSizes.spotSizes. + * `zones` - (Optional, Enum `"1", "2", "3"`) List of Azure Availability Zones in the defined region. If not defined, Virtual machines will be launched regionally. + * `preferred_zone` - (Optional, Enum `"1", "2", "3"`) The AZ to prioritize when launching VMs. If no markets are available in the Preferred AZ, VMs are launched in the non-preferred AZ. Must be a sublist of compute.zones. + * `custom_data` - (Optional) This value will hold the YAML in base64 and will be executed upon VM launch. + * `shutdown_script` - (Optional) Shutdown script for the stateful node. Value should be passed as a string encoded at Base64 only. + * `user_data` - (Optional) Define a set of scripts or other metadata that's inserted to an Azure virtual machine at provision time. (Base64 encoded) + * `vm_name` - (Optional) Set a VM name that will be persisted throughout the entire node lifecycle. This can't be set if `vm_name_prefix` is set. + * `vm_name_prefix` - (Optional) Set a VM name prefix to be used for all launched VMs and the VM resources. This can't be set if `vm_name` is set. + * `license_type` - (Optional) Specify an existing Azure license type to use when launching new VMs. Valid values for Windows OS: "Windows_Server", "Windows_Client", Valid values for Linux OS: "RHEL_BYOS", "SLES_BYOS" + + + ## Boot Diagnostics + + * `boot_diagnostics` + * `is_enabled` - (Optional) Allows you to enable and disable the configuration of boot diagnostics at launch. + * `storage_url` - (Optional) The storage URI that is used if a type is unmanaged. The storage URI must follow the blob storage URI format ("https://.blob.core.windows.net/"). StorageUri is required if the type is unmanaged. StorageUri must be ‘null’ in case the boot diagnostics type is managed. + * `type` - (Optional, Enum `"managed", "unmanaged"`) Defines the storage type on VM launch in Azure. + + + ## Data Disks + + * `data_disk` - (Optional) The definitions of data disks that will be created and attached to the stateful node's VM. + * `size_gb` - (Required) The size of the data disk in GB, required if dataDisks is specified. + * `lun` - (Required) The LUN of the data disk. + * `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. + + + ## Extensions + + * `extension` - (Optional) An object for an azure extension. + * `name` - (Required) Required on compute.launchSpecification.extensions object. + * `type` - (Required) Required on compute.launchSpecification.extensions object. + * `publisher` - (Required) Required on compute.launchSpecification.extensions object. + * `api_version` - (Required) The API version of the extension. Required if extension specified. + * `minor_version_auto_upgrade` - (Required) Required on compute.launchSpecification.extensions object. + * `protected_settings` - (Optional) Object for protected settings. + * `public_settings` - (Optional) Object for public settings. + + + ## Image + + * `image` + * `marketplace_image` - (Optional) Select an image from Azure's Marketplace image catalogue. Required if the custom image or gallery image are not specified. + * `publisher` - (Required) Image publisher. + * `offer` - (Required) Image offer. + * `sku` - (Required) Image Stock Keeping Unit, which is the specific version of the image. + * `version` - (Required, Default `"latest"`) Image's version. if version not provided we use "latest". + * `gallery` - (Optional) Gallery image definitions. Required if custom image or marketplace image are not specified. + * `gallery_resource_group_name` - (Required) The resource group name for gallery image. + * `gallery_name` - (Required) Name of the gallery. + * `image_name` - (Required) Name of the gallery image. + * `version_name` - (Required) Image's version. Can be in the format x.x.x or 'latest'. + * `custom_image` - (Optional) Custom image definitions. Required if marketplace image or gallery image are not specified. + * `custom_image_resource_group_name` - (Required) The resource group name for custom image. + * `name` - (Required) The name of the custom image. + + + ## Load Balancer + + * `load_balancer` - (Optional) Add a load balancer. For Azure Gateway, each Backend Pool is a separate load balancer. + * `type` - (Required, Enum `"loadBalancer", "applicationGateway"`) The type of load balancer. + * `resource_group_name` - (Required) The Resource Group name of the Load Balancer. + * `name` - (Required) Name of the Application Gateway/Load Balancer. + * `sku` - (Optional) + * if type is `"LoadBalancer"` then possible values are `“Standard", "Basic”`. + * If ApplicationGateway then possible values are + `“Standard_Large”, “Standard_Medium”, “Standard_Small”, “Standard_v2", “WAF_Large”, “WAF_Medium", “WAF_v2"`. + * `backend_pool_names` - (Optional) Name of the Backend Pool to register the Stateful Node VMs to. Each Backend Pool is a separate load balancer. Required if Type is APPLICATION_GATEWAY. + + + ## Login + + * `login` - (Required) Set admin access for accessing your VMs. Password/SSH is required for Linux. + * `user_name` - (Required) username for admin access to VMs. + * `ssh_public_key` - (Optional) SSH for admin access to Linux VMs. Optional for Linux. + * `password` - (Optional) Password for admin access to Windows VMs. Required for Windows. + + + ## Managed Service Identities + + * `managed_service_identities` - (Optional) Add a user-assigned managed identity to the Stateful Node's VM. + * `name` - (Required) name of the managed identity. + * `resource_group_name` - (Required) The Resource Group that the user-assigned managed identity resides in. + + + ## Proximity Placement Groups + + * `proximity_placement_groups` - (Optional) Defines the proximity placement group in which the VM will be launched. + * `name` - (Required) name of the proximity placement group. + * `resource_group_name` - (Required) The Resource Group name of the proximity placement group. + + + ## Network + + * `network` - (Required) Define the Virtual Network and Subnet for your Stateful Node. + * `network_resource_group_name` - (Required) Vnet Resource Group Name. + * `virtual_network_name` - (Required) Virtual Network. + * `network_interface` - (Required) Define a network interface + * `is_primary` - (Required) Defines whether the network interface is primary or not. + * `subnet_name` - (Required) Subnet name. + * `assign_public_ip` - (Optional) Assign public IP. + * `public_ip_sku` - (Optional) Required if assignPublicIp=true values=[Standard/Basic]. + * `network_security_group` - (Optional) Network Security Group. + * `network_resource_group_name` - (Required) Requires valid security group name. + * `name` - (Required) Requires valid resource group name. + * `enable_ip_forwarding` - (Optional) Enable IP Forwarding. + * `private_ip_addresses` - (Optional) A list with unique items that every item is a valid IP. + * `additional_ip_configurations` - (Optional) Additional configuration of network interface. + * `name` - (Required) Configuration name. + * `private_ip_address_version` - (Required, Enum `"IPv4", "IPv6"` Default `"IPv4"`) Version of the private IP address. + * `public_ips` - (Optional) Defined a pool of Public Ips (from Azure), that will be associated to the network interface. We will associate one public ip per instance until the pool is exhausted, in which case, we will create a new one. + * `resource_group_name` - (Required) The resource group of the public ip. + * `name` - (Required) - The name of the public ip. + * `application_security_groups` - (Optional) Network Security Group. + * `resource_group_name` - (Required) Requires valid security group name. + * `name` - (Required) Requires valid resource group name. + + + ## OS Disk + + * `os_disk` - (Optional) Specify OS disk specification other than default. + * `size_gb` - (Optional, Default `"30"`) The size of the data disk in GB. + * `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS"`) The type of the OS disk. + * `caching` - (Optional, Enum `"None", "ReadOnly", "ReadWrite"`) Specifies the host caching requirements. With disk caching enabled, VMs can achieve higher levels of performance. If not specified, the Azure default behavior will be applied. + + + ## Secret + + * `secret` - (Optional) Set of certificates that should be installed on the VM. + * `source_vault` - (Required) The key vault reference, contains the required certificates. + * `name` - (Required) The name of the key vault. + * `resource_group_name` - (Required) The resource group name of the key vault. + * `vault_certificates` - (Required) The required certificate references. + * `certificate_url` - (Optional) The URL of the certificate under the key vault. + * `certificate_store` - (Required) The certificate store directory the VM. The directory is created in the LocalMachine account. + * This field is required only when using Windows OS type + * This field must be ‘null’ when the OS type is Linux + + + ## Security + + * `security` - (Optional) Specifies the Security related profile settings for the virtual machine. + * `secure_boot_enabled` - (Optional) Specifies whether secure boot should be enabled on the virtual machine. + * `security_type` - (Optional) Enum: `"Standard", "TrustedLaunch"` Security type refers to the different security features of a virtual machine. Security features like Trusted launch virtual machines help to improve the security of Azure generation 2 virtual machines. + * `vtpm_enabled` - (Optional) Specifies whether vTPM should be enabled on the virtual machine. + + + ## Tag + + * `tag` - (Optional) Unique Key-Value pair for all Stateful Node Resources. + * `tag_key` - (Optional) Tag Key for Stateful Node Resources. + * `tag_value` - (Optional) Tag Value for Stateful Node Resources. + + + ## Health + + * `health` - (Optional) Set the auto healing preferences for unhealthy VMs. + * `health_check_types` - (Optional, Enum `"vmState", "applicationGateway"`) Healthcheck to use to validate VM health. + * `unhealthy_duration` - (Optional) Amount of time to be unhealthy before a replacement is triggered. + * `auto_healing` - (Required) Enable Autohealing of unhealthy VMs. + * `grace_period` - (Optional) Period of time to wait for VM to reach healthiness before monitoring for unhealthiness. + + + ## Persistence + + * `should_persist_os_disk` - (Required) Should persist os disk. + * `os_disk_persistence_mode` - (Optional, Enum `"reattach", "onLaunch"`) + * `should_persist_data_disks` - (Required) Should persist data disks. + * `data_disks_persistence_mode` - (Optional, Enum `"reattach", "onLaunch"`) + * `should_persist_network` - (Required) Should persist network. + + + ## Scheduling Tasks + + * `scheduling_task` - (Optional) Scheduling settings object for stateful node. + * `is_enabled` - (Required) Is scheduled task enabled for stateful node. + * `type` - (Required, Enum `"pause", "resume", "recycle") The type of the scheduled task + * `cron_expression` (Required) A expression which describes when to execute the scheduled task (UTC). + + + ## Signals + + * `signal` - (Optional) A signal object defined for the stateful node. + * `type` - (Required, Enum `"vmReady", "vmReadyToShutdown"`) The type of the signal defined for the stateful node. + * `timeout` - (Required, Default `"1800"`) The timeout in seconds to hold the vm until a signal is sent. If no signal is sent the vm will be replaced (vmReady) or we will terminate the vm (vmReadyToShutdown) after the timeout. + + *** + + + ## Attach Data Disk + + * `attach_data_disk` - (Optional) Create a new data disk and attach it to the stateful node. + * `data_disk_name` - (Required) The name of the created data disk. + * `data_disk_resource_group_name` - (Required) The resource group name in which the data disk will be created. + * `storage_account_type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. + * `size_gb` - (Required) The size of the data disk in GB, Required if dataDisks is specified. + * `zone` - (Optional, Enum `"1", "2", "3"`) The Availability Zone in which the data disk will be created. If not defined, the data disk will be created regionally. + * `lun` - (Optional, Default `"orginal"`) The LUN of the data disk. If not defined, the LUN will be set in order. + + + ## Detach Data Disk + + * `detach_data_disk` - (Optional) Detach a data disk from a stateful node. + * `data_disk_name` - (Required) The name of the detached data disk. + * `data_disk_resource_group_name` - (Required) The resource group name in which the data disk exists. + * `should_deallocate` - (Required) Indicates whether to delete the data disk in addition to detach. + * `ttl_in_hours` - (Required, Default `"0"`) Hours to keep the disk alive before deletion. + + + ## Update State + + * `update_state` - (Optional) Update the stateful node state. + * `state` - (Required, Enum `"pause", "resume", "recycle"`) New state for the stateful node. + + + ## Import VM + + * `import_vm` - (Optional) Import an Azure VM and create a stateful node by providing a node configuration. + * `resource_group_name` - (Required) Name of the Resource Group for Stateful Node. + * `original_vm_name` - (Required) Azure Import Stateful Node Name. + * `draining_timeout` - (Optional) Hours to keep resources alive. + * `resources_retention_time` - (Optional) Hours to keep resources alive. + + + ## Deallocation Config + + * `delete` - (Required) Specify deallocation parameters for stateful node deletion. + * `should_terminate_vm` - (Required) Indicates whether to delete the stateful node's VM. + * `network_should_deallocate` - (Required) Indicates whether to delete the stateful node's network resources. + * `network_ttl_in_hours` - (Optional, Default: 96) Hours to keep the network resource alive before deletion. + * `disk_should_deallocate` - (Required) Indicates whether to delete the stateful node's disk resources. + * `disk_ttl_in_hours` - (Optional, Default: 96) Hours to keep the disk resource alive before deletion. + * `snapshot_should_deallocate` - (Required) Indicates whether to delete the stateful node's snapshot resources. + * `snapshot_ttl_in_hours` - (Optional, Default: 96) Hours to keep the snapshots alive before deletion. + * `public_ip_should_deallocate` - (Required) Indicates whether to delete the stateful node's public ip resources. + * `public_ip_ttl_in_hours` - (Optional, Default: 96) Hours to keep the public ip alive before deletion. + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. """ @@ -1141,6 +1641,506 @@ def __init__(__self__, """ Provides a Spotinst stateful node Azure resource. + ## Example Usage + + + ```python + import pulumi + import pulumi_spotinst as spotinst + + test_stateful_node_azure = spotinst.StatefulNodeAzure("testStatefulNodeAzure", + region="eastus", + resource_group_name="spotinst-azure", + description="example_stateful_node_azure_description", + strategy=spotinst.StatefulNodeAzureStrategyArgs( + draining_timeout=30, + fallback_to_on_demand=True, + optimization_windows=["Tue:19:46-Tue:20:46"], + od_windows=["Wed:19:46-Wed:21:46"], + availability_vs_cost=100, + revert_to_spot=spotinst.StatefulNodeAzureStrategyRevertToSpotArgs( + perform_at="timeWindow", + ), + preferred_life_cycle="od", + capacity_reservations=[spotinst.StatefulNodeAzureStrategyCapacityReservationArgs( + should_utilize=True, + utilization_strategy="utilizeOverOD", + capacity_reservation_groups=[spotinst.StatefulNodeAzureStrategyCapacityReservationCapacityReservationGroupArgs( + crg_name="crg name", + crg_resource_group_name="resourceGroupName", + crg_should_prioritize=True, + )], + )], + ), + os="Linux", + od_sizes=[ + "standard_ds1_v2", + "standard_ds2_v2", + ], + spot_sizes=[ + "standard_ds1_v2", + "standard_ds2_v2", + ], + preferred_spot_sizes=["standard_ds1_v2"], + zones=[ + "1", + "3", + ], + preferred_zone="1", + custom_data="", + shutdown_script="", + user_data="", + vm_name="VMName", + vm_name_prefix="VMNamePrefix", + license_type="SLES_BYOS", + boot_diagnostics=[spotinst.StatefulNodeAzureBootDiagnosticArgs( + is_enabled=True, + storage_url="https://.blob.core.windows.net/test", + type="unmanaged", + )], + data_disks=[ + spotinst.StatefulNodeAzureDataDiskArgs( + size_gb=1, + lun=1, + type="Standard_LRS", + ), + spotinst.StatefulNodeAzureDataDiskArgs( + size_gb=10, + lun=2, + type="Standard_LRS", + ), + ], + extensions=[spotinst.StatefulNodeAzureExtensionArgs( + name="extensionName", + type="customScript", + publisher="Microsoft.Azure.Extensions", + api_version="2.0", + minor_version_auto_upgrade=True, + protected_settings={ + "script": "IyEvYmluL2Jhc2gKZWNobyAibmlyIiA+IC9ob29uaXIudHh0Cg==", + }, + public_settings={ + "fileUris": ["https://testspot/Azuretest.sh"], + }, + )], + image=spotinst.StatefulNodeAzureImageArgs( + marketplace_images=[spotinst.StatefulNodeAzureImageMarketplaceImageArgs( + publisher="Canonical", + offer="UbuntuServer", + sku="16.04-LTS", + version="latest", + )], + custom_images=[spotinst.StatefulNodeAzureImageCustomImageArgs( + custom_image_resource_group_name="resourceGroupName", + name="imageName", + )], + galleries=[spotinst.StatefulNodeAzureImageGalleryArgs( + gallery_resource_group_name="resourceGroupName", + gallery_name="galleryName", + image_name="imageName", + version_name="1.1.0", + )], + ), + load_balancers=[spotinst.StatefulNodeAzureLoadBalancerArgs( + type="loadBalancer", + resource_group_name="testResourceGroup", + name="testLoadBalancer", + sku="Standard", + backend_pool_names=[ + "testBackendPool1", + "testBackendPool2", + ], + )], + login=spotinst.StatefulNodeAzureLoginArgs( + user_name="admin", + ssh_public_key="33a2s1f3g5a1df5g1ad3f2g1adfg56dfg==", + ), + managed_service_identities=[spotinst.StatefulNodeAzureManagedServiceIdentityArgs( + name="mySI2", + resource_group_name="myResourceGroup", + )], + network=spotinst.StatefulNodeAzureNetworkArgs( + network_resource_group_name="subnetResourceGroup", + virtual_network_name="vname", + network_interfaces=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceArgs( + is_primary=True, + subnet_name="testSubnet", + assign_public_ip=True, + public_ip_sku="Standard", + network_security_groups=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceNetworkSecurityGroupArgs( + network_resource_group_name="test", + name="test", + )], + enable_ip_forwarding=True, + private_ip_addresses=["172.23.4.20"], + additional_ip_configurations=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceAdditionalIpConfigurationArgs( + name="test", + private_ip_address_version="IPv4", + )], + public_ips=[spotinst.StatefulNodeAzureNetworkNetworkInterfacePublicIpArgs( + network_resource_group_name="resourceGroup", + name="test", + )], + application_security_groups=[spotinst.StatefulNodeAzureNetworkNetworkInterfaceApplicationSecurityGroupArgs( + network_resource_group_name="AsgResourceGroup", + name="AsgName", + )], + )], + ), + os_disk=spotinst.StatefulNodeAzureOsDiskArgs( + size_gb=30, + type="Standard_LRS", + caching="ReadOnly", + ), + secrets=[spotinst.StatefulNodeAzureSecretArgs( + source_vaults=[spotinst.StatefulNodeAzureSecretSourceVaultArgs( + name="string", + resource_group_name="string", + )], + vault_certificates=[spotinst.StatefulNodeAzureSecretVaultCertificateArgs( + certificate_url="string", + certificate_store="string", + )], + )], + security=spotinst.StatefulNodeAzureSecurityArgs( + security_type="Standard", + secure_boot_enabled=False, + vtpm_enabled=False, + ), + tags=[spotinst.StatefulNodeAzureTagArgs( + tag_key="Creator", + tag_value="string", + )], + health=spotinst.StatefulNodeAzureHealthArgs( + health_check_types=["vmState"], + unhealthy_duration=300, + grace_period=120, + auto_healing=True, + ), + should_persist_os_disk=False, + os_disk_persistence_mode="reattach", + should_persist_data_disks=True, + data_disks_persistence_mode="reattach", + should_persist_network=True, + scheduling_tasks=[ + spotinst.StatefulNodeAzureSchedulingTaskArgs( + is_enabled=True, + type="pause", + cron_expression="44 10 * * *", + ), + spotinst.StatefulNodeAzureSchedulingTaskArgs( + is_enabled=True, + type="resume", + cron_expression="48 10 * * *", + ), + spotinst.StatefulNodeAzureSchedulingTaskArgs( + is_enabled=True, + type="recycle", + cron_expression="52 10 * * *", + ), + ], + signals=[ + spotinst.StatefulNodeAzureSignalArgs( + type="vmReady", + timeout=20, + ), + spotinst.StatefulNodeAzureSignalArgs( + type="vmReady", + timeout=40, + ), + ], + proximity_placement_groups=[spotinst.StatefulNodeAzureProximityPlacementGroupArgs( + name="TestPPG", + resource_group_name="TestResourceGroup", + )], + deletes=[spotinst.StatefulNodeAzureDeleteArgs( + should_terminate_vm=True, + network_should_deallocate=True, + network_ttl_in_hours=0, + disk_should_deallocate=True, + disk_ttl_in_hours=0, + snapshot_should_deallocate=True, + snapshot_ttl_in_hours=0, + public_ip_should_deallocate=True, + public_ip_ttl_in_hours=0, + )]) + # ------------------------------------------------------------------- + ``` + + + # Argument Reference + + The following arguments are supported: + + * `name` - (Required) Azure stateful node name. + * `region` - (Required) The Azure region your stateful node will be created in. + * `resource_group_name` - (Required) Name of the Resource Group for stateful node. + * `description` - (Optional) Describe your Azure stateful node. + + + ## Strategy + + * `strategy` - (Required) Strategy for stateful node. + * `draining_timeout` - (Optional, Default `120`) Time (in seconds) to allow the VM be drained from incoming TCP connections and detached from MLB before terminating it during a scale down operation. + * `availability_vs_cost` - (Optional) Set the desired preference for the Spot market VM selection. (100- Availability, 0- cost). + * `fallback_to_on_demand` - (Required) In case of no spots available, Stateful Node will launch an On-demand instance instead. + * `optimization_windows` - (Optional) Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))", not empty if revertToSpot.performAt = timeWindow. + * `od_windows` - (Optional) Define the time windows in which the underlying VM will be set as an on-demand lifecycle type. During the entire time window, the rest of the strategy processes will be paused. + Switching between on-demand and Spot VM types at the enter/exit of the time window will trigger the recycling of the stateful node. Valid format: "ddd:hh:mm-ddd:hh:mm (day:hour(0-23):minute(0-59))". + * `preferred_life_cycle` - (Optional, Enum `"od", "spot"`, Default `"spot"`) The desired type of VM. + * `revert_to_spot` - (Optional) Hold settings for strategy correction - replacing On-Demand for Spot VMs. + * `perform_at` - (Required, Enum `"timeWindow", "never", "always"`, Default `"always"`) Settings for maintenance strategy. + * `capacity_reservation` - (Optional) On-demand Capacity Reservation group enables you to reserve Compute capacity in an Azure region or an Availability Zone for any duration of time. [CRG can only be created on the Azure end.](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-create) + * `should_utilize` - (Required) Determines whether capacity reservations should be utilized. + * `utilization_strategy` - (Required, Enum `"utilizeOverSpot", "utilizeOverOD"`) The priority requested for using CRG. This value will determine if CRG is used ahead of spot VMs or On-demand VMs. (`"utilizeOverOD"`- If picked, we will use CRG only in case On demand should be launched. `"utilizeOverSpot"`- CRG will be preferred over Spot. Only after CRG is fully used, spot VMs can be used.) + * `capacity_reservation_groups` - (Optional) List of the desired CRGs to use under the associated Azure subscription. When null we will utilize any available reservation that matches the launch specification. + * `crg_name` - (Required) The name of the CRG. + * `crg_resource_group_name` - (Required) Azure resource group name + * `crg_should_prioritize` - The desired CRG to utilize ahead of other CRGs in the subscription. + + + ## Compute + + * `os` - (Required, Enum `"Linux", "Windows"`) Type of operating system. + * `od_sizes` - (Required) Available On-Demand sizes. + * `spot_sizes` - (Required) Available Spot-VM sizes. + * `preferred_spot_sizes` - (Optional) Prioritize Spot VM sizes when launching Spot VMs for the group. If set, must be a sublist of compute.vmSizes.spotSizes. + * `zones` - (Optional, Enum `"1", "2", "3"`) List of Azure Availability Zones in the defined region. If not defined, Virtual machines will be launched regionally. + * `preferred_zone` - (Optional, Enum `"1", "2", "3"`) The AZ to prioritize when launching VMs. If no markets are available in the Preferred AZ, VMs are launched in the non-preferred AZ. Must be a sublist of compute.zones. + * `custom_data` - (Optional) This value will hold the YAML in base64 and will be executed upon VM launch. + * `shutdown_script` - (Optional) Shutdown script for the stateful node. Value should be passed as a string encoded at Base64 only. + * `user_data` - (Optional) Define a set of scripts or other metadata that's inserted to an Azure virtual machine at provision time. (Base64 encoded) + * `vm_name` - (Optional) Set a VM name that will be persisted throughout the entire node lifecycle. This can't be set if `vm_name_prefix` is set. + * `vm_name_prefix` - (Optional) Set a VM name prefix to be used for all launched VMs and the VM resources. This can't be set if `vm_name` is set. + * `license_type` - (Optional) Specify an existing Azure license type to use when launching new VMs. Valid values for Windows OS: "Windows_Server", "Windows_Client", Valid values for Linux OS: "RHEL_BYOS", "SLES_BYOS" + + + ## Boot Diagnostics + + * `boot_diagnostics` + * `is_enabled` - (Optional) Allows you to enable and disable the configuration of boot diagnostics at launch. + * `storage_url` - (Optional) The storage URI that is used if a type is unmanaged. The storage URI must follow the blob storage URI format ("https://.blob.core.windows.net/"). StorageUri is required if the type is unmanaged. StorageUri must be ‘null’ in case the boot diagnostics type is managed. + * `type` - (Optional, Enum `"managed", "unmanaged"`) Defines the storage type on VM launch in Azure. + + + ## Data Disks + + * `data_disk` - (Optional) The definitions of data disks that will be created and attached to the stateful node's VM. + * `size_gb` - (Required) The size of the data disk in GB, required if dataDisks is specified. + * `lun` - (Required) The LUN of the data disk. + * `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. + + + ## Extensions + + * `extension` - (Optional) An object for an azure extension. + * `name` - (Required) Required on compute.launchSpecification.extensions object. + * `type` - (Required) Required on compute.launchSpecification.extensions object. + * `publisher` - (Required) Required on compute.launchSpecification.extensions object. + * `api_version` - (Required) The API version of the extension. Required if extension specified. + * `minor_version_auto_upgrade` - (Required) Required on compute.launchSpecification.extensions object. + * `protected_settings` - (Optional) Object for protected settings. + * `public_settings` - (Optional) Object for public settings. + + + ## Image + + * `image` + * `marketplace_image` - (Optional) Select an image from Azure's Marketplace image catalogue. Required if the custom image or gallery image are not specified. + * `publisher` - (Required) Image publisher. + * `offer` - (Required) Image offer. + * `sku` - (Required) Image Stock Keeping Unit, which is the specific version of the image. + * `version` - (Required, Default `"latest"`) Image's version. if version not provided we use "latest". + * `gallery` - (Optional) Gallery image definitions. Required if custom image or marketplace image are not specified. + * `gallery_resource_group_name` - (Required) The resource group name for gallery image. + * `gallery_name` - (Required) Name of the gallery. + * `image_name` - (Required) Name of the gallery image. + * `version_name` - (Required) Image's version. Can be in the format x.x.x or 'latest'. + * `custom_image` - (Optional) Custom image definitions. Required if marketplace image or gallery image are not specified. + * `custom_image_resource_group_name` - (Required) The resource group name for custom image. + * `name` - (Required) The name of the custom image. + + + ## Load Balancer + + * `load_balancer` - (Optional) Add a load balancer. For Azure Gateway, each Backend Pool is a separate load balancer. + * `type` - (Required, Enum `"loadBalancer", "applicationGateway"`) The type of load balancer. + * `resource_group_name` - (Required) The Resource Group name of the Load Balancer. + * `name` - (Required) Name of the Application Gateway/Load Balancer. + * `sku` - (Optional) + * if type is `"LoadBalancer"` then possible values are `“Standard", "Basic”`. + * If ApplicationGateway then possible values are + `“Standard_Large”, “Standard_Medium”, “Standard_Small”, “Standard_v2", “WAF_Large”, “WAF_Medium", “WAF_v2"`. + * `backend_pool_names` - (Optional) Name of the Backend Pool to register the Stateful Node VMs to. Each Backend Pool is a separate load balancer. Required if Type is APPLICATION_GATEWAY. + + + ## Login + + * `login` - (Required) Set admin access for accessing your VMs. Password/SSH is required for Linux. + * `user_name` - (Required) username for admin access to VMs. + * `ssh_public_key` - (Optional) SSH for admin access to Linux VMs. Optional for Linux. + * `password` - (Optional) Password for admin access to Windows VMs. Required for Windows. + + + ## Managed Service Identities + + * `managed_service_identities` - (Optional) Add a user-assigned managed identity to the Stateful Node's VM. + * `name` - (Required) name of the managed identity. + * `resource_group_name` - (Required) The Resource Group that the user-assigned managed identity resides in. + + + ## Proximity Placement Groups + + * `proximity_placement_groups` - (Optional) Defines the proximity placement group in which the VM will be launched. + * `name` - (Required) name of the proximity placement group. + * `resource_group_name` - (Required) The Resource Group name of the proximity placement group. + + + ## Network + + * `network` - (Required) Define the Virtual Network and Subnet for your Stateful Node. + * `network_resource_group_name` - (Required) Vnet Resource Group Name. + * `virtual_network_name` - (Required) Virtual Network. + * `network_interface` - (Required) Define a network interface + * `is_primary` - (Required) Defines whether the network interface is primary or not. + * `subnet_name` - (Required) Subnet name. + * `assign_public_ip` - (Optional) Assign public IP. + * `public_ip_sku` - (Optional) Required if assignPublicIp=true values=[Standard/Basic]. + * `network_security_group` - (Optional) Network Security Group. + * `network_resource_group_name` - (Required) Requires valid security group name. + * `name` - (Required) Requires valid resource group name. + * `enable_ip_forwarding` - (Optional) Enable IP Forwarding. + * `private_ip_addresses` - (Optional) A list with unique items that every item is a valid IP. + * `additional_ip_configurations` - (Optional) Additional configuration of network interface. + * `name` - (Required) Configuration name. + * `private_ip_address_version` - (Required, Enum `"IPv4", "IPv6"` Default `"IPv4"`) Version of the private IP address. + * `public_ips` - (Optional) Defined a pool of Public Ips (from Azure), that will be associated to the network interface. We will associate one public ip per instance until the pool is exhausted, in which case, we will create a new one. + * `resource_group_name` - (Required) The resource group of the public ip. + * `name` - (Required) - The name of the public ip. + * `application_security_groups` - (Optional) Network Security Group. + * `resource_group_name` - (Required) Requires valid security group name. + * `name` - (Required) Requires valid resource group name. + + + ## OS Disk + + * `os_disk` - (Optional) Specify OS disk specification other than default. + * `size_gb` - (Optional, Default `"30"`) The size of the data disk in GB. + * `type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS"`) The type of the OS disk. + * `caching` - (Optional, Enum `"None", "ReadOnly", "ReadWrite"`) Specifies the host caching requirements. With disk caching enabled, VMs can achieve higher levels of performance. If not specified, the Azure default behavior will be applied. + + + ## Secret + + * `secret` - (Optional) Set of certificates that should be installed on the VM. + * `source_vault` - (Required) The key vault reference, contains the required certificates. + * `name` - (Required) The name of the key vault. + * `resource_group_name` - (Required) The resource group name of the key vault. + * `vault_certificates` - (Required) The required certificate references. + * `certificate_url` - (Optional) The URL of the certificate under the key vault. + * `certificate_store` - (Required) The certificate store directory the VM. The directory is created in the LocalMachine account. + * This field is required only when using Windows OS type + * This field must be ‘null’ when the OS type is Linux + + + ## Security + + * `security` - (Optional) Specifies the Security related profile settings for the virtual machine. + * `secure_boot_enabled` - (Optional) Specifies whether secure boot should be enabled on the virtual machine. + * `security_type` - (Optional) Enum: `"Standard", "TrustedLaunch"` Security type refers to the different security features of a virtual machine. Security features like Trusted launch virtual machines help to improve the security of Azure generation 2 virtual machines. + * `vtpm_enabled` - (Optional) Specifies whether vTPM should be enabled on the virtual machine. + + + ## Tag + + * `tag` - (Optional) Unique Key-Value pair for all Stateful Node Resources. + * `tag_key` - (Optional) Tag Key for Stateful Node Resources. + * `tag_value` - (Optional) Tag Value for Stateful Node Resources. + + + ## Health + + * `health` - (Optional) Set the auto healing preferences for unhealthy VMs. + * `health_check_types` - (Optional, Enum `"vmState", "applicationGateway"`) Healthcheck to use to validate VM health. + * `unhealthy_duration` - (Optional) Amount of time to be unhealthy before a replacement is triggered. + * `auto_healing` - (Required) Enable Autohealing of unhealthy VMs. + * `grace_period` - (Optional) Period of time to wait for VM to reach healthiness before monitoring for unhealthiness. + + + ## Persistence + + * `should_persist_os_disk` - (Required) Should persist os disk. + * `os_disk_persistence_mode` - (Optional, Enum `"reattach", "onLaunch"`) + * `should_persist_data_disks` - (Required) Should persist data disks. + * `data_disks_persistence_mode` - (Optional, Enum `"reattach", "onLaunch"`) + * `should_persist_network` - (Required) Should persist network. + + + ## Scheduling Tasks + + * `scheduling_task` - (Optional) Scheduling settings object for stateful node. + * `is_enabled` - (Required) Is scheduled task enabled for stateful node. + * `type` - (Required, Enum `"pause", "resume", "recycle") The type of the scheduled task + * `cron_expression` (Required) A expression which describes when to execute the scheduled task (UTC). + + + ## Signals + + * `signal` - (Optional) A signal object defined for the stateful node. + * `type` - (Required, Enum `"vmReady", "vmReadyToShutdown"`) The type of the signal defined for the stateful node. + * `timeout` - (Required, Default `"1800"`) The timeout in seconds to hold the vm until a signal is sent. If no signal is sent the vm will be replaced (vmReady) or we will terminate the vm (vmReadyToShutdown) after the timeout. + + *** + + + ## Attach Data Disk + + * `attach_data_disk` - (Optional) Create a new data disk and attach it to the stateful node. + * `data_disk_name` - (Required) The name of the created data disk. + * `data_disk_resource_group_name` - (Required) The resource group name in which the data disk will be created. + * `storage_account_type` - (Required, Enum `"Standard_LRS", "Premium_LRS", "StandardSSD_LRS", "UltraSSD_LRS"`) The type of the data disk. + * `size_gb` - (Required) The size of the data disk in GB, Required if dataDisks is specified. + * `zone` - (Optional, Enum `"1", "2", "3"`) The Availability Zone in which the data disk will be created. If not defined, the data disk will be created regionally. + * `lun` - (Optional, Default `"orginal"`) The LUN of the data disk. If not defined, the LUN will be set in order. + + + ## Detach Data Disk + + * `detach_data_disk` - (Optional) Detach a data disk from a stateful node. + * `data_disk_name` - (Required) The name of the detached data disk. + * `data_disk_resource_group_name` - (Required) The resource group name in which the data disk exists. + * `should_deallocate` - (Required) Indicates whether to delete the data disk in addition to detach. + * `ttl_in_hours` - (Required, Default `"0"`) Hours to keep the disk alive before deletion. + + + ## Update State + + * `update_state` - (Optional) Update the stateful node state. + * `state` - (Required, Enum `"pause", "resume", "recycle"`) New state for the stateful node. + + + ## Import VM + + * `import_vm` - (Optional) Import an Azure VM and create a stateful node by providing a node configuration. + * `resource_group_name` - (Required) Name of the Resource Group for Stateful Node. + * `original_vm_name` - (Required) Azure Import Stateful Node Name. + * `draining_timeout` - (Optional) Hours to keep resources alive. + * `resources_retention_time` - (Optional) Hours to keep resources alive. + + + ## Deallocation Config + + * `delete` - (Required) Specify deallocation parameters for stateful node deletion. + * `should_terminate_vm` - (Required) Indicates whether to delete the stateful node's VM. + * `network_should_deallocate` - (Required) Indicates whether to delete the stateful node's network resources. + * `network_ttl_in_hours` - (Optional, Default: 96) Hours to keep the network resource alive before deletion. + * `disk_should_deallocate` - (Required) Indicates whether to delete the stateful node's disk resources. + * `disk_ttl_in_hours` - (Optional, Default: 96) Hours to keep the disk resource alive before deletion. + * `snapshot_should_deallocate` - (Required) Indicates whether to delete the stateful node's snapshot resources. + * `snapshot_ttl_in_hours` - (Optional, Default: 96) Hours to keep the snapshots alive before deletion. + * `public_ip_should_deallocate` - (Required) Indicates whether to delete the stateful node's public ip resources. + * `public_ip_ttl_in_hours` - (Optional, Default: 96) Hours to keep the public ip alive before deletion. + :param str resource_name: The name of the resource. :param StatefulNodeAzureArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. diff --git a/upstream b/upstream index 216780c0..723de659 160000 --- a/upstream +++ b/upstream @@ -1 +1 @@ -Subproject commit 216780c09b0b4da3d607b4a055d759125ef03e96 +Subproject commit 723de65901c1befbe496428cd4c93985a861b80b